Search code examples
pythonmodbuscan-buscanopen

How does CANopen client communicate with Modbus slave through CANopen/Modbus gateway ?


I am now studying and developing a CANopen client with a python stack and i'm struggling to find out how to communicate with a slave Modbus through a gateway.

Since the gateway address is the one present in the Object Dictionary of the CANopen, and the Gateway has addresses of modbus Slaves I/O, how to specify the address of the modbus input ?

As i can see it CANopen uses the node-ID to select the server and an address to select the property to read/write, but in this case i need to go farther than that and point an input.

just to be clear i'm in the "studying" phase i have no CANopen/Modbus gateway in mind.

Regards.


Solution

  • This will be the gateway's business to fix. There is no general answer, nor is there a standard for how such gateways work. Gateways have some manner of software that allows you to map data between the two field buses. In this case I suppose it would be either a specific CANopen PDO or a specific CAN id that you map to a Modbus address.

    In case you are just writing a CANopen client, neither you or the firmware should need to worry about Modbus. Just make a CANopen node that is standard compliant and let the gateway deal with the actual protocol conversion.

    You may however have to do the PDO mapping in order to let your client and the gateway know how to speak with each other, but that should preferably be a user-level configuration of the finished product, rather than some hard-coded mapping.