logo
You are in: TCP Modbus Master Protocol Configuration Section  Home   Products & Services   Links   Contacts   Legal   What's new? 


Modbus Master Protocol Configuration Section



modbus_bg_transparent-300x96.png

This information applies to latest revision.

This driver is made by the two modules: modbus_driver.dll and modbus_master.exe
This driver maps modbus data formats to IEC data types using the following mapping:

Register typeFunctionModbus_typeiec_typeoffset
Holding Register, Analog Output, Read 3VT_I4M_IT_TB_140001
Holding Register, Analog Output, Read 3VT_UI4M_ME_TO_140001
Holding Register, Analog Output, Read 3VT_R4M_ME_TF_140001
Holding Register, Analog Output, Read 3VT_R4SWAPM_ME_TF_140001
Holding Register, Analog Output, Read 3VT_I2M_ME_TE_140001
Holding Register, Analog Output, Read 3VT_UI2M_ME_TQ_140001
Holding Register, Analog Output, Write 16VT_I4C_BO_TA_140001
Holding Register, Analog Output, Write 16VT_R4C_SE_TC_140001
Holding Register, Analog Output, Write 16VT_R4SWAPC_SE_TC_140001
Holding Register, Analog Output, Write 16VT_I2C_SE_TB_140001
Input Register, Analog Input, Read Only 4VT_I4M_IT_TB_130001
Input Register, Analog Input, Read Only 4VT_UI4M_ME_TO_130001
Input Register, Analog Input, Read Only 4VT_R4M_ME_TF_130001
Input Register, Analog Input, Read Only 4VT_R4SWAPM_ME_TF_130001
Input Register, Analog Input, Read Only 4VT_I2M_ME_TE_130001
Input Register, Analog Input, Read Only 4VT_UI2M_ME_TQ_130001
Coil, Digital Output, Read 1VT_BOOLM_SP_TB_100001
Coil, Digital Output, Write 5VT_BOOLC_SC_TA_100001
Input Status or Driscrete Input, Digital Input, Read Only 2VT_BOOLM_SP_TB_110001


where

VT_I4 is a 32 bits signed integer
VT_UI4 is a 32 bits unsigned integer
VT_R4 is 32 bits float
VT_R4SWAP is 32 bits float with words swapped
VT_I2 is a 16 bits signed integer
VT_UI2 is a 16 bits unsigned integer
VT_BOOL is a bit

Step 1:


Creation of modbus protocol configuration database

Go to C:\scada\bin and run protocol_configurator.exe

For each device create a modbus database and a SCADA Unit.
A SCADA Unit corresponds to a SCADA line.

Example: For the device connected on line 1 create the database named modbus_database1.db and save it in C:\scada\project

For the device connected on line 2 create the database named modbus_database2.db and so on

Line 1 corresponds with the first Unit created, line 2 with the second Unit created and so on

mdb_database01.png
Create modbus_database1.db
mdb_database02.png
Select the import table menu. Import modbus_table.csv
mdb_database03.png
Imported modbus_table.csv

Step 2:


Creation of the new SCADA points

1 - Select the menu: Configure\Configure Units

2 - Press button New

3 - Fill in the edit field Name: MDB

4 - Select Type modbus_driver, flag Unit Enabled and press Configure button

5 - Fill in the Modbus slave IP address, TCP port, number of points and Update Intervall in milliseconds for MODBUS TCP.

6 - Fill in the serial device, baud, data bits, stop bit, parity, number of points and Update Intervall in milliseconds for MODBUS RTU.

7 - Press button Apply and wait that the Apply button returns active and then press Exit

8 - Restart monitor.exe

9 - Monitored sample points are now visible

ConfigureUnits-rev167.png
1
Immagine03.png
2
Immagine04.png
3
Immagine05.png
4
Immagine06.png
5
Immagine06a.png
6
Immagine05.png
7
RestartMonitor_rev167.png
8
Immagine50.png
9

Step 3:


