modbus RTU error code

Topics about the Software of Revolution Pi
Post Reply
domotica
Posts: 10
Joined: 12 Apr 2018, 09:32
Answers: 0

modbus RTU error code

Post by domotica »

Hi,

We use core 3 (jessie) connected with USB to an arduino communicating with modbus RTU master on the rev.

Read/write no problems.

Reading is done every 3000 ms

at a random time (could be a day/week) reading stops on 3 of our 5 devices.

piTest -r Modbus_Master_status: 0 dez (=00 hex)
piTest -r Modbus_Action_Status_1: 110 dez (=6e hex)

After trying to reset with piTest -w Action_Status_reset_1,1 the status went back to 0 for +/- 20 sec. after that it went back to 110 dez (=6e hex)

Any thoughts on this?

Kind regards

Bryan
User avatar
dirk
KUNBUS
Posts: 1926
Joined: 15 Dec 2016, 13:19
Answers: 4

Re: modbus RTU error code

Post by dirk »

The error code 0x6e indicates a connection error. This may be due to the wiring or simply because the slave did not respond fast enough. This can happen but the error must be acknowledged. You have already done this correctly. That the error occurs now with 3 of 5 devices can be caused by the wiring or interference by magnetic fields. What is implemented with TCP/IP by the transport layer (TCP), namely the retransmit, etc. is not available with Modbus RTU.
Unfortunately, we have not listed all error codes in our tutorial about Modbus RTU Master, because they originate from the Modbus specification.
The problem that the error status occurs again and again after about 20 seconds also seems strange to me. Maybe the Arduino's are playing into it, too, and swallow themselves up.
Since you still use Jessie, it is advisable to update the packages. Please update the Modbus packages with the following commands:

Code: Select all

sudo apt update
sudo apt install pimodbus-slave pimodbus-master
User avatar
Ingo
Posts: 266
Joined: 10 Nov 2016, 21:56
Answers: 1
Location: Luth.Wittenberg

Re: modbus RTU error code

Post by Ingo »

Hallo Dirk,

ich habe das gleiche Problem, nur nicht mit RTU sondern TCP/IP und es kommt nicht von dem Arduino. Dieser Status ist ok und bringt kein Fehler. der Fehler wird bei mir vom RevPI selber ausgelöst da ich dort zwei Schnelle Zähler abfrage, Pin 11 und 14.
Wir haben die zykluszeit auch schon auf 10sec gesetzt, aber der Fehler wird trotzdem ausgelöst.
Updates wurden gemacht
domotica
Posts: 10
Joined: 12 Apr 2018, 09:32
Answers: 0

Re: modbus RTU error code

Post by domotica »

Hi Dirk,

We will check on the arduino side if the error starts over there.
In the meantime we are looking into the error checks.

When we detach the USB cable of a working modbus slave device (arduino) there is no error triggered on the Modbus_Master_status. Is this normal?
The last values in the Modbus are kept reading and no errors occurs.
Is there any other way to check that the cable is still plugged in.

kind regards

Bryan
Eduard
KUNBUS
Posts: 209
Joined: 18 Jun 2018, 16:16
Answers: 0

Re: modbus RTU error code

Post by Eduard »

Hi Bryan,

The Modbus_Master_Status can display the following error codes.
- 16 Initialization failed
- 17 Serial connection cannot be opened (device name wrong, invalid configuration)

Whether the cable is plugged in or not is indicated in the Modbus_Action_Status.
When disconnecting the cable, the error code 110 "CONECTION TIMED OUT" should be displayed.
The error code 110 is also displayed if the response time of the slave is too long.
However, we are working on making the timeout time adjustable in piCtory.

king regards
Eduard
Post Reply