changes
This commit is contained in:
@ -11,9 +11,9 @@ def dummyPublisher(processImage):
|
||||
analogInputChangeset = processImage.getChangedAnalogsInputs()
|
||||
|
||||
if discreteInputChangeset != []:
|
||||
print("Discrete: ".format(discreteInputChangeset))
|
||||
print("Discrete: {}".format(discreteInputChangeset))
|
||||
if analogInputChangeset != []:
|
||||
print("Analog: ".format(analogInputChangeset))
|
||||
print("Analog: {}".format(analogInputChangeset))
|
||||
|
||||
# for discreteInputChangeItem in discreteInputChangeset:
|
||||
# print("Discrete input {} changed from {} to {}"
|
||||
|
@ -39,17 +39,14 @@ def modbusHandler(processImage):
|
||||
client.connect()
|
||||
|
||||
reg = client.read_input_registers(0, analogInputBits // 8)
|
||||
print("M0: ".format(type(reg)))
|
||||
if isinstance(reg, ModbusIOException):
|
||||
raise Exception(reg)
|
||||
analogInputs = reg.registers
|
||||
print("M1: ".format(reg.registers))
|
||||
|
||||
reg = client.read_discrete_inputs(0, digitalInputBits)
|
||||
if isinstance(reg, ModbusIOException):
|
||||
raise Exception(reg)
|
||||
discreteInputs = reg.bits
|
||||
print("M2: ".format(reg.bits))
|
||||
|
||||
coils = None
|
||||
with processImage:
|
||||
|
@ -40,12 +40,12 @@ class ProcessImage(Condition):
|
||||
def getChangedDiscreteInputs(self):
|
||||
if not self.initialized:
|
||||
raise NotInitializedException
|
||||
print("D1: ".format(self.discreteInputs))
|
||||
print("D2: ".format(self.shadowDiscreteInputs))
|
||||
print("D1: {}".format(self.discreteInputs))
|
||||
print("D2: {}".format(self.shadowDiscreteInputs))
|
||||
changedDiscreteInputs = zippingFilter(self.discreteInputs, self.shadowDiscreteInputs)
|
||||
print("D3: ".format(changedDiscreteInputs))
|
||||
print("D3: {}".format(changedDiscreteInputs))
|
||||
self.shadowDiscreteInputs = self.discreteInputs
|
||||
print("D4: ".format(self.shadowDiscreteInputs))
|
||||
print("D4: {}".format(self.shadowDiscreteInputs))
|
||||
return changedDiscreteInputs
|
||||
|
||||
def getDiscreteInputs(self):
|
||||
|
Reference in New Issue
Block a user