modbus master failure

Topics about the Software of Revolution Pi
Post Reply
RMeissnerCC
Posts: 58
Joined: 03 Dec 2019, 10:29

modbus master failure

Post by RMeissnerCC »

Dear all,
we use a RevPiCore 3+ with a USB-to-RS485 adapter. I am using the adapter together with the Modbus RTU Master in piCtory to read values from several devices. We had the case in which a loss of power due to a connected ssd or the manual reading of a modbus device causes the Modbus RTU Master to fail/stop working. Is there any indication apart from the kernel log to see whether the Master is working or not?
Best, Robert
User avatar
dirk
KUNBUS
Posts: 2174
Joined: 15 Dec 2016, 13:19

Re: modbus master failure

Post by dirk »

Have a look at this tutorial How to Use RevPi Core as Modbus TCP Master
If a communication error occurs, the error code is written to the Modbus register “Modbus_Master_Status”.
The error stays in this register until the value “1” is written manually into the Modbus register “Master_Status_Reset”.
[...]
“Modbus_Action_Status_[1… 32]”.
The error stays in this register until the value “1” is written manually into the Modbus register “Action_Status_Reset_[1… 32]”.
RMeissnerCC
Posts: 58
Joined: 03 Dec 2019, 10:29

Re: modbus master failure

Post by RMeissnerCC »

Hy Dirk,
thank you for your reply. That was helpful.

Interestingly enough, I monitored this Modbus_Master_Status and unplugged the modbus adapter. The status stays at 0. No error message.
Is this a bug or something which is not projected into the Modbus_Master_Status? None of the first four Modbus_Action_Status_XX showed something else than zero.
Best, Robert
RMeissnerCC
Posts: 58
Joined: 03 Dec 2019, 10:29

Re: modbus master failure

Post by RMeissnerCC »

Hy Dirk,
I delved a bit deeper. The "Modbus_Master_Status" often shows zero even though there is an error. The "Modbus_Action_Status" shows more often errors. Checking both actually works to catch most errors.

There remains one: if I enter a wrong device_path in pictory or change the device path of the device itself, none of those two measures throws an error. Is there a reason for that? Is there something else I could check?

I would love NOT to read the kernel log therefore I am happy for the flags you offer so far.
Best, Robert
User avatar
Amar
KUNBUS
Posts: 160
Joined: 15 Jul 2019, 12:58

Re: modbus master failure

Post by Amar »

Hi Robert,
The Modbus_Master_Status is involved with the device path i.e. if you configured a device /dev/ttyUSB0 which is not present or available.
The Modbus_Action_Status is involved when the ModbusRTU slave is involved i.e. if it is not present.
The current implementation is that every action as a corresponding action status which you have to query.

Reference:
https://revolution.kunbus.de/forum/view ... f=6&t=1671
KUNBUS
RMeissnerCC
Posts: 58
Joined: 03 Dec 2019, 10:29

Re: modbus master failure

Post by RMeissnerCC »

Hy Amar,
thank you for your answer, that is indeed great news.
Best, Robert
User avatar
dirk
KUNBUS
Posts: 2174
Joined: 15 Dec 2016, 13:19

Re: modbus master failure

Post by dirk »

Thank you for your positive reply.
Post Reply