0121-10 Monarco HAT Modbus RTU ADAM-4024
Example Projects > 0121 Monarco HAT > 0121-10 Monarco HAT Modbus RTU ADAM-4024
Monarco HAT - Modbus RTU example (via serial line)
This folder contains the source files for the demonstration project on data exchange between two devices over the Modbus RTU protocol using Monarco HAT.
The example is meant to communicate with Advantech ADAM 4024 4-channel Analog Output Module, which serves as a slave station. Therefore the master station is implemented in REXYGEN. For testing purposes there is also Advantech ADAM 4024 simulator available in a separate folder.
- REXYGEN Runtime Core, MbDrv and MonarcoDrv modules must be installed and running on the device(s) to run the example(s).
- Advantech ADAM 4024 configuration using Advantech ADAM 4000 5000 Utility. Make sure to set the module communication to Modbus RTU with following parameters: Baudrate: 9600; Parity: none; Data bits: 8; Stop bits: 1.
- The example presumes that the Analog Outputs are configured as Current Outputs with range 0~20 mA.
- Doublecheck the module wiring!
Running the examples
- The *exec.mdl file is the project main file.
- Open it with REXYGEN Studio, compile and download it to the target device.
- For Modbus Mapping table see Advantech ADAM 4000 Series User Manual (see the link below)
Adding signals and changing Modbus register mapping
Go to Modbus driver configuration (MBM block in the master, MBS block in the slave) and press "Configure" for Modbus registers configuration. Make sure to read the Modbus driver documentation (see below).
Changing Modbus RTU settings
Go to Monarco driver configuration (MNR block in project main file) and press "Configure" to Modbus RTU configuration. Make sure to read the Monarco HAT driver documentation (see below).
- Press F1 for help on the selected function block in the REXYGEN Studio.
- Getting started with REXYGEN and Monarco HAT
- MonarcoDrv - Monarco HAT driver
- MbDrv - Modbus driver
- Advantech ADAM 4000 Series User Manual
- Function blocks of REXYGEN
- REXYGEN Studio User Guide
- Complete documentation of REXYGEN
- Visit the Monarco HAT website
- Visit the REXYGEN webpage for more information about the example projects and developing advanced automation and control solutions using REXYGEN.