2.1 Adding the MbDrv driver
The project main file with the MbDrv driver included is shown in Figure 2.1. The Modbus Master of the TCP/IP version is shown.
There are 2 blocks which must be added to the project to include the driver. First the MODULE block is attached the the Modules output of the EXEC function block. It must be renamed to MbDrv.
The other block of type IODRV is named MTM and it is connected to the Drivers output of the main EXEC block. The three most important parameters are:
- module
- – name of the module linked to the driver, in this case MbDrv – the name is CASE SENSITIVE!
- classname
- – class of the driver, which defines the role of the target device and the Modbus
version to use:
- MbmDrv – for Modbus RTU Master
- MbsDrv – for Modbus RTUSlave
- MtmDrv – for Modbus TCP/IP Master
- MtsDrv – for Modbus TCP/IP Slave
The name is CASE SENSITIVE!
- cfgname
- – name of the driver configuration file (*.rio, REX Input/Output file), which is discussed in chapter 3
The name of this block (MTM, see Fig. 2.1), is the prefix of all input and output signals provided by this driver for Modbus TCP/IP Master. Similarly, the IODRV block can be named MTS, MBM and MBS for TCP/IP Slave, RTU Master and RTU Slave.
The above mentioned parameters of the IODRV function block are configured in the RexDraw program. The configuration dialog is shown also in Fig. 2.1.
The Configure button opens the configuration dialog of the MbDrv driver, which is described in chapter 3.
[Back to top] [Up] [Next]