Arduino Slave Modbus RTU & PLC Panasonic RS232
In this new test we will use an Arduino Mega 2560 board and a Panasonic FPX PLC, in this case we will configure the PLC as a Modbus RTU master and the Arduino as a Modbus RTU slave via RS232. We will use as a base previous examples of both platforms.
Since arduino handles TTL voltages 0 -5v we have manufactured a MAX232 TTL to RS232 converter, quick view of MAX232 DIY board, We have taken 5v to power the MAX232, although we recommend using an external 5v source and unify ground.
References
Tests
In previous tutorials we performed a similar test Arduino Maestro Modbus RTU & PLC Panasonic RS232 we will perform the same test changing the case PLC Maestro – Arduino Slave.
The Arduino board will read 2 PLC potentiometers and the activation of a light pilot.
The test will use 3 modbus communication registers between Arduino and PLC configured as follows:
- An pushbutton NO connected to the Arduino digital input assigned to the Holding Register [4] activates the output to Relay Y0 which has a light pilot connected.
- Potentiometers V0 of PLC assigned to Holding Register [0], to be displayed on the Arduino serial terminal.
- Potentiometers V1 of PLC assigned to Holding Register [2], to be displayed on the Arduino serial terminal.
Arduino Mega 2560 Slave Modbus RTU & PLC Panasonic Master (RS232)
Connections
Arduino Mega 2560 R3 – Serial1 Ports
Cassete COM4 – COM2 Port Serial RS232
Conclusions
- Although for some this test is similar to previous tests, visual and functionally does not vary, but internally the library and / or the configuration as master or slave are different would be denoted by revolving the Master and Slave Modbus libraries for Arduino.
- The board of Arduino controls without any inconvenience the PLC, you only have to consider communication parameters, speeds physical connections, wiring, etc.
- Easily this application, in this case a PLC in more practical cases data solutions or control with meters, counters and PID controllers.
- We recommend not to use speeds higher than 9600, if it works at 115200 but we want to guarantee security in the transmission given the Arduino and max232.
References
Donwloads
- Strategy FPWIN-Pro PLC Panasonic Master Modbus
- Arduino Slave Modbus RTU Library
- Arduino Slave Modbus RTU Example