17.08.2016, 06:16
If your modbus device is using full 16-bit range [0..65535], you can use bit shift to discard lowest 8 bits:
Also, I would suggest using profiles instead of scripts.
Code:
value = bit.rshift(value, 8)
grp.write('1/1/1', value, dt.uint8) -- force value range to [0..255]
Also, I would suggest using profiles instead of scripts.