AIO Values to MOdbus TCP Slave

Topics about the Software of Revolution Pi
Post Reply
h2oil
Posts: 10
Joined: 17 Jan 2020, 17:30
Answers: 0

AIO Values to MOdbus TCP Slave

Post by h2oil »

Im looking to poll values every one second from AIO card InputValue_1-4 and save these to Modbus Slave TCP to be accessible remotely.

Cant find any documentation to do this?
User avatar
dirk
KUNBUS
Posts: 1942
Joined: 15 Dec 2016, 13:19
Answers: 4

Re: AIO Values to MOdbus TCP Slave

Post by dirk »

Hi have a look at this post which ist a Python snipped that you can sure easily adopt according to your needs.
You have to configure the AIO and the ModbusTCP Slave in PiCory first. You can use the virtual module ModbusTCP in PiCtory here:
https://revolution.kunbus.com/tutorials/overview-aio/
https://revolution.kunbus.com/tutorials ... tcp-slave/
h2oil
Posts: 10
Joined: 17 Jan 2020, 17:30
Answers: 0

Re: AIO Values to MOdbus TCP Slave

Post by h2oil »

To run this script on startup, does it have any required packages to install first?

Also what are the output tags for the Modbus Slave TCP - I cant find them in the documentation either.

Thank you :)
User avatar
dirk
KUNBUS
Posts: 1942
Joined: 15 Dec 2016, 13:19
Answers: 4

Re: AIO Values to MOdbus TCP Slave

Post by dirk »

Have a look at your PiCtory variable names here. For autostart there are many options available. The quick and dirty solution is to execute your script in "/etc/rc.local". Have a look at the Tutorial 10 – Python headless.
Post Reply