Automation Interface
TcOPCDriveComCfg provides an Automation Interface to its Document, to expose its basic functionalities. The ProgId of the implementing class is "TcDriveComConfig.Document".
This interface inherits from IDispatch and is accessible both from full featured languages (e.g. VB or C++) and script languages (e.g. VBscript or Javascript).
Methods in VTable Order
Requirements
TcDriveComConfig.Document Methods | Description |
---|---|
ScanTwinCATConfig() | Scan the current TwinCAT configuration. Returns S_OK if successfull or E_FAIL if an error occured |
OpenConfiguration(BSTR* Filename) | Open an existing configuration. Returns the number of imported items or -1 if an error occured |
SaveConfiguration(BSTR* Filename) | Exports the current Document to an OPC Server configuration. Returns the number of items exported or -1 if an error occured |
ActivateConfiguration(BSTR* Filename) | Activates an existing configuration file. True if succeeded, or False otherwise |
VB Sample
Dim Filename As String
Filename = "C:\configuration.xml"
Set TcDrvComCfg = CreateObject("TcDriveComCfg.Document")
Call TcDrvComCfg.ScanTwinCATConfig
Call TcDrvComCfg.SaveConfiguration(Filename)
Call TcDrvComCfg.ActivateConfiguration(Filename)