Name: | Beckhoff ADS | |
Version: | 7.0.2.0 | |
Available for: | Manager V7 (Pro only) | |
Limitation In: | ||
Device Brand: | Beckhoff | |
Positrack Compatible: | No | |
Resources type: |
The Beckhoff ADS MXM provides reading, writing and change notification for variables in a Beckhoff TwinCAT device using the ADS protocol.
The Beckhoff ADS mxm is installed by default starting with Manager 7.1, or through a separate installer for prior Version 7 releases.
The ADS Mxm uses tcp/ip to connect to an ADS router, i.e. a PLC or TwinCAT software. It is necessary to setup the apppropriate routing in the remote ADS Router configuration, in order to allow the Manager instance to access the target device. This MxM does provide a simple method to automatically set ths route (see below) however, this may not be appropriate for all installations.
Please refer to Beckhoff’s online documention for further details. https://www.beckhoff.com/en-en/products/automation/twincat/
The following screenshot shows a example of setting a Route using the Route config page located in the system tray on TwinCAT system.
Note: Remote Route is set to None/Server.
In order to speed up the configuration effort and time for systems which might use a large number of mapped variables, this mxm uses a separate configuration file to provide details about the TwinCAT target system. This version of the MXM supports 1,2 or 4 byte integers, strings, real values, Date and Time ADS variable types.
The config file uses a simple XML format as shown in the following example.
<ADSVariables> <Variable name="test1" adsname="MAIN.test1" cycleTime="100" size="2" notify="y"/> <Variable name="test2" adsname="MAIN.test2" type="integer" size="1"/> <Variable name="test3" adsname="MAIN.test3" type="string" /> <Variable name="test4" adsname="MAIN.test4" type="real" /> <Variable name="adsDate" adsname="MAIN.test5" type="date" /> <Variable name="adsTime" adsname="MAIN.test6" type="time" /> </ADSVariables>
This simple example creates 6 variables in the MXM that map to equivalent variables in the TwinCAT project. The matching code in the TwinCAT project would be something like..
PROGRAM MAIN VAR test1: INT; test2: BOOL; test3: STRING(20) := 'this is a string'; test4: REAL; test5: DATE := D#2023-10-15; test6: TIME := T#2H30M40S500MS; END VAR
Note all Elements and Attributes are case sensitive.
The XML Root element will be “ADSVariables”
each mapped variable has a “Variable” tag with a set of attributes as follows.
Note: The colon is a protected character in Manager variables names. It is therefore not possible to just use the TwinCAT variable name as is,
hence the manager mxm alias.
The setup screen contains the following fields.
The ADS MXM provides the following commands
Synchronously reads the value of a variable on the target TwinCAT device. The value is returned in the mapped mxm variable from the mapping file. Note if the value changes, this will trigger the ‘#’ variable Change notification. ReadVar is an alternative method to enabling notifications, which are a limited resource. It is advised to use ReadVar for slow polling of not critical values, and save notifications for time or show critical variables.
Synchronously writes a value to an Integer variable on the target TwinCAT device. Note the variable name must be included in the mapping file.
Synchronously writes a value to a string variable on the target TwinCAT device. Note the variable name must be included in the mapping file.
Synchronously writes a value to a Real variable on the target TwinCAT device. Note the variable name must be included in the mapping file.
Synchronously writes a value to a Time variable on the target TwinCAT device. Note the variable name must be included in the mapping file.
Synchronously writes a value to a Date variable on the target TwinCAT device. Note the variable name must be included in the mapping file.
[Enum] Specifies the Link Status for the ADS driver. Note this only reflect the state of the connection to a local router and not whether communication can be achieved to the target PLC.
0 - NotConnected
1 - Connected
[Integer,Real,String, Date, Time] Dynamic Variables which provide mirrors for user variables in a TwinCAT project.