12.07.2015 Views

PLCHandler Programming Guide - Esco Drives & Automation

PLCHandler Programming Guide - Esco Drives & Automation

PLCHandler Programming Guide - Esco Drives & Automation

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>PLCHandler</strong> <strong>Programming</strong> <strong>Guide</strong>Appendix D: ActiveX-Control of the <strong>PLCHandler</strong> under WindowsThe <strong>PLCHandler</strong> also will be provided as ActiveX Control.Before first use the ActiveX-Control must be registered with the following command:regsvr32 plchandlerx.ocxThen the <strong>PLCHandler</strong>X class can be used in a Visual-Basic, Delphi or C++ project.The following methods deviate from the methods in the <strong>PLCHandler</strong>:Connection establishment:Method: long ::ConnectByString(long lId, LPCTSTR pszConfigString, long lConfigLen,long StateChangedEvent, LPCTSTR pszLogFile);Parameter ulId specifies the index of the <strong>PLCHandler</strong>, if several instances are used.Parameter pszConfigString points to a string containing the content of the ini-file of theconfiguration. For information on the structure of this ini-file please see Fehler!Verweisquelle konnte nicht gefunden werden. lConfigLen specifies the length of theconfigurationstring.StateChangedEvent: Here optionally the handle of an event can be processed, via which theclient can be informed at each state change.pszLogFile is the name of a log file, where the <strong>PLCHandler</strong> optionally can record all importantactions.Method: long ::ConnectViaGateway(LPCTSTR pszGatewayIP, LPCTSTR pszPlcIP,LPCTSTR pszProtocol, LPCTSTR pszLogFile);This method can be used to establish a connection via TCPIP and the Gateway to a PLCunder Windows. For this purpose only the IP-address of the Gateway as well as the IPaddressof the PLC must be passed. Default setting is the Tcpip L2 Route Protocol („Tcp/Ip(Level 2 Route)“).Method: long ::ConnectViaArti(LPCTSTR pszPlcIP, LPCTSTR pszProtocol,LPCTSTR pszLogFile);Method:This method can be used to establish a connection via TCPIP and ARTI to a PLC. For thispurpose only the IP-address of the PLC must be passed. Default setting is Tcpip L2 RouteProtocol.long ::ConnectViaSimulation(LPCTSTR pszSdbFile, LPCTSTR pszLogFile);Via this method the connection to the simulation mode and to a SDB-file is established. Justthe name of the SDB-file must be specified. Thereby also a complete path can be defined.Browsing of variables:Method:Method:long ::GetNumberOfSymbols();Returns the number of available variables in the PLC.long ::GetSymbol(long lIndex, LPCTSTR pszSymbol, long lMaxLen);GetNumberOfSymbols() can be used to get the number of available variables.GetSymbol() can be used to get the name of the variable which is specified by the index.Synchronous Reading of variables:Method:long ::SyncReadVarFromPlc(LPCTSTR pszSymbol, long lAddressData, long lSize);lAddressData specifies the address, where the value of the variables is stored.pszSymbol specifies the name of one variable. 3S - Smart Software Solutions GmbH<strong>PLCHandler</strong> Programmming <strong>Guide</strong>.doc Page 15 of 17

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!