Skip to main content

Beckhoff TwinCAT Driver

Driver to communicate with Beckhoff TwinCAT plcs using the ADS protocol, and the python library pyads.

Parameters

Aside from the common parameters described in the communication_driver docs, this driver includes:

ParameterDefault ValueDescription
net_id192.168.0.1.1.1The Beckhoff TwinCAT route to the PLC.
port851Port to connect to.

Setup data

The setup data will give values to the parameters required and will specify the I/O variables info.

{
"parameters": {
"net_id": "192.168.1.160.1.1",
"port": 851
},
"variables": {
"GVL.Digital_In1": {
"datatype": "bool",
"size": 1,
"operation": "write"
},
"GVL.Digital_Out1": {
"datatype": "bool",
"size": 1,
"operation": "read"
}
}
}
note

The setup_params in the generic PLC components for twincat_ads will need the following format:

{ "net_id": "192.168.1.160.1.1", "port": 851 }