Implementation of Modbus Protocol Modbus Read on Arduino Uno As Slave

by rupjit81 in Circuits > Arduino

412 Views, 0 Favorites, 0 Comments

Implementation of Modbus Protocol Modbus Read on Arduino Uno As Slave

20230723_125159.jpg

In this design I'm going to implement Modbus protocol on Arduino Uno. In this part I'm implementing Modbus read protocol. Arduino Uno is used as slave in this design.

Supplies

Bill of materials

  1. Arduino Uno board
  2. LEDs
  3. 1K resistor
  4. USB interfacing cable.
  5. Modbus testing software - ModbusPollSetup64Bit Download (modbustools.com)


Modbus read using Arduino Uno as slave.
Arduino Uno modbus read operation, Arduino as slave and PC software as modbus master
20230723_125159.jpg
20230723_125218.jpg
20230723_125331.jpg
20230723_125354.jpg
20230723_120402.jpg

In this design we are using Arduino Uno as slave. The protocol is implemented in Arduino Uno. PC has software installed as Modbus master. The Modbus ASCII protocol is used.The Modbus master will send a data frame to the Arduino slave.

An example Modbus ASCII data frame is shown below

:060100000006E3CRLF

':' Start of frame

'06' Address of slave (Arduino Uno)

'01' Read coil / Read input

'00' Address Hi

'00' Address Lo

'00' Quantity of coils high

'06' Quantity of coils low

'F3' LRC Longitudinal Redundancy Check

Formula = ((FF- (06 + 01 + 00 + 00 + 00 + 06))+1) = F3

Note: All additions done in hexadecimal.

Arduino Uno Port 2 to Port 7 data is analyzed and put in response data string.

The Software is attached.

This is a tested design.