modbusTCP

Hello
I want to connect raspberry pi (3B+) with arduino (Mega + ethernet shield) using ArduinoModbus library on arduino and Codesys on Raspberry Pi. The point is to make the arduino (slave) as I/O device while Raspberry (master) is a PLC (I know that in modbusTCP is client server, but configuration of modbusTCP is as master slave). I have a problem that i cannot connect to raspberry (program in attachment). I have noticed that something happens on codesys side (I will also post this problem on codesys forum) as you can see on pic_1 and then come back to proper config (pic_2). I can ping arduino from raspberry All posts i have seen were about stuff after connecting to modbus master (on codesys forum no responses to posts so i hope that this post will be seen by somebody who is also familiar with PLC programming). On youtube i can see few projects about my topic, but arduino program is not attached or link is not valid anymore. According to used library yet, cause i have seen posts about this, after compilation there is left over 6000B of RAM for local variables isn't really sufficent for this purpose?

I hope that you will help me with this so I can share the solution somehow more permamently.

ModBusTry_V2.ino (3.02 KB)

I have tried other library but also is not working, however in codesys i can see sometimes one shots that slave is working properly

ModBusTry_V3.ino (2.82 KB)

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.