Modbus RTU Master Library tests with Arduino Part 1

I start with the following question Arduino can be used in industrial aplicaiones? of course, using a common protocol used in the industry called Modbus Serial RTU in this case configured as Master.
MODBUS communication is done by sending the value of A0 (ADC0) 10 modbus records using a potentiometer 100k variation is performed.

 


Modbus RTU Frame

 


Table  functions Modbus RTU

 

 

For a long time I searched libraries implementing modbus and have used an excellent library
created by .
Materials.
1 Arduino
1 Potenciometro 100K
1 Display Oled 128×64

 It has been used oled screen Arduino communicate via I2C for validating records both read and written between Arduino and the slave simulator
10 Reading and Writing Holding Registers Holding Registers 10 is carried out, the settlement is set au16data [32] with a capacity of 32 storage registers, records of reading and writing.

Addressing Records

Read 10 Registers 0  – 9     Funcion   3 Read multiple Registers

Holding [0] ….  au16data[0]

Holding [1] ….  au16data[2]

…………………………..

Holding [8] ….  au16data[8]

Holding [9] ….  au16data[9]

 
Write 10 Registers 10  a 19    Funcion   16 Write multiple Registers

Holding [10] ….  au16data[10] 

Holding [11] ….  au16data[12]

……………………………………….

Holding [18] ….  au16data[18]

Holding [19] ….  au16data[19]

Connection PyModSlaveQt simulator.

 

Reading Record

Holding Registers from Simulator

Holding Registers from Arduino

Writing Records

Holding Registers from Simulator


Holding Registers from Arduino



Realized tests
Downloads GitHub : Arduino source code Instructables : Arduino modbus RTU Master Channel Youtube:  JhonValenciaPDAcontrol

You may also like...

1 Response

  1. November 19, 2016

    […] GTWIN Panasonic  The Panasonic GT01 screen is programmed into the software GTWIN records are redirected follows: GDT0 = Holding Register [0] GDT1 = Holding Register [1] 1. Communication parameters Screen 2. Modbus RTU Slave 3. Design Screens Arduino code Arduino is configured for reading and writing 10 log 10 records. Blog  http://pdacontrolen.com/pruebas-libreria-modbus-rtu-maestro-con/ […]

Leave a Reply