Configure each sample point

8 - Select the menu: Configure\Configure Sample Points

9 - Set Comment, Type, Units and the limits of each new point. Press button Apply

- Set type M_SP_TB_1 for digital point

- Set type M_ME_TC_1 for analog point

10 - Open HMI designer, select the widget and edit the maxValue and min Value

11 - The corresponding HMI object, here MDBPoint11, get the new maxValue and min Value.
ConfigureSamplePoints_rev167.png
8
Immagine09.png
9
Immagine09b.png
10
Immagine09c.png
11

Step 4:


HMI configuration with HMI designer

10 - Run the process C:\scada\bin\hmi_designer.exe

11 - Open the XML designer file in C:\scada\project\hmi0.ui

11.1 - Or create from scratch your HMI (dialog) and save it as hmi0.ui in C:\scada\project

11.2 - It is possible to create from scratch your HMI (dialog) and save it as hmi1.ui or hmi2.ui upto hmi9.ui in C:\scada\project

12 - Use the following widget classes

Widget Class
SINGLE POINT LED PSinglePointLed
DOUBLE POINT LED PDoublePointLed
SINGLE POINT LED SinglePointLed
DOUBLE POINT LED DoublePointLed
SWITCH PSwitch
THERMOMETER QwtThermo
LCD NUMBER PLCDNumber
COMMAND BUTTON QPushButton
TANK PTank
THERMOMETER PThermometer
EDIT FIELD QLineEdit
BREAKER Breaker



13 - Widget names MUST contain the underscore _ as separator between sample point SCADA name and widget ID

For example the widget with SCADA name MDBSample09 and ID 1 has full name: MDBSample09_1

Please see next image 1

widget_names_mandatory_underscore.png
1
14 - To enable the inspect popup window, please follow the procedure:

You have to connect the signals RightClicked(QString&,QString&) of the widgets with the slot RightClicked(QString&,QString&) of the HMI dialog (here Form1)
Signal-Slot-Popup-0001.png
Step 1
Signal-Slot-Popup-0002.png
Step 2
Signal-Slot-Popup-0003.png
Step 3
Signal-Slot-Popup-0004.png
Step 4
Signal-Slot-Popup-0005.png
Step 5
Signal-Slot-Popup-0006.png
Step 6
Signal-Slot-Popup-0007.png
Step 7
Signal-Slot-Popup-0008.png
Step 8
Signal-Slot-Popup-0009.png
Step 9
signals-slots-connections.png
Final result
Signal-Slot-Popup-0010.png
Working popup on HMI


15 - To enable commands, please follow the procedure:

Signal-Slot-01.png
Step 1
Signal-Slot-02.png
Step 2
Signal-Slot-03.png
Step 3
Signal-Slot-04.png
Step 4
Signal-Slot-05.png
Step 5
Signal-Slot-06.png
Step 6
Signal-Slot-07.png
Step 7
Signal-Slot-08.png
Step 8
Signal-Slot-09.png
Step 9


Swap of word in float number

Test with float NOT swapped

slave_id = 1
modbus_function_read = 3
modbus_function_write = 16
modbus_address = 0
modbus_type = VT_R4
ioa_control_center = 10
deadband = 0

[00][01][00][00][00][06][01][03][00][00][00][02]
Waiting for a confirmation...
<00><01><00><00><00><07><01><03><04><41>
modbus_read_registers: Get float: -1868585380923580700000000000000000.000000


The next test is with SWAP of float WORD

slave_id = 1
modbus_function_read = 3
modbus_function_write = 16
modbus_address = 0
modbus_type = VT_R4SWAP
ioa_control_center = 10
deadband = 0

[00][01][00][00][00][06][01][03][00][00][00][02]
Waiting for a confirmation...
<00><01><00><00><00><07><01><03><04><41>
modbus_read_registers: Get float: 23.370468

- FloatConverter IEEE754




© 2002-2024 Enscada  

Locations of visitors to this page