mirror of
https://github.com/JoelBender/modpypes
synced 2025-10-12 21:15:10 +08:00
update value checking
This commit is contained in:
parent
8eb513af23
commit
d372e714ac
|
@ -125,9 +125,9 @@ class SimpleServer(Client):
|
|||
raise ModbusException(ExceptionResponse.ILLEGAL_DATA_ADDRESS)
|
||||
|
||||
# check the value and save it
|
||||
if (req.value == 0x00):
|
||||
if (req.value == 0x0000):
|
||||
self.coils[req.address] = 0
|
||||
elif (req.value == 0xFF):
|
||||
elif (req.value == 0xFF00):
|
||||
self.coils[req.address] = 1
|
||||
else:
|
||||
raise ModbusException(ExceptionResponse.ILLEGAL_DATA_VALUE)
|
||||
|
|
Loading…
Reference in New Issue
Block a user