Operation via the Modbus RTU Protocol

<< Click to Display Table of Contents >>

Navigation:  Modbus Universal MasterOPC Server > Description of the Mod_RSSim Simulator > Use of the Simulator together with Modbus Universal MasterOPC >

Operation via the Modbus RTU Protocol

Using the ModRSSim simulator, you could check and debug configurations of Modbus Universal MasterOPC without real devices. To debug devices via the Modbus RTU protocol, COM0COM is required  to be installed previously (see Installation of com0com), and a virtual pair of COM ports is required to be created and configured as well (see com0com Configurator).

Assume that you create ports 13 and 14 in the COM0COM configurator.

rabota_po_protokolu_modbus_rtu

Modbus Universal MasterOPC needs to be connected to one COM port of the pair, and ModRSSim, to another COM port of the pair, In this case, applications can exchange with data.

Using the shortcut, launch ModRSSim.

rabota_po_protokolu_modbus_rtu1

Automatic switching to the first COM port in the system takes place. If that port does not correspond to a port from the virtual pair, change it, pressing the button.  

rabota_po_protokolu_modbus_rtu2

In the window displayed next, select the required COM port. If required, you can change port parameters (rate, parity, etc), see RS-232 Configuration for details.  

rabota_po_protokolu_modbus_rtu3

Parameters are displayed in the window title.

rabota_po_protokolu_modbus_rtu4

Now let's configure the OPC server,

Add the communication node:

rabota_po_protokolu_modbus_rtu5

Set in the settings the follows: a node type - COM, a port - the second COM port of the virtual pair (14 in our case), connection parameters - similar to parameters that are set in ModRSSim.

rabota_po_protokolu_modbus_rtu6

Add the device to the node created.

rabota_po_protokolu_modbus_rtu7

ModRSSim emulates all of Modbus addresses, therefore set any address - for instance, remain 1.  

rabota_po_protokolu_modbus_rtu8

Now you can add tags to the device.

rabota_po_protokolu_modbus_rtu9

It is possible to remain all default parameters - address 0 of the Holding Registers region will be polled.

rabota_po_protokolu_modbus_rtu10

Now it is possible to switch the OPC server to the run-time mode (press the Start button).

rabota_po_protokolu_modbus_rtu11

Poll of the simulator register starts.

rabota_po_protokolu_modbus_rtu12

If a value in the register 0 of the Holding Registers region in ModRSSim changes, the OPC server displays this. To change a value of a register in ModRSSim, double click a value.

rabota_po_protokolu_modbus_rtu13

See also Operation via the Modbus TCP Protocol