iQF-Series Modbus TCP Master Setup


This Manual specifies the Setup and programming of the FX5U-PLC using Modbus TCP as a Master.

At the end of this manual, you will be able to send and receive messages from the FX5U-PLC to any Modbus TCP Device.

Equipment Used

  • ST-Lite
  • GX Works 3
    • Version information – 1.055C
  • Mitsubishi FX5U-32MR/ES
    • Firmware Version – 1.110
    • Serial Number – 17X0001 and higher
  • Reference Manuals
    • MELSEC iQ-F – FX5 User’s Manual (MODBUS Communication) – JY997D56101
    • MELSEC iQ-F – FX5 User’s Manual (Startup) – JY997D58201
    • MELSEC iQ-F – FX5UC User’s Manual (Hardware) – JY997D61401
    • MELSEC iQ-F – FX5 User’s Manual (Serial Communication) – JY997D55901
    • MELSEC iQ-F – FX5 User’s Manual (MELSEC Communication Protocol) – JY997D60801
    • MELSEC iQ-F – FX5 User’s Manual (Ethernet Communication) – JY997D56201

Download Sample Program from My Mitsubishi Website

Link can be found here

Step 1 – Go to this page
Step 2 – Create a profile for you to login with.
Step 3 – Login using your new profile.
Step 4 – Go to this link:
Step 5 – Download the program.

Extract Files from the .zip file

Contents of Folder


For the MODBUS TCP communication setting of the FX5, set parameters with GX Works3. Setting of parameter differs according to the module used. The procedure for each module is as follows.

Parameter Setup:

Step 1: Open GX Works 3 and start a new project:

Step 2: Select:
            Series – FXCPU
            Type – FX5U
            Program Language – FBD/LD

Step 3: “Navigation window” -> [Parameter] -> [FX5UCPU] -> [Module Parameter] -> [Ethernet Port]:

Step 4: Change your IP-Address for your PLC:

Step 5: Select External Device Configuration and click on Detailed Setting:

Step 6: Add the following:

Step 7: Click “Close with Reflecting the Setting” button:

Step 8: Click on “Check” and if there is no error, click on “Apply”


Modbus Registers Available to Read/Write From Slave

Write Addresses: 400001 to 400010

Read Addresses: 400020 to 400030

Add Extracted Function Blocks used to communicate with the Modbus Slaves to Library

Step 1: Open “Element Selection”

Step 2: Register Library

Step 3: Browse for the “MEU+FX5UCPU_ModbusTCP_STlite_00A.mslm” file and select “Open”

Step 4: The following should now be visible in the “Element Selection” window:

Add Local Labels to “ProgPou”

Step 1: “Navigation window” -> [Program] -> [Scan] -> [MAIN1] -> [Local Label]:

Step 2: Add the following to the Local Labels

Add Global Labels

Step 1: “Navigation window” -> [Label] -> [Global Label] -> [Global] -> [Local Label]:

Step 2: Add the following to the Global Labels

Add PLC Program to ProgramBody

Step 1: “Navigation window” -> [Program] -> [Scan] -> [MAIN1] -> [ProgramBody]:

Step 2: Add the Following Program Code:

Step 3: Open the Element Selection Screen

Select MEU+FX5UCPU_ModbusTCPClientRequest_STLite Function Block from the Element Selection Screen. Drag and Drop it to the Program Screen.

Step 4: Add Parameters to Function Block MEU+FX5UCPU_ModbusTCPClientRequest_STLite

Convert and Download Program to the FX5U-PLC

Step 1: Rebuild Program to check for any program issues – “Main Menu” -> [Convert] -> [Rebuild All]:

Step 2: Download PLC Program to the FX5U-PLC – “Main Menu” -> [Online] -> [Write to PLC]: