Overview
The CiA309-3 gateway is a universal TCP/IP-CANopen gateway according to the CiA specification 309-3. It is available as binary version for Linux and can be used with every Linux using a can4linux or SocketCAN CAN interface. The gateway is also available as source code. In this version it is portable to all platforms that have a CAN interface and a TCP/IP stack with BSD sockets. The CANopen part of the gateway is based on the well-proven CANopen Master Stack by emotas, which supports all relevant CANopen services such as SDO client, PDO producer/consumer, NMT master and heartbeat consumer.
CANopen services
CANopen services according to the CiA 309-3 specification are supported by the gateway:
- SDO Client (data types from 8 to 32 bit, strings and domains)
- PDO Consumer
- PDO Producer
- NMT commands
- Node Guarding Master
- Heartbeat Consumer
- Heartbeat Producer
- Emergency Consumer
- LSS Master (LSS FastScan included)
Further CiA309-3 commands for the configuration of the gateway are also available.
CiA309-3
The specification CiA 309-3 defines a set of ASCII commands that can be sent and received via sockets.
Some CiA309-3 commands for illustration:
// set SDO timeout in milliseconds
set sdo_timeout 500
// read the value of object 0x1000:00 from node 4 with data type U32
4 r 0x1000 0 u32
// write the value 500 to object 0x1017:00 of node 4 with data type U16
4 w 0x1017 0 u16 500
// register PDO reception for PDO with CAN ID 0x200 and 2 U16 objects
set rpdo 1 0x200 2 u16 u16
// start node
1 start
// switch all nodes in the network to PRE-OP
0 preop
// store configuration
store
// restore stored configuration
restore
// start heartbeat monitoring of node 9 (monitoring time 2000 ms)
9 enable heartbeat 2000
...
Using the CANopen-TCP gateway according to CiA309-3 allows to easily integrate CANopen devices into TCP networks. Additional applications that go beyond the functionality of the CiA309-3 specification can be developed with the source code variant on the basis of the CANopen Master Stack.