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.

write to modbus with bitmask
#2
The value that you are writing has both bits 0 and 2 set which the Modbus device might reject. Log the returned write result. It might have an error indication.
Code:
value = 4 -- bit 2 set to 1
res, err = mb:writeregisters(33471, value)
log(res, err)

Also keep in mind that using scripts can lead to random errors if two scripts try to access the same serial port in parallel. It is recommended to use profiles instead.
Reply


Messages In This Thread
RE: write to modbus with bitmask - by admin - 09.02.2022, 07:52
RE: write to modbus with bitmask - by admin - 10.02.2022, 08:25
RE: write to modbus with bitmask - by admin - 11.02.2022, 08:03

Forum Jump: