![]() |
GaIA BIOS Library
|
This example runs a Modbus RTU slave on serial port 0.
mb_user_callbacks.c implements access functions for:
Serial configuration is 9600 baud, 8 data bits, odd parity, 1 stop bit.
The gwa_examples/common/tools directory contains Modbus Poll configuration files to easily communicate with the device.
Input register 0 contains digital inputs in the low byte and DIP switch values in the high byte.
| Register | high byte | low byte |
|---|---|---|
| Reg 0 | DIP switches | digital inputs |
| Register | high byte | low byte |
|---|---|---|
| Reg 0 | reserved | digital outputs |
| Reg 1 | reserved | char[0] |
| Reg 2 | reserved | char[1] |
| Reg 3 | reserved | 4 reserved bits + LEDs |