Beispiel #1
0
 def write(self,value,params={}):
     digit = params.get('nb_digit',nb_digit)
     if not isinstance(digit,int) : # automatic digit case
         raw_value = modbus.read_holding_register(address_write,value_type_write)
         float_value = modbus.read_holding_register(address_read,value_type_read)
         digit = _nb_digit(raw_value,float_value)
         params['nb_digit'] = digit
     write_value = value * 10 ** digit
     return modbus.write_holding_register(address_write,value_type_write,write_value)
Beispiel #2
0
 def read(self) :
     return modbus.read_holding_register(address,value_type)
Beispiel #3
0
 def read(self):
     value = modbus.read_holding_register(address,'b')
     return enum_type.get(value,'Unknown')