Only released in EOL distros:
The modbus package
- Maintainer: Sven Bock <sb AT generationrobots DOT com>, Wagdi Ben yaala <wb AT generationrobots DOT com>
- Author: Sven Bock <sb AT generationrobots DOT com>
- License: BSD
- Source: git https://github.com/HumaRobotics/modbus.git (branch: master)
The modbus stack provides a wrapper from the modbus TCP communication to standardized ROS messages. The modbus stack is based on pymodbus, is written in Python and contains 3 packages:
- The package modbus is the basic python wrapper for a modbus server and client for ROS
- The package modbus_cognex_insight inherits the modbus client base class and which uses specific registers. The client can send job_ids to the camera and retrieve the results of the jobs as well as barcodes and strings.
- The package modbus_plc_siemens inherits the modbus client base class and changes the register size.
- Clone the stack into your catkin workspace
- Invoke a catkin_make in your catkin root
After the catkin_make the Python modbus classes are also available from the outside and can be easily integrated in other packages.
Even is the modbus packages have only been tested with a few Siemens PLCs and Insight cameras, the package may also work for other models, as long as they support a modbus TCP server. However the hardware model has to be changed inside the Insight or Step7 project.
Siemens S7-1200 PLC controlled by a Python ROS node:
modbus_client.pyCreates a Python modbus TCP client and runs several tests using the topic and Python interface. The modified client for the Siemens PLC and Insight camera use the same topics, but address different registers.
Subscribed Topicsmodbus_wrapper/output (std_msgs/Int32MultiArray)
- Corresponds to the outputs of your PLC. Set a non zero value to activate an output.
Published Topicsmodbus_wrapper/input (std_msgs/Int32MultiArray)
- Corresponds to the inputs of the PLC.
modbus_server.pyCreates a Python modbus TCP server and runs several tests, if combined with the client.
Subscribed Topicsmodbus_server/read_from_registers (std_msgs/Int32MultiArray)
- Corresponds to the readable modbus registers.
Published Topicsmodbus_server/write_to_registers (std_msgs/Int32MultiArray)
- Corresponds to the writeable modbus registers.