This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Modbus slave disable
#1
Hi,
Is there any way to disable a modbus slave (when using profiles) from a script?
Thanks.
Reply
#2
Why would you like to do it?
------------------------------
Ctrl+F5
Reply
#3
(31.07.2024, 07:18)Daniel Wrote: Why would you like to do it?

Because this slave has a slow response time (1 register per second), and it seems that it slows all the polling cycle (we have 5 slaves in this line). 
When this slowest device is read, we have some write timeouts on other slaves... (don't know why...)
So, we want to disable it when we need to write, and enable again when done...

(The second RS485 is used for other devices and it's not posssible to change this device to this one...)
Reply
#4
You can use scripts instead of a profile to read this device. This way you can have a delay between reads without blocking other operations. Use mbproxy library: https://forum.logicmachine.net/showthrea...7#pid22637
Reply
#5
(01.08.2024, 06:41)admin Wrote: You can use scripts instead of a profile to read this device. This way you can have a delay between reads without blocking other operations. Use mbproxy library: https://forum.logicmachine.net/showthrea...7#pid22637

And how mbproxy is assigned to RTU port 1 or 2? I've seen how to set the slave but not from which port...
Reply
#6
Use this:
Code:
require('mbproxy')
portnr = 1 -- either 1, 2 or 3
mb = mbproxy.new(portnr)
Reply
#7
(01.08.2024, 09:15)admin Wrote: Use this:
Code:
require('mbproxy')
portnr = 1 -- either 1, 2 or 3
mb = mbproxy.new(portnr)

Ok thanks!
Reply


Forum Jump: