Industrial HMI and Arduinos in MODBUS RTU

by manu4371 in Circuits > Arduino

3437 Views, 2 Favorites, 0 Comments

Industrial HMI and Arduinos in MODBUS RTU

the real network.jpg

In this instructable I will describe an example of communication between an industrial HMI (COOLMAY MT6070H, 150EUROS), an Arduino CLONE DIY (10EUROS) and an Arduino UNO (10EUROS). The network will run under a special and robust and industrial protocol: the MODBUS RTU (no IP or ethernet requested). More informations about this network, here:

https://en.wikipedia.org/wiki/Modbus

I made 2 experiments to explore the skills and the power of this kind of network:

-in the first one: the HMI is the Master, CLONE is Slave1 and UNO is Slave3 (you give the ID you want)

-in the second one: the HMI is the Slave1, CLONE is the Master (with an automation embeded program), UNO remains the Slave3.

Very Easy to Connect

the real net.jpg
the links.jpg
the hmi conec.jpg

What is needed:

-an industrial HMI COOLMAY MT6070H with a modbus connector

-a DIY ARDUINO CLONE

-an UNO

-2 MAX485 shields

-a power supply 24V DC

-2 USB programing cables and an USBasp.

Be carefull to connect together every pinA+ and pinB- and have the same GND for all the devices.

The First Experiment: HMI As Master and Arduinos As Slaves

First of all, you need to add some usefull libraries and board to yourArduino IDE:

-hardware: minicore for CLONE board

-SM: state machine library

-SimpleModbus: modbus RTU library in slave or mater mode.

I give too the sketch of the HMI and both arduinos with a tutorial and a french guide on modbus rtu.

The Second Experiment: HMI As Slave, CLONE As Master and UNO As Slave

Why this experiment? Because It 's impossible to embed an automation program in this kind of HMI: you can't do this because it does not respect the safety and security rules on systems and machines.

The HMI soft is available here:

http://www.coolmay.com/Download-159-36-41.html

Like the Arduino IDE with the special library inside, you change easyly your device in a Slave or in a Master.

The speed of the communication seems to slower here. So I add some things to earn more speed reaction:

-serial communication in 8O1 instead of 8E1

-state machine for a real time running

-add some additional components in the network:

-120 OHM resistor between A and B

-560 OHM resistor between A and GND

-560 OHM resistor between B and GND

Conclusion

Owing to this experiments I will soon try to supervise a 6 axes robot with arduinos as slaves and a PLC (M221 schneider) as a master to control movements sequences.

Others projects will also come soon like a network made with an HMI, a softster (ATS22 schneider) and a Arduin clone.

Thanks to all interesting tutorial and guides and website allover the net. Happy instructables!!!