Example Code for Modbus Assistant-RS485 Relay Control

Last revision 2025/12/26

The article offers step-by-step guidance and example code for utilizing Modbus Assistant to control RS485 relays, detailing hardware and software preparations, wiring connections, and Modbus protocol instructions for effective relay module management.

Hardware Preparation

Software Preparation

Note: the driver needs to be installed when using on Windows for the first time. There is no need to install driver in Linux system.

Wiring Diagram

  1. Plug the shield into LattePanda Alpha & Delta:

Connection graph

You need to use nylon columns and nylon screws to fix the expansion board and LattePanda.

Connection2

Use ModBus debugging assistant

  1. Repeat the above steps
  2. According to the ModBus protocol rules of the 8-channel network control relay module, use the ModBus debugging assistant to send the correct instructions, then control the relay module.
  3. Get the equipment name and control the switch of relay.

Was this article helpful?

TOP