Modbus RTU

Function Subset 

Implementation

in 

Cypress PSoC5

Date : August 26, 2021

Hey, this is Shaunak !

In this blog, I will demonstrate and explain the Modbus RTU Function Subset Implementation in Cypress PSoC5. I have used the 

CY8CKIT-059 PSoC® 5LP Prototyping Kit With Onboard Programmer and Debugger for the project.

Modbus is a data communication protocol widely used in industries. Click/Tap here to know more about it.

For this project, as a reference, I have referred the following document in order to understand its working :

PI_MBUS_300.pdf

The project implements 8 Modbus RTU Functions with a dedicated  C library that can be used in general. The 8 Modbus Functions are as below :

1. 0x01 : Read Coils

2. 0x02 : Read Discrete Inputs

3. 0x03 : Read Holding Registers

4. 0x04 : Read Input Registers

5. 0x05 : Write Single Coil

6. 0x06 : Write Single Register

7. 0x0F : Write Multiple Coils

8. 0x10 : Write Multiple Registers

The working of all the functions has been tested on a Modbus Master Tool called qModbus.

Download qModbus from Here

Code Philosophy

Click/Tap Here to download the entire PSoC5 project.

Here is video explaining how the system works :