changes
This commit is contained in:
parent
9bdd889bc4
commit
22b8ee6404
@ -9,7 +9,7 @@ client.socket = ser
|
||||
client.connect()
|
||||
|
||||
try:
|
||||
result = client.write_register(address=0x9c47, unit=4, value=0x8000)
|
||||
result = client.write_register(address=0x9c48, unit=4, value=0x000F)
|
||||
# result = client.write_coil(address=0x0000, unit=4, value=1)
|
||||
print(result)
|
||||
except Exception as e:
|
||||
|
@ -61,13 +61,13 @@ class HoldingRegisterDatapoint(AbstractModbusDatapoint):
|
||||
self.writeRequestValue = None
|
||||
else:
|
||||
# perform read operation
|
||||
print("Holding register, perform read operation")
|
||||
# print("Holding register, perform read operation")
|
||||
result = client.read_holding_registers(address=self.address,
|
||||
count=self.count,
|
||||
unit=self.unit)
|
||||
if type(result) in [ExceptionResponse, ModbusIOException]:
|
||||
raise DatapointException(result)
|
||||
print("{0}: {1!s}".format(self.label, result.registers))
|
||||
# print("{0}: {1!s}".format(self.label, result.registers))
|
||||
pubQueue.put(MqttProcessor.PublishItem(self.publishTopic, str(result.registers)))
|
||||
if successFull:
|
||||
self.lastContact = datetime.datetime.now()
|
||||
|
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user