Is it possible to connect to a modbus-RTU only for listening?

14 views
Skip to first unread message

Jakub Ladman

unread,
Dec 5, 2020, 10:47:08 AM12/5/20
to libmodbus
Hello

I have my own modules developed using libmodbus and everything is finally working as expected.
Now i would like to make a bridge from a third party bus to gather selected information from it in noninvasive way.

Its modbus master is an air conditioning unit which is talking to several sensors. I would like to connect my own RS-485 device to the bus and make as many memory arrays as slave ID's seen on the bus and copy the information from the packets as they will appear.

I can't see any direct way looking neither at the libmodbus API  or in its source code.

Is it even possible in the principle?
The only way i can imagine is to patch the library in the way, that every slave device registered will behave as if the messages received have ID=0, thus copying their content without replying. But this will work only for the messages coming from the master.

I'm afraid that libmodbus doesn't count on this situation.

Thanks for your opinions.

Jakub Ladman

Chuck Watson

unread,
Dec 5, 2020, 11:13:00 AM12/5/20
to libm...@googlegroups.com

It would be difficult to do what you suggest in the way you suggest.

 

If all the devices are your own, why do you need to do this in a “noninvasive way”?

 

If you don’t control the master, what you could do is build a repeater that would physically be wired between the master and the slaves. This repeater would simply take every poll request from the master and repeat it on the other side and do the reverse with the responses. The idea is that neither the master or the slaves would know any different. However, the code on the repeater would “see” every transaction and could send the data wherever else you wanted.

 

Chuck Watson BS, CEM, CMVP

Direct USA 724-799-1529

--
Vous recevez ce message, car vous êtes abonné au groupe Google Groupes "libmodbus".
Pour vous désabonner de ce groupe et ne plus recevoir d'e-mails le concernant, envoyez un e-mail à l'adresse libmodbus+...@googlegroups.com.
Cette discussion peut être lue sur le Web à l'adresse https://groups.google.com/d/msgid/libmodbus/bab22aa1-27bc-4228-af57-294aa49ead2en%40googlegroups.com.

image001.gif

Jakub Ladman

unread,
Dec 5, 2020, 1:37:51 PM12/5/20
to libm...@googlegroups.com
Hello Chuck

Thank for your quick response.

Maybe I made a mistake mentioning the modules i have developed. This was only to demonstrate that i have experience with libmodbus.


The bus that is relevant to the question doesn't contain my modules. It is compact solution by the A/C manufacturer. There are A/C unit with its sensors to be used together.

I want to leave the bus as independent as possible. Only to listen for the information available there.

I'm afraid the way you mentioned can deteriorate the reliability of the original system by considerable amount.

I really want to make it read only.
No unauthorized packets on the bus and no delay of the original messages.

Thank you.

Jakub Ladman

Dne so 5. 12. 2020 17:13 uživatel Chuck Watson <wat...@gmail.com> napsal:
Vous recevez ce message, car vous êtes abonné à un sujet dans le groupe Google Groupes "libmodbus".
Pour vous désabonner de ce sujet, visitez le site https://groups.google.com/d/topic/libmodbus/gZBGBD3-03E/unsubscribe.
Pour vous désabonner de ce groupe et de tous ses sujets, envoyez un e-mail à l'adresse libmodbus+...@googlegroups.com.
Cette discussion peut être lue sur le Web à l'adresse https://groups.google.com/d/msgid/libmodbus/07d701d6cb21%247fc64d70%247f52e850%24%40gmail.com.

Flavio Castro Alves Filho

unread,
Dec 16, 2020, 11:39:17 AM12/16/20
to libm...@googlegroups.com
Hello,

I believe it is possible, but I don't know if the standard library implementation supports this feature.

It is worth checking on modbus_set_slave() part how it behaves, in relation to the remaining functions of the library.

Best regards,

Flavio




--
Reply all
Reply to author
Forward
0 new messages