I am working on a slave computer and want to save the data transmitted from the master raspberry pi pico.
In micropython there is modbus library github link. I want to use this library but there is a hardware issue about using rs485. I want communicate direct usb without using rs485. Is it possible ? I can't configure code for this.
Main code example is:
uart_id = 0x01
modbus_obj = Serial(uart_id, pins=('P9', 'P10'))
# if the serial modbus requires a ctrl pin, you can set it like this:
modbus_obj = Serial(uart_id, pins=('P9','P10'), ctrl_pin='P8')
What is uart_id ? And what are pins ? How should I configure this example for send data via usb COM port, I want to read datas from modbus poll on computer.
Also,
######################### READ COILS #########################
#slave_addr=0x0A
#starting_address=0x00
#coil_quantity=100
#coil_status = modbus_obj.read_coils(slave_addr, starting_address, coil_quantity)
#print('Coil status: ' + ' '.join('{:d}'.format(x) for x in coil_status))
Read coils example, there is a slave_addr. What is this and how can I assign this address ?