J
Hello,
I'm working on a modbus project using the pycom controller to read a few input registers. But there I get the same error as you Sameer and I'm not able to make the code run correctly.
What did you do that the code work?
Regards,
Jan
current code:
######################### RTU SERIAL MODBUS #########################
uart_id = 0x01
modbus_obj = Serial(uart_id, pins=('P3', 'P4'))
###################### READ INPUT REGISTERS ##################
slave_addr=0x01
starting_address=0x04
register_quantity=2
signed=True
register_value = modbus_obj.read_input_registers(slave_addr, starting_address, register_quantity, signed)
print('Input register value: ' + ' '.join('{:d}'.format(x) for x in register_value))