Commit d4dac9ba authored by Yoann Sallaz Damaz's avatar Yoann Sallaz Damaz
Browse files

new conversion table

parent 420299d0
Pipeline #47694 failed with stages
......@@ -21,26 +21,38 @@ class inclino_FIP:
self.logical_device = config["logical_device"]
self.sign = config["sign"]
self.offset = config["offset"]
self.A = config["calib_A"]
self.B = config["calib_B"]
self.channel = self.wago.controller.devname2key(self.logical_device)
def get_I_corrected(self):
return 0.000976562728506*(self.wago.controller.client_read_input_registers(self.channel,"H")& 0xFFF8)-4.81352318359996E-6
def read(self):
log_debug(self, "Inclino read()")
return self.sign*((self.wago.controller.client_read_input_registers(self.channel,"H")& 0xFFF8)*0.9765625/1000)+self.offset
Icorrected = self.get_I_corrected()
return self.sign*(self.A*Icorrected+self.B)+self.offset
def __info__(self):
register = self.wago.controller.client_read_input_registers(self.channel,"H")
XFU = self.wago.controller.client_read_input_registers(self.channel,"H") & 0x07
X = self.wago.controller.client_read_input_registers(self.channel,"H") & 0x04
F = self.wago.controller.client_read_input_registers(self.channel,"H") & 0x02
U = self.wago.controller.client_read_input_registers(self.channel,"H") & 0x01
raw = self.wago.controller.client_read_input_registers(self.channel,"H") & 0xFFF8
info_string = f"'{self.name}` Inclino_FIP from wago:\n"
info_string += f" Wago = {self.wago.name}\n"
info_string += f" Logical device = {self.logical_device}\n"
info_string += f' Unit = degree\n'
info_string += f" Calib = {self.A}*I + {self.B}"
info_string += f' Sign = {self.sign}\n'
info_string += f' Offset = {self.offset}\n'
info_string += f" register value = {register}\n"
info_string += f" XFU = {XFU}\n"
info_string += f" X (Sensor supply short circuit) = {X}\n"
info_string += f" F (Input short circuit or wire break) = {F}\n"
info_string += f" U (Input overflow) = {U}\n"
info_string += f" raw value = {raw}\n"
info_string += f" value = {self.read()} deg\n"
info_string += f" I corrected = {self.get_I_corrected()}\n"
info_string += f" value = {self.read()}\n"
return info_string
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment