Closed cprobotik closed 1 year ago
@cprobotik Here there are all examples. As your PICO-W
will be the Modbus TCP Slave
, you can to follow this example: tcp_client_example.py
About to serve a GPIO and/or an ADC on the Slave to the Master request it, you can use the amazing callback feature. In that example above, there is a function def my_inputs_register_get_cb(reg_type, address, val):
that does exactly what you want. And doc about callback feature you can found here
Thank you for your answer, the callback Funktion works great.
The examples you have given are perfekt.
Thank you for the Professional Code.
@cprobotik may you close this issue if your request has been resolved?
Description
Iam New with micropython and the Raspberry Pico W and i would like to create a Modbus TCP IO Divice for a PLC on an Raspberry Pico W I would read some GPIO to send they over Modbus TCP to the Modbus Master
Can someone show me an code example to fix my problem.
Thank you so much
Reproduction steps
1.install Micropython an Modbus on Raspberry was okay 2.I use the Thonny IDE and I can run the TCP Client Example on the Raspberry Pico
MicroPython version
v1.19.1
MicroPython board
Raspberry Pico
MicroPython Modbus version
Relevant log output
No response
User code
No response
Additional informations
No response