Only released in EOL distros:  

Package Summary

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)

Overview

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.

Install

  1. Clone the stack into your catkin workspace
  2. git clone https://github.com/HumaRobotics/modbus.git

  3. 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.

Tutorials

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.

Examples

Siemens S7-1200 PLC controlled by a Python ROS node:

Nodes

modbus_client.py

Creates 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 Topics

modbus_wrapper/output (std_msgs/Int32MultiArray)
  • Corresponds to the outputs of your PLC. Set a non zero value to activate an output.

Published Topics

modbus_wrapper/input (std_msgs/Int32MultiArray)
  • Corresponds to the inputs of the PLC.

modbus_server.py

Creates a Python modbus TCP server and runs several tests, if combined with the client.

Subscribed Topics

modbus_server/read_from_registers (std_msgs/Int32MultiArray)
  • Corresponds to the readable modbus registers.

Published Topics

modbus_server/write_to_registers (std_msgs/Int32MultiArray)
  • Corresponds to the writeable modbus registers.

Wiki: modbus (last edited 2015-04-21 15:35:38 by wagdi)