pymodbus-dev / pymodbus

A full modbus protocol written in python
Other
2.23k stars 911 forks source link

How to read the message which is being sent to modbus device in order to receive data from it ? #553

Closed Abbad-Zafar closed 3 years ago

Abbad-Zafar commented 3 years ago

Versions

Pymodbus Specific

Description

What were you trying, what has happened, what went wrong, and what did you expect?

Code and Logs

 # code and logs here.
Abbad-Zafar commented 3 years ago

@dhoomakethu

dhoomakethu commented 3 years ago

Can you be more specific please?, I am not quite getting the question.

Abbad-Zafar commented 3 years ago

I want the hex response or packet which the master sends to slave or vice versa

l337quez commented 3 years ago

I would like to know how to read the complete message including reading the unit id

dhoomakethu commented 3 years ago

@Abbad-Zafar there is no direct way at present to get raw response. You may have to reverse engineer the registers to get the frame.

Abbad-Zafar commented 3 years ago

@dhoomakethu Doesn't the logging show info about packets ? What are being sent and what are being received ?

dhoomakethu commented 3 years ago

You can view the data if you running with level debug.

nhi-vanye commented 3 years ago

A spin out RFE for Serial would be to use serial.serial_for_url() instead of serial.Serial() to allow the spy:// url schema to be used.

https://pyserial.readthedocs.io/en/latest/url_handlers.html

github-actions[bot] commented 3 years ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] commented 3 years ago

This issue was closed because it has been stalled for 5 days with no activity.