ADS stands for Automation Device Specification. It is a device-independent and fieldbus-independent interface to devices manufactured by Beckhoff Automation.
This protocol implementation allows the communication to such devices and provides the user the ability to create endpoints for reading, writing and subscribe for changes on the data provided by them.
Below you can see configuration parameters and examples on how to build a commissioning file for this protocol.
If data is written to Beckhoff ADS it must be provided as JSON object with the following fields:
The id (optional) could be anything. It is used for correlation of the request and response.
The value (mandatory) field is the actual data that is going to be written.
If raw bytes should be written, the JSON representation of a Javascript Buffer should be used.
Note: If 64-bit integers are being used (which are unsupported in JSON but Javascript support those by the BigInt class), they should be written using a Buffer object.
The following JSON message should be sent to a /set topic:
If data is read from Beckhoff ADS, the output will be provided as a JSON object.
For a read endpoint, additionally a correlation id (id) can be set in the payload of the message request, to ensure the correct identification of responses to specific requests.
The following JSON message can be sent to a /req topic:
description:> Sample ADS service commissioning filemetadata:name:Sample ADS serviceicon:https://www.cybus.io/wp-content/uploads/2017/10/for-whom1.svgprovider:cybushomepage:https://www.cybus.ioversion:1.0.0parameters:# The local NetId of the client. Should be unique on all clients connected to the same ADS Router.adsLocalNetId:type:stringdescription:The local address of the client (local AMS NetId)default:192.168.7.12.1.1adsLocalPort:type:integerdescription:The local TCP port used to communicate to the devicedefault:32000adsHost:type:stringdescription:The device address (IP address or hostname) of the ADS router to connect todefault:192.168.2.170adsRouterTcpPort:type:integerdescription:This is the TCP port of the ADS router that is being connected todefault:48898# This is not the TCP used but the setting usually known as PortNr# assigned to each device in the ADS router.# The actual TCP used by the ADS library is 48898.adsPort:type:integerdescription:AMS Port of the ADS device. This is not the TCP port used but the setting usually known as PortNr.; the actual TCP port is adsRouterTcpPortdefault:851adsNetId:type:stringdescription:AMS Net ID of the ADS device.default:192.168.2.170.1.1resources:adsConnection:type:Cybus::Connectionproperties:protocol:Adsconnection:localAddress:!refadsLocalNetId# The local NetId of the client.localPort:!refadsLocalPorthost:!refadsHostrouterTcpPort:!refadsRouterTcpPortport:!refadsPort# This is not the TCP used but the setting usually known as PortNr.netId:!refadsNetId# The device NetIdadsQuery1:type:Cybus::Endpointproperties:protocol:Adsconnection:!refadsConnectionsubscribe:symbolName:'MAIN.byByte[4]'dataType:'int8'interval:1000adsQuery2:type:Cybus::Endpointproperties:protocol:Adsconnection:!refadsConnectionwrite:symbolName:'MAIN.byByte[4]'dataType:'int8'mapping:type:Cybus::Mappingproperties:mappings: - subscribe:endpoint:!refadsQuery1publish:topic:'output-topic' - subscribe:topic:'input-topic'publish:endpoint:!refadsQuery2