1
0
mirror of https://github.com/JoelBender/modpypes synced 2025-10-12 21:15:10 +08:00

update value checking

This commit is contained in:
Joel Bender 2017-04-25 15:54:08 -04:00
parent 8eb513af23
commit d372e714ac

View File

@ -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)