How can I execute program on Mervis
I want to run my python program and receive results. How can I do this on Mervis?
short answer is you can't.
Slightly longer answer is you can, but I don't recommend it.
The Mervis is sort of world of its own and it's not easy to make it communicate with anything over other than supported protocols. If we need to use external scripts in our projects, we use simple python script which acts as a ModbusTCP slave running inside the PLC on 127.0.0.1:503. You can add this device in the Mervis and communicate with it via registers and coils. It works, but it requires some deal of work.
@martin-kudláček Thank you for the information. It sounds tough to implement. I finally figured out that if I keep running my application on PLC to collect data and passing result into variables that PLC can touch, it will work equivalent to my question above. Can I do this on Mervis ?
then I suggest you to take a look at PyModbus, especially the client example: https://pymodbus.readthedocs.io/en/latest/readme.html#example-code
On the side of the Mervis, you need to create Modbus Server, see: https://kb.unipi.technology/en:sw:01-mervis:setting-modbus-server-hidden
In the Mervis Modbus Server, you will define registers and coils pointing to some Mervis variables. In the Python script, you will write value to these registers/coils.
PyModbus worked great to me and I understand how to map variables on Mervis to be placed as modbus tcp touchable.
I Still have curious question. I configured 503 port as modbus server, because 502 is already used as another modbus. What is this modbus used for ?