Modbus Client Demo

Overview

RAPIDSEA supports Modbus protocol as explained in the Modbus protocol page. This stack will be used by the customer according to their custom logic. This stack contains serial configuration and IP configuration.

The below diagram captures the high level flow of Modbus Client

Modbus Sequence Diagram

Read Coil Status (0x01) request

  • This command is used to read the values of the DO digital outputs from the starting address that are given by the user

  • The values in the register should be single bit 0s and 1s (on and off)

Read Input Status (0x02) request

  • This command is used to read the values of digital inputs DI from the starting address that are given by the user .

  • The values in the register should be single bit 0s and 1s (on and off)

Read Holding Register (0x03) request

  • This command is used to read the values of analog output AO from the starting address that are given by the user

  • The values in the register should be 16bit.

Read Input Register (0x04) request

  • This command is used to read the values of analog input AI from the starting address that are given by the user

  • The values in the register should be 16bit.

Write Single Coil (0x05) request

  • This command is used to write one value of the digital output from the starting address of the coil register

  • The values to be written are single bit 0s and 1s.

Write Single Holding (0x06) request

  • This command is used to write one value of the analog output from the starting address of the holding register.

  • The values to be written are 16 bits.

Write Multiple Coils (0x0F) request

  • This command is used to write multiple value of the digital output from the starting address of the coil register

  • The values to be written are single bit 0s and 1s.

Write Multiple Holding (0x10) request

  • This command is used to write multiple value of the analog output from the starting address of the holding register.

  • The values to be written are 16 bits.

Modbus Running Example

Refer to the Supported Platforms page to setup your environmental setup and follow further.

User Configuration of client in RTU

Modbus Client Configuration (RTU)

Serial Configuration

Values

COM PORT (windows) USB PORT(Linux)

COM1 , COM5 …(windows) /dev/ttyUSB1 (Linux)

BAUDRATE

9600 , 115200, ….

User Configuration of client in TCP

Modbus Client Configuration (TCP)

socket Configuration

Values

IP (windows /Linux)

192.168.29.39 ,…

Port

10,502, ….

Modbus Configuration
  • Once run the execution command the (./rs_modbus_app.exe) client connecting to Modbus server via Serial or TCP

  • Note : Before run the client we need to run the Modbus server.

  • The modbus menu look like that..

Modbus Menu