GaIA BIOS Library
Loading...
Searching...
No Matches
Modbus RTU 2-channel Master-Slave

Overview

This example runs a Modbus RTU master on serial port 1 and a Modbus RTU slave on serial port 0.

behavior

  • The master reads input registers 0-1 from slave 1 and writes DIP switch values to its own outputs.
  • Board 0 DIP switches are reflected on board 1 outputs.
  • Board 1 DIP switches are reflected on board 0 outputs.

Setup

Program two boards with the same firmware and connect them using serial cables as follows:

  • board 0 port0 -> board 1 port1
  • board 1 port0 -> board 0 port1

Serial configuration is 9600 baud, 8 data bits, odd parity, 1 stop bit.