OPC XML-DA Server
This chapter describes how to configure the OPC XML DA Server on BECKHOFF PC based systems.
Summary :
The OPC-XML DA server is configured with default xml-configuration file. Just activate once a checkbox in PLC-Control to download the symbol information to target device.
With TwinCAT 2.10 Build 1240 (or higher) there is no manual configuration required. Please refer to section "Zero configuration" on this page.
With previous TwinCAT versions please refer to section "Manual or specific configurations" on this page.
Zero configuration (requires TwinCAT 2.10 on host PC)
Details :
- The OPC-XMLDA configuration file "...\wwwroot\TcOpcXmlDa\TcOpcXmlSvrCfg.xml" contains the list of ADS-devices which are available via OPC-XML-DA interface.
- By default this list is pre-configured for one local PLC-runtime system (first PLC runtime-system on ADS-port 801)
- By default the required symbol-information is linked to C:\TwinCAT\Boot\CurrentPlc_1.tpy
<?xml version="1.0"
encoding="utf-8" standalone="no"?>
<TcOpcXmlSvrConfiguration>
<Namespace>
<Devices>
<Device>
<Name>PLC1</Name>
<AdsNetId>0.0.0.0.0.0</AdsNetId>
<AdsPort>801</AdsPort>
<AdsTimeout>2000</AdsTimeout>
<AdsTimeSuspend>20000</AdsTimeSuspend>
<AutoCfg>7</AutoCfg>
<!-- NOTE: CurrentPlc_1.tpy will be downloaded from
PLC-Control -->
<AutoCfgSymFile>C:\TwinCAT\Boot\CurrentPlc_1.tpy</AutoCfgSymFile>
<Disabled>0</Disabled>
</Device>
</Devices>
</Namespace>
</TcOpcXmlSvrConfiguration>
With TwinCAT Version 2.10 Build 1240 the PLC Control allows to download the symbol file <plc-project-name>.TYP to the target TwinCAT machine. The TPY file contains information about all available PLC-variables in the PLC-project.
OPC-XML DA CE Server requires this TPY-information.
To download the current symbol information in a TPY file navigate in the PLC-Control to "Project-->Options-->TwinCAT" and check the option "Download Symbol description"
With each download of the PLC-code now also the <project-name>.TPY file is downloaded as "C:\TwinCAT\Boot\CurrentPlc_1.tpy" containing information about symbols of first run time system.
(Second runtime system would be "C:\TwinCAT\Boot\CurrentPlc_2.tpy" etc.)
Summary:
The OPC-XML DA server is configured with default xml-configuration file. Just activate the checkbox to download the symbol information within PLC-Control environment.
OPC-XML DA Server checks configuraton on startup. See notes to reload configuration today (without reboot). |
Optional manual or specific configurations ?
If the default configuration is not available you have to configure the opc-xml-da configuration file "...\wwwroot\TcOpcXmlDa\TcOpcXmlSvrCfg.xml" manual.
- If required the opc-xml configuration file can be done with TwinCAT OPC COnfigurator
Sample for OPC XML DA server accessing multiple ADS devices
<?xml version="1.0"
encoding="utf-8" standalone="no"?>
<TcOpcXmlSvrConfiguration>
<Namespace>
<Devices>
<Device>
<Name>PLC1</Name>
<AdsNetId>0.0.0.0.0.0</AdsNetId>
<AdsPort>801</AdsPort>
<AdsTimeout>2000</AdsTimeout>
<AdsTimeSuspend>20000</AdsTimeSuspend>
<AutoCfg>7</AutoCfg>
<!-- NOTE: CurrentPlc_1.tpy will be downloaded from
PLC-Control -->
<AutoCfgSymFile>C:\TwinCAT\Boot\CurrentPlc_1.tpy</AutoCfgSymFile>
<Disabled>0</Disabled>
</Device>
<Device>
<Name>PLC2</Name>
<AdsNetId>0.0.0.0.0.0</AdsNetId>
<AdsPort>811</AdsPort>
<AdsTimeout>2000</AdsTimeout>
<AdsTimeSuspend>20000</AdsTimeSuspend>
<AutoCfg>7</AutoCfg>
<!-- NOTE: CurrentPlc_2.tpy will be downloaded from
PLC-Control -->
<AutoCfgSymFile>C:\TwinCAT\Boot\CurrentPlc_2.tpy</AutoCfgSymFile>
<Disabled>0</Disabled>
</Device>
</Devices>
</Namespace>
</TcOpcXmlSvrConfiguration>
OPC-XML DA Server checks configuraton on startup. Reconfiguration might require a new start today. |