Navigation:  Equipments (Devices) > PLC200 > Network Protocols >

Modbus RTU

Previous pageReturn to chapter overviewNext page

This guide will help you set up the device as a Modbus RTU Client to connect with one or more Modbus RTU Servers.

 

IMPORTANT!

Before using this service please be aware of the Important notice about cybersecurity and communications.

 

The Modbus RTU client is configured through a configurator.

 

wpshelp_common_fig_note

NOTE!

For detailed information about how the client reads and writes data using Modbus RTU, see the specific device manual for Modbus RTU communication.

 

1)  Expand the Communications directory.

 

mb_rtu_example_01

 

2) Right-click in Modbus RTU and click to create a new file.

 

mb_rtu_example_02

 

3) Enter a name to the new Modbus RTU configuration and click on Finish.

 

mb_rtu_example_03

 

4)  Double-click on the new Modbus RTU configuration file to open the configurator tab.

 

mb_rtu_example_04

 

5) Right-click on the main network node PLC and click on the Add Device option.

 

mb_rtu_example_05

 

6) On the Add Device panel set up the device information:

 

Name: Enter a name for the device, this name must be unique for any Modbus configurations.
Address: Address: The Modbus RTU device address, ranges from 1 to 255.
Response Timeout: The timeout to connect to the device.

 

mb_rtu_example_06

 

7) After setting up a device, right-click on it to add requests.

 

mb_rtu_example_07

 

8) On Add Request panel set up the request informations:

 

Name: A name for request, this name must be unique for any Modbus configurations.
Function:

           1: Read Coils

           2: Read Discrete Inputs

           3: Read Holding Registers

          4: Read Input Registers

          5: Write Single Coil

          6: Write Single Register

          15: Write Multiple Coils

          16: Write Multiple Registers

Initial Data Address: The address or number of register or coil, depends of the Addressing Mode set up.
Length: Number of registers or coils to be read or written.
Addressing Mode:

          0: Register address - Define that the Initial Data Address set up the register address;

          1: Register number (Modicon) - Define that the Initial Data Address set up the register number, first, second, etc.

Error Handling:

          0: Keep last value

          1: Set to zero

Event:

          0: Cyclic

           1: Rising Edge

           2: Initialization

Cycle Time: Request cyclic execution time
Event Variable: Variable for Rising Edge event.
Variable: Input or Output variable, depends on the Modbus function type.

 

mb_rtu_example_10

 

8.1) To create a Global Variable to request click on the Ellipsis points button and select GLOBAL to Scope and Group.

 

mb_rtu_example_08

 

8.2) Click on the Add button to open the Variable panel and enter a name to the new Variable, a size according with Request Length and the variable Datatype, to conclude click on OK button.

 

mb_rtu_example_09

 

9) A request will be created, on the right split window the information about the selected request or device is showed.

 

mb_rtu_example_11

 

10) Repeat the steps to create the Modbus RTU network.

 

mb_rtu_example_12

 

wpshelp_common_fig_note

NOTE!

If your network has more than one device with the same requests you can Clone an existent device althout create a new one.

 

10.1) To Clone a device, right-click on it and choose the Clone option.

 

mb_rtu_example_13

 

wpshelp_common_fig_note

NOTE!

The device will be cloned with the same requests, new variables will be created for this new device.

 

mb_rtu_example_14

 

wpshelp_common_fig_note

NOTE!

When you use the Modbus Configurator to create the Modbus Network the configurator will create global variables of datatype MODBUS to devices and variables of datatype MB_REQUEST to requests.

 

mb_rtu_example_15

 

11) The configuration must be compiled before downloading to the device.

 

wpshelp_common_fig_note

NOTE!

Any doubt about this process access the COMPILE session.

 

mb_rtu_example_19

 

wpshelp_common_fig_note

NOTE!

Is possible to create more than one Modbus RTU configuration but just one can be selected per device.

 

11.1) In cases where there is more than one Modbus RTU configuration, click the right button and select the main file.

 

mb_rtu_example_20

 

12) After compile the project, click on download button, check the option Communication features and observe if "modbus-rtu.bin" is on Internal memory files list.If yes, click in OK button to start the download.

 

mb_rtu_example_21

 

 

 

Other functions:

 

A) Monitoring

 

A.1) The Modbus RTU communication can be monitored using the configurator panel.

 

wpshelp_common_fig_note

NOTE!

On Modbus configurator is just possible to monitor the communications, if you must change some value on monitoring, do it using the feature Monitoring Variable.

 

mb_rtu_example_22

 

 

B) Disable and Enable

 

wpshelp_common_fig_note

NOTE!

On Modbus configurator is possible to Disable and Enabled devices and request before compile the project.

 

B.1) To disable a request, click with right button on it and select Disable.

 

mb_rtu_example_16

 

B.2) Verify that the request will be disabled on the network.

 

mb_rtu_example_17

 

B.3) To enable, click on the disabled request and select Enable.

 

mb_rtu_example_18

 

 

 

C) General client settings

 

C.1) To change the time between requests, click with right button on the main node PLC and select Settings.

 

mb_rtu_example_23

 

C.2) Set up the time between frames in milliseconds.

 

mb_rtu_example_24