bitmeal / ros-modbus-device-driver

Mozilla Public License 2.0
18 stars 8 forks source link

Rostopic list not shown for ROS MODBUS DEVICE DRIVER NODE #6

Open sivaeinfo opened 1 year ago

sivaeinfo commented 1 year ago

Hi, I am working on ROS modbus to communicate with PLC to read holding register of Delta AS228P PLC. I have installed the ros modbus device driver package and run the rosrun ros_modbus_device_driver modbus_device_driver.py _mapping:=devicemapping.json with mapping of json file. It was executed without error. But when I run rostopic list, it doesn't show any active topic. Can you give me a solution for this issue. I have modified json file. Shall I specifiy the same name for coil, discrete input and holding register that you have given in readme portion in github link? Do you want me to create subscriber program to access the holding register? In your paper, you have given different topic name for coil and register. In github you specified different one. Which one I would prefer to use.

My Delta PLC coil address is 00001 Holding register address is 40001

sivaeinfo commented 1 year ago

I am working on ROS modbus to communicate with PLC to read holding register of Delta AS228P PLC. I have installed the ros modbus device driver package

https://github.com/bitmeal/ros-modbus-device-driver/tree/master

and run the rosrun ros_modbus_device_driver modbus_device_driver.py _mapping:=devicemapping.json with mapping of json file. It was executed without error. But when I run rostopic list, it doesn't show any active topic. Can anyone give me a solution for this issue. I have modified json file. Shall I specifiy the same name for coil, discrete input and holding register which was given in readme portion in github link? Do you want me to create subscriber program to access the holding register? In their paper, they have given different topic name for coil and register. In github, the author specified different one. Which one I would prefer to use.

My Delta PLC coil address is 00001 Holding register address is 40001

Below is the configured json file

// modbus-slave configuration example { "name": "mymodbusslave",

"address": "192.168.1.5", "port": 502, "unit": 0, "timeout": 3,

"rate": 20,

"byteorder_reverse": false, // byte order: default, big endian "wordorder_reverse": false, // word order: default, little endian

"discrete_read_continuous": true, "discrete_read_separation_gap": 64,

"registers_read_continuous": false,

"mapping": { "coils": { "gripper": 1, "signal": 2, // ... }, "discrete_inputs": { "overload": 10001, "presence": 10010, // ... }, "input_registers": { "distance": { "address": 40001, "type": "WORD" }, // ... }, "holding_registers": { "name": { "address": 40000, "type": "WORD", }, // ... } }

image

bitmeal commented 1 year ago

Your are executing the command rosrun ros_modbus_device_driver modbus_device_driver.py _/mapping:=devicemapping.json in the directory ~/modbs_ws. I spot one issue and one potential issue:

  1. you typed _/mapping with an additional /. Remove it to read _mapping
  2. The location of the config file must relative to the current working directory ~/modbs_ws, or you have to give an absolute/full path
sivaeinfo commented 1 year ago

image Hi, I did what you have mentioned in your post. Still, I am not getting the list of topics for (rostopic_list command )

bitmeal commented 11 months ago

I cannot reproduce this error. Are your sure the file devicemapping.json is actually in the directory you are starting your node from? In the case above this would require the file to be present as ~/modbus_ws/devicemapping.json