TwinCAT OPC Server CE : Optimization
This article describes how to minimize the OPC-namespace of TwinCAT-OPC-Server CE.
Take care to NOT load all PLC variables into OPC-Server namespace but instead load that smaller list of PLC variables which are required via OPC in the OPC-client.
CE is designed for small systems with limited resources like CPU and memory. Due to this the optimization of namespace is highly recommended for OPC-Servers running on CE. |
In general the opc-server is configured by the OPC-XML configuration file to find the detailed symbol information for each ADS device.
- The option <AutoCfg>7</AutoCfg> is designed to import all variables defined in TPY files
OPC DA : Limitation today : Only global variables (Strings / ints / Bools..) are imported. Today no structures are imported.
OPC XMLDA : No limitation - The option <AutoCfg>8</AutoCfg> is designed to import just a subset of PLC variables marked in the PLC-code to be available for OPC..
OPC DA : Limitation today : Only global variables (Strings / ints / Bools..) are imported. Today no structures are imported.
OPC XML : No limitation
In this sample the PLC variable "bMemAlarm"1 will not be available via OPC-Server.
The variable "iReadOnly" is marked to be an OPC-variable and is available for OPC-clients. Additional the OPC-Item Property 5 (defined by OPC-Foundation) is set to "1" which means, the opc-server will handle this variable as "Read-Only" . OPC-Server will take care, that OPC-clients can not write to that PLC-variable.
Extra comments in PLC-IEC1131 Editor will modify the configuration of opc-server: