Data Access
An OPC server represents a standardised interface for the management of process data. The process data available in the TwinCAT system must therefore be known to the OPC server, or must be made known to it at the time of configuration.
To represent this "hierarchical process space" clearly, the "Devices" are subdivided into subsidiary items.
The OPC client can browse through this representation and use it for the server's actual configuration. The TwinCAT OPC server supports the optional browser OPC interface.
This hierarchical display is not to be confused with the configuration of the OPC server that exists at run-time. The run-time configuration of the OPC server, i.e. the creation of groups, specification of the refresh time, the insertion of tags etc. is performed dynamically by the OPC client. |
General
The advantage of configuration via XML with links to the symbols of the ADS devices is that this configuration only must be carried out once. Even if, for instance, the PLC project changes (e.g. if variables are deleted, or if new variables are defined) it is not necessary to change the configuration in the OPC server: each time the OPC service starts, the namespace of the OPC server is correctly built up.
Device Definition
A device represents a TwinCAT ADS device (e.g. a PLC run-time system) that is uniquely identified by the <AdsAmsServerNetID> and the <AdsAmsPortID>.
Further information about the concept of devices in TwinCAT can be found in the general TwinCAT ADS documentation.
Configuration of the TwinCAT OPC server
- Receiving data from the TwinCAT PLC: Configuration by variable import from TwinCAT PLC control
- Receiving Data from the TwinCAT I/O task: Configuration by variable upload from the TwinCAT I/O task
Configuration of the TwinCAT OPC Server CE
In general, the configuration of the TwinCAT OPC Server CE is like the configuration of the TwinCAT OPC Server. The most important information is given here:
- Set the active OPC XML configuration:
PC: The TcOpcStartup.exe tool saves the current OPC XML configuration file in the registry
CE: By default, the file "\hard disk\TwinCAT\OPC\CurrentConfigOpc.xml" is entered in the registry as the current OPC XML configuration file - The OPC XML file for CE works with the same XML scheme
- The OPC XML file must allow for the fact that paths are written using a different notation under CE:
PC example: <AutoCfgFile>C:\Project123\Test.tpy</AutoCfgFile>
Example CE: <AutoCfgFile>\hard disk\project\Test.tpy</AutoCfgFile>