Receiving Data from the TwinCAT I/O task
1st Step TwinCAT I/O task configuration
In the TwinCAT System Manager navigate through "System configuration ->Additional tasks -> Task x". Once there, activate "Create symbol entry".
2nd Step Import into the TwinCAT OPC server
Start TwinCAT-OPC-Configurator "Start - All Programs - TwinCAT System - TwinCAT OPC - TwinCAT OPC Configurator"
In the left navigation tree please select "I/O Devices" with a right click the menu item "New".
Enter a name for that ADS device in field "Name".
The name has to be OPC conform. Special characters are not allowed.
The device-name will be part of the ItemID later.
Sample: TwinCAT-PLC was defined with a variable "Temp". Choosing the devicename as "IO1" the opc-server present the variable as "IO1.Temp".
With click on "OK" we get the new dialog for further settings of device :
Following settings have to be checked :
Type | Req./Opt. | Description |
---|---|---|
Name | Req | Name for device like "IO1". OPC-Client browse this name |
Description | Optional |
|
AutoCfg | Optional | 5 : Upload symbolic from ADS-device. |
AutoCfgFile | Optional | will be ignored |
|
|
|
AdsPort | Req | Number of ADS-PortID, like 302 for next IO task |
AdsNetId | Optional | specific ADS-NetId, like "174.12.15.45.1.1" If not specified or like "0.0.0.0.0.0", the OPC-Server will always communicate to AdsNetId of local ADS-router. |
AdsTimeout | Optional | ADS timeout in ms for this ADS device. If ADS device will not replay within this time, the OPC-Server will set the requested variables to "BAD QUALITY". |
AdsTimeSuspend | Optional | ADS suspend time in ms for this ADS device, if the ads communication fails. If an ADS device is running, it does not make sense to communicate with high frequence to that device. In case of ads-communication trouble the OPC-Server will wait till next ads-request to that device. |
|
|
|
Disable | Optional | Disables this device. OPC-Server will ignore this device. |
See detailed description in appendix.
3 rd step : Check and save configuration
Save the configuration unter current name or select menu "File - Save As..." to insert a new name.
The OPC-Configurator will save the XML based file.
After saving the OPC-configurationfile we get the option to activate this configuration to be the configuration for next startup of OPC-Server.
After selecting "Yes" this current configuration will be the start-configuration of the opc-server. With next start of OPC-Server this new configuration will be active.
If you activated a new OPC-configuration, but the OPC-Server still has old namespace and settings the reason is that the OPC-Server was not stopped and restarted. |