RuggedBOARD DevWiki
  • RuggedBOARDs Developer Wiki
  • RB-A5D2x
    • Contents
    • Download BSP and Documents
  • G1: Getting Started
    • RB-Quick Start Guide
    • Test all the RB interfaces in 10 mins in command Line
    • Example Program for Interfaces Using Python 3
  • G2: Programming Guide
    • Software Architecture on RB (Software Stack Diagram)
    • RB Interface/Bus Programming using MRAA
    • RB Peripherals programming using UPM
  • G3: How to Do?
    • Modbus on RB
    • RB as Tiny Web Server
    • MQTT Client on RB
    • SQL Lite DB
    • AWS Green Grass on RB
    • Microsoft Azure on RB
  • G4: Use Cases / Application Notes
    • Smart Energy Meter with AWS cloud
    • IoT Based solution for Plants Water monitoring
    • Weather Monitoring Stations
    • FAQ
  • G5: System development Guide
    • Advance Host setup
    • Flash a Bootable SD Card for Rugged board
    • Flash a NOR with Bootable SD Card For Rugged Board A5d2x
    • Flash the NOR using tftp For Rugged Board A5d2x
    • Yocto Compilation For Rugged Board A5d2x
    • Download the Toolchain for Rugged Board A5d2x
    • How to Add New Package in Yocto(root file system)
    • Generate the SDK(toolchain) using YOCTO
    • How to compile the U-Boot for Rugged Board A5d2x
    • How to compile the kernel for Rugged Board A5d2x
  • RB-i.MX6UL
    • Contents
    • Download BSP and Documents
  • G1: Getting Started
    • RB-Quick Start Guide
    • Test all the RB interfaces in 10 mins in command Line
    • Example Program for Interfaces Using Python 3
  • G2: Programming Guide
    • Software Architecture on RB (Software Stack Diagram)
    • RB Interface/Bus Programming using MRAA
    • RB Peripherals programming using UPM
  • G3: How to Do?
    • Modbus on RB
    • MQTT Client on RB
  • G4: System development Guide
    • Advance Host setup
    • Flash a Bootable SD Card for Rugged board
    • Flash a NAND with Bootable SD Card For Rugged Board i.MX6UL
    • Flash the NAND using tftp For Rugged Board i.MX6UL
    • Yocto Compilation For Rugged Board i.MX6UL
    • Download the Toolchain for Rugged Board i.MX6UL
    • How to Add New Package in Yocto(root file system)
    • Generate the SDK(toolchain) using YOCTO
    • How to compile the Barebox for Rugged Board i.MX6UL
    • How to compile the kernel for Rugged Board i.MX6UL
  • G5 : Help Desk
    • FAQ
Powered by GitBook
On this page

Was this helpful?

  1. G3: How to Do?

Modbus on RB

PreviousRB Peripherals programming using UPMNextRB as Tiny Web Server

Last updated 11 months ago

Was this helpful?

Stage 1 : Testing ModBus Communication (RS485) using modpoll

Step 1: Connect the A & B of energy meter to A & B pin in RuggedBoard RS485 port respectively.

For demonstration purpose I have used Elmeasure LG+ 1119 meter. If you are having any other meter then you have to read the datasheet of the meter vendor and provide proper parameters.

Step 2: Download the modpoll ARM execulatble binary and save it into your work directory. To download the file click below.

Step 3: Save the following code in .sh format on your working directory and name is as mbpoll.sh

./modpoll.bin -m rtu -a 1 -t 4:float -r 159 -b 9600 -s 1 -P none /dev/ttyS2

The above script has the following components:

  • m : communication mode

  • a : Slave address

  • t : data types of the slave holding register

  • r : Start Reference

  • b : Baud Rate

  • s : Stop Bits

  • p : Parity Bit

  • SERIALPORT : Serial port node of the RS485

Step 4: Run the above code to test ModBus communication

sh mbpoll.sh

If everything is correct your code will run without any error. and you can proceed to next stage.

644KB
modpoll.bin
modpoll.bin