Modbus TCP on Build-in Ethernet port in iQ-F and iQ-R EN

Modbus TCP on Build-in Ethernet port in iQ-F and iQ-R - Predefined Protocol

This document describes the configuration of Modbus TCP communication on a bulit-in Ethernet port with STLite (750-352). 
Wersja w j. polskim dostępna w załączniku

Configuration Ethernet connection

In Gx Works 3, open the embedded Ethernet port setting.

Configuration Ethernet port in iQ-R


 
In the project window go to the Parameter -> RxxCPU -> Module Parameter tab. Then in the Basic Settings open the <Detail Setting> tab in the External Device Configuration.
 

The Ethernet Configuration window opens. You need to add an Active Connection from Module List Ethernet Device (General). The built-in Ethernet port allows communication with up to 16 devices.

 

Then change the specified parameters:
Communication Method -> Predefined Protocol
Enter the PLC Port No.
Enter Device IP Address (192.168.3.60) and Port No. 502 (Standart port for Modbus TCP)

Then close the Ethernet Configuration window using the “Close with Reflecting the Setting” button.

Configuration Ethernet port in iQ-F

 
In the project window go to the Parameter -> FX5UCPU -> Module Parameter ->Ethernet tab. Then in the Basic Settings open the <Detail Setting> tab in the External Device Configuration. 
 

The Ethernet Configuration window opens. You need to add an Active Connection from Module List Ethernet Device (General). The built-in Ethernet port allows communication with up to 8 devices.

 

Then change the specified parameters:
Communication Method -> Predefined Protocol
Enter the PLC Port No.
Enter Device IP Address (192.168.3.60) and Port No. 502 (Standart port for Modbus TCP)

Then close the Ethernet Configuration window using the “Close with Reflecting the Setting” button.

Predefined Protocol (MODBUS TCP)

Configuration Predefined Protocol

In GX Works 3 open the Predefined Protocol Support Function. 
Tool -> Predefined Protocol Support Function…
      
     

In the newly opened window select CPU (Ethernet) for iQ-F and Built-in Ethernet CPU for iQ-R. Then create a new project.

 
Then add a new protocol by clicking the “Add” button. The following window will appear.

 
Select:
Model -> Modbus/TCP
Protocol Name -> 03:RD Holding Registers

After the changes confirm it with the OK button. 
 
The next step is to fill in the Packet Setting data. We go to Variable Unset in Request. The variable assignment window opens. 
 

You must fill in all the red variable fields. 


After completing all the fields the window should look like this:

 
Similarly do this for the other Packet Setting. 


Upload a project Predefined Protocol to PLC.

After completing the parametrization you need to upload the project to the PLC. This is done using the Predefined Protocol Support Function. Switch the controller to STOP mode.
 

PLC Program

Parameter initialization Predefined Protocol (Modbus TCP)

The first step is to fill out the data given in the Predefined Protocol (Request).
 

Open Connection with Slave

Open first connection. Soc_open contact will start the exchange of data.
 

Launch of Predefined Protocol

Assign a read registers protocol to control variables
 

Triggers the Predefined Protocol on the first connection (s1) and one protocol (s2), as well as the control variables. 
 

In the example, the registry data is in the D1000 register. The value from the analog input module is read in D1001.
 

Close connection

Closing the connection occurs after the SOC_close registry is triggered .


Attachments
:

File name:

Description:

FX5-MODBUS TCP.gx3

MODBUS TCP FX5.tpx

iQ-R-MODBUS TCP.gx3

Sample project Gx Works 3 for iQ-F

Sample project Predefined Protocol for iQ-F

Sample project Gx Works 3 for iQ-R

Modbus TCP iQ-R.tp2

Sample project Predefined Protocol for iQ-R