Modbus TCP can be programmed in M-Duino PLCs.
Once the Arduino IDE is configured according to Industrial Shields requirements
http://blog.industrialshields.com/es/ethernet-shield-libraries/, the follwoing library can be used to program the M-Duino as Modbus TCP slave.
Basically, this example links holding registers 40000, 40001 and 40002 to outputs Q0.1, Q0.2 and Q0.3 of the M-Duino. In this way these 3 outputs can be operated via a Modbus TCP master. You will have to modify the IP address and network parameters according to your LAN.
An illustrative and simple example to test the application is with the following android free app. https://play.google.com/store/apps/details?id=com.bencatlin.modbusdroid&hl=es
Which will allow you to operate the M-Duino outputs via your smartphone. You only need to set the IP address of the slave and you can begin controlling the M-Duino remotely.
Now you can simply remotely control your M-Duino.
In this Project, we will show you how to read electrical consumption using Modbus communication. Modbus is an industry standard communications protocol for electronic device Hardware I: Equipment to be used The electrical consumption monitoring system consists of:
- An M-Duino PLC: This controller is the heart of the system. It controls the display, generates interrupts, and controls the communication.
- A Panel PC: Used to read on the status of a counter and display the graph of monthly consumption over the Panel Pc. – Switch: Switch will work as the interface between slaves and Master in our control network.
- A Power Meter witch Modbus TCP/IP communication capabilities (as TCP is Transmission Control Protocol and IP is Internet Protocol.)
- Wires and some programming experience J.
Hardware II: Communication The nice feature of Panel PC we used is that it has many interfaces such as Ethernet, USB and I²C as well. We´ve expressly chosen Ethernet because our PLC and our I2C panel have this Ethernet connecitivity. See the following picture to understand it: Software and code Arduino sketch essentially uses the Modbus TCP library for Arduino (see the Arduino installer tutorial here). Some important things to take care when we use this library:
- Insert the modbus_update function in the loop, because. takes care of the received modbus commands and will modify the registers accordingly in case of writing or reading requests.
- Declare an integer array (named holdingRegs) that stores the modbus registers.
- We recommend to review modbus tcp basics at http://www.simplymodbus.ca/
After that, just start sending values to the panel PC through USB I2C communication. You can find the code to be uploaded to the PLC here: You need to download libraries:
And what about the software to install in our Panel PC to start visualizing graphs? In this case, we recommend to use Tesla Scada, wich is able to work on Android systems . The panel pc will start receiving data and print out data in graphs! Key Benefits The main benefits of the Opiron purposed solution are:
- Time Saving: Forget to go to view and write values in notebooks, your control system will do this job for you.
- Real time measurement: System provides reliable data quickly.
- Digital data analysis: If you can measure it, you can improve it!
Do you have a process to be automated? Contact Opiron to implement the entire solution and Industrialshields to buy the proper hardware.
Arduino based PLC through RS485 port can connect with other devices which also use RS485 communication port
PLC available to use RS485:
20 I/Os PLC:
- Ardbox Analog
- Ardbox Relay
- M-duino 21
- M-duino 42
- M-duino 58
- M-duino 19R
- M-duino 38R
- M-duino 57R
Read More Read More