yecao
Three slave stations are connected via the USB to RS485 module. The slave modules are ID1 ID2 ID3.
The OpenPLC V3 configuration can be communicated normally by adding any slave module.
But if you add two or more, the communication times out.
Whether the OpenPLC Modbus RTU is connected to multiple slave modules on the same port does not use the polling mechanism, resulting in the failure to join the multi-slave module.

The slave module uses the Modbus poll test on the computer to allow multiple blocks of normal communication.
Modbus Poll test.png
Reply 0 0
thiagoralves
It seems that there is a bug when OpenPLC has multiple slave devices assigned for the same port. I will probably have to restructure the driver to make it work properly. In any case, can I see your logs?
Reply 0 0
dennie
I also encountered the same problem
Reply 0 0
dennie
Same communication port MODBUS ID: 1~3
Continuous reading id1~3
Id1 ok
Id2 ok
Id3 fail
Reply 0 0
pbosscha
Just to share from my side, have 15 devices being polled (DI / DO / AI / AO) and things look pretty stable. This did not work under Windows (port conflict), but works well under Ubuntu
Reply 0 0
yecao
[QUOTE username = pbosscha userid = 5959107 postid = 1305823582]只是为了与我分享,有15个设备被轮询(DI / DO / AI / AO),事情看起来非常稳定。这在Windows(端口冲突)下不起作用,但在Ubuntu的下运行良好 [/ QUOTE]

Are you testing with the RS485 bus?
Reply 0 0
pbosscha
Yes.
To be honest, I'm simulating 15 slaves from a single device, so the only real world difference is RS485 bus loading. Running that at 115200 Baud. Has been running for a couple of days now without any problems.
For interest sake, the polling rate I'm seeing is around 16 milliseconds per device, which means my entire stack is refreshed slightly faster than 4 times per second.
Reply 0 0
thiagoralves
pbosscha, what are the errors you faced under Windows? OpenPLC uses libmodbus to do all the serial port handling and modbus messaging to slave devices. This library seems to be pretty stable, but when I was rechecking their documentation, I realized that I might have done something wrong when multiple devices uses the same serial port. Instead of closing and reopening the serial port (as I currently do), I should have just changed the slave address and keep the port open. At first it looked to me as just a performance improvement, as closing and opening ports takes time, but now that some users are reporting issues with multiple devices hooked up to a single port, I'm wondering if that could actually be the root of the issue.

I don't have RS-485 devices here to test, so that's why I can't debug much. I'm kinda developing support for these devices in the dark, without actually knowing if they will work. How is your 15 slaves simulation running? Did you actually configured 15 different devices on OpenPLC?
Reply 0 0
pbosscha
Hi Thiago,

Under Windows as soon as I configured a second device and then started to run the PLC I started getting errors, as far as I can remember something to do with port conflicts. Simply changing slave addresses would make the most sense, I actually did not understand why each slave has a port definition, although it's useful if using RS232 devices and thus multiple ports.

Yes, I configured 15 Devices within the "Slave Devices" and all seems to work just fine.
Reply 0 0
dennie
Is it possible to release the update file so that I can use it (the port is not closed during communication)

I use 3 MODBUS devices on the same RS-485 communication port (id: 1.2.3). I need to place an invalid command after each read device so that I can read the next MODBUS ID device correctly.
EX:
READ MODBUS ID-1
READ MODBUS ID-100 (Invalid device does not exist)
READ MODBUS ID-2
READ MODBUS ID-100 (Invalid device does not exist)
READ MODBUS ID-3
READ MODBUS ID-100 (Invalid device does not exist)
Reply 0 0
yecao
logs 
Multi slaves not work.
Reply 0 0
thiagoralves
dennie wrote:
Is it possible to release the update file so that I can use it (the port is not closed during communication)

There is no update file. OpenPLC slave devices driver apparently seems to be broken which means that me (or someone else willing to help) will have to check it and fix it.
yecao wrote:
logs 
Multi slaves not work.

yecao, are you running OpenPLC runtime on Windows, Linux, or Raspberry Pi? Have you tried the same setup on a different architecture (i.e. Linux as opposed to Windows, etc)?
Reply 0 0
dennie
This is too frustrating. I look forward to your early repair.
Reply 0 0
thiagoralves
dennie wrote:
This is too frustrating. I look forward to your early repair.

Since I am developing this project alone, the fix is most likely not coming soon, as I don’t have a lot of free time right now.

If you find it frustrating to use a free and open source sorftware that you haven’t even paid anything for, then I suggest you move to something else like CoDeSys. I bet they have great support, constant bug fixes and good features. That is if you don’t mind paying €504.00 for a single license of their runtime:  https://store.codesys.com/systeme/codesys-control-rte-sl.html?___store=en
Reply 0 0
dennie
I wonder if I am honored to participate in this project, I have PLC and RTU design experience
Reply 0 0
Reply