Modbus RTU Server with multiple slaves

40 views
Skip to first unread message

Nelson Mambre

unread,
Nov 1, 2022, 4:19:03 PM11/1/22
to libmodbus
Hello,

I want to create a simulator like ModRSsim2 https://sourceforge.net/projects/modrssim2/
I created an array of mappings so that each slave can have it's own mapping. There's a single rtu connection.

I have created a master to test, if the master only send a query to 1 slave, it works correctly, but if the master changes the slave id for every query, the server will give errors. I've used com0com (Windows) to test the master and server.

In the Server I "cheat" and set the length to be ably to send a reply. Which functions should I use to manipulate the modbus queries/replies at a lower level?

Master (works with ModRSsim2 but not with my own server)

Slave/Server

Thanks,
Nelson
Reply all
Reply to author
Forward
0 new messages