Modbus TCP Mitsubishi iQ-R: Step-by-Step Setup (GX Works3, RJ71EN71, RnENCPU)

By | April 28, 2026

A practical engineering guide to configure Modbus TCP on the Mitsubishi MELSEC iQ-R series — quick setup, GX Works3 parameters, MODBUS Device Assignment, function codes, exception codes, float/endian handling, polling timing, and field troubleshooting

Quick Setup (5 Steps)

If you just need it working fast, here’s the short path:

StepAction
1GX Works3 → Module Parameter → Required Settings: set IP address (e.g. 192.168.1.10)
2Application Settings → MODBUS/TCP Setting → set to Use
3Keep the default MODBUS Device Assignment (40001 → D0, Coil 1 → M0)
4ConvertWrite to PLCReset CPU → set to RUN
5Test with Modbus Master Simulator

That’s the entire base config. Read the rest if it doesn’t work or you need custom mapping.

💡 Slave vs Master — read this first:

  • Slave (iQ-R answers SCADA): No ladder needed. The CPU handles responses internally. Just configure parameters.
  • Master (iQ-R reads remote devices): Ladder logic required. Use Modbus FBs from the GX Works3 library or GP.READ/GP.WRITE.

This guide covers slave (the more common case). Master is mentioned briefly in Section 4.

Introduction

The MELSEC iQ-R is Mitsubishi’s flagship PLC platform — used widely in automotive, semiconductor, and high-end machine building across Asia, Europe, and North America. For Modbus TCP, the iQ-R offers two hardware paths: the RJ71EN71 Ethernet module, or the built-in Ethernet ports on the Ethernet-equipped CPUs (R04ENCPU through R120ENCPU).

This article is verified against the MELSEC iQ-R MODBUS and MODBUS/TCP Reference Manual (BCN-P5999-1060-B).

1. iQ-R Hardware Options for Modbus TCP

The iQ-R provides Modbus TCP on two hardware paths:

HardwareWhen to Use
RnENCPU built-in Ethernet (R04ENCPU, R08ENCPU, R16ENCPU, R32ENCPU, R120ENCPU)New projects, single PLC, simple system
RJ71EN71 Ethernet moduleMultiple network segments, isolated Modbus traffic, or non-Ethernet CPU

Both options have 2 Ethernet ports (P1, P2), support 1 Gbps, and are configured the same way in GX Works3. The steps below apply to both.

For serial Modbus (RTU/ASCII), use the RJ71C24 family. Same MODBUS slave logic, different transport.

2. iQ-R as Modbus TCP Slave: Overview

When the iQ-R acts as slave, a SCADA master, HMI, or another PLC connects on TCP port 502 and reads/writes data. The iQ-R handles slave responses internally — no ladder logic required.

The slave function uses MODBUS Device Assignment to map Modbus references (coils, discrete inputs, holding registers, input registers, file registers) to internal CPU device memory (M, X, Y, D, ZR).

Example: when a master reads holding register 40001, the iQ-R returns the value of D0 (default mapping).

3. Pre-Operational Procedure

  1. Mount the RJ71EN71 (or use built-in Ethernet on RnENCPU)
  2. Open GX Works3, create a project for your iQ-R CPU
  3. Configure module parameters
  4. Set IP address
  5. Enable MODBUS/TCP in Application Settings
  6. Configure MODBUS Device Assignment (default or custom)
  7. Download to CPU and reset
  8. Test with a Modbus master simulator

4. iQ-R as Modbus TCP Master (Brief)

For master function, you need ladder logic. Use Modbus function blocks from the GX Works3 library, or dedicated instructions like GP.READ and GP.WRITE. Refer to the MELSEC iQ-R Ethernet User’s Manual (Application) for master programming details.

The rest of this guide focuses on slave configuration.

5. Step 1: Configure Module Parameters in GX Works3

Open GX Works3 and navigate to module parameters:

HardwareGX Works3 Path
RJ71EN71Project Tree → Parameter → Module Information → 0000:RJ71EN71(E+E)
RnENCPU built-inProject Tree → Parameter → CPU → Module Parameter → Ethernet Port

Both lead to the same configuration screen with three sections:

  • Required Settings — IP, communication mode
  • Basic Settings — Connection Configuration
  • Application Settings — where MODBUS/TCP lives

6. Step 2: Set IP Address and Network Settings

In Required Settings:

ParameterExampleNotes
IP Address192.168.1.10Match your network plan
Subnet Mask255.255.255.0Standard /24
Default Gateway192.168.1.1If routing needed
Communication SpeedAuto-NegotiationDefault
Communication ModeOnlineDefault

⚠️ Each Ethernet port (P1, P2) has its own IP. They must be on different subnets unless using port redundancy.

7. Step 3: Enable MODBUS/TCP Function

In Application Settings → MODBUS/TCP Setting:

ParameterSetting
To Use or Not to Use MODBUS/TCPUse
Local Station Port No. (TCP)502 (default — keep unless you have a specific reason)

After this, the iQ-R listens on the configured port every time the CPU enters RUN mode.

8. Step 4: Configure MODBUS Device Assignment

This step maps Modbus reference numbers to internal iQ-R devices.

Default Assignment

For most projects, the defaults are sufficient:

Modbus ReferenceiQ-R DeviceQuantityFunction Codes
Coils (0xxxx)M0 onwardsUp to 64KFC 01, 05, 0F
Discrete Inputs (1xxxx)X0 onwardsUp to 64KFC 02
Input Registers (3xxxx)D0 onwardsUp to 64KFC 04
Holding Registers (4xxxx)D0 onwardsUp to 64KFC 03, 06, 10
Extended File Registers (6xxxx)ZR0 onwardsUp to file register sizeFC 14, 15

💡 3xxxx and 4xxxx point to the same D registers by default, but they are accessed with different function codes (FC 04 for Input Registers, FC 03 for Holding Registers). Some SCADA systems treat 3xxxx as read-only and 4xxxx as read/write — useful for protecting parts of memory at the master side.

Custom Assignment

Override defaults by configuring MODBUS Device Assignment Parameter. Up to 16 ranges per Modbus reference type. Each entry has:

  • Device Code (M, X, Y, D, ZR, B, W, etc.)
  • Head Device Number (e.g., D100)
  • Head MODBUS Reference Number (e.g., 40001)
  • Assignment Points (e.g., 200 registers)

Example: Map holding registers 40001–40200 to D100–D299 instead of D0–D199.

9. Real Example: SCADA Reading Temperature, Writing Setpoint

A practical scenario — a SCADA system needs to read a tank temperature and write a setpoint to an iQ-R PLC controlling a heater.

Internal Logic in the iQ-R (Ladder)

D0  = Tank temperature (read from analog input, scaled to °C × 10)
D9  = Heater setpoint (used by PID block)
M10 = Heater enable (used by output coil)

Default MODBUS Device Assignment Maps:

SCADA SeesiQ-R InternalDirectionWhat It Means
Holding Register 40001D0ReadTank temperature × 10 (e.g., 754 = 75.4 °C)
Holding Register 40010D9WriteHeater setpoint × 10
Coil 11M10Read/WriteHeater ON/OFF

What the SCADA Does:

  1. Polls FC 03 (Read Holding Registers), starts at PDU address 0, count = 1 → reads D0
  2. Sends FC 06 (Write Single Register), PDU address 9, value = 800 → writes 800 to D9 (setpoint = 80.0 °C)
  3. Sends FC 05 (Write Single Coil), PDU address 10, value = FF00H → turns M10 ON

That’s it. The iQ-R ladder uses D0, D9, M10 as it normally would — Modbus access is transparent to the program.

10. 32-bit Values, Float, and Byte Order

Most field issues with Modbus come from this section. Read it carefully.

Modbus registers are 16 bits. To transmit a 32-bit value (DINT, REAL/float), the iQ-R uses two consecutive registers. The order in which those registers are arranged is where most integration problems happen.

The Problem

There are two layers of byte order to align:

LayerWhat It MeansCommon Variants
Word orderWhich register holds the high word vs the low wordBig-endian word (high first) vs little-endian word (low first)
Byte orderWithin each register, which byte comes firstBig-endian byte (high first) vs little-endian byte (low first)

The combination gives four possible formats: ABCD, CDAB, BADC, DCBA.

What iQ-R Does

The iQ-R stores 32-bit values in two consecutive D registers using its native MELSEC format (low word in lower address). When a Modbus master reads them, the master must interpret the byte/word order correctly to reconstruct the float.

Practical Rule

If the SCADA shows nonsense values for a float (very large numbers, NaN, or wrong magnitude), it’s almost always a word/byte order mismatch. Try the other 3 combinations in the SCADA driver settings — one of them will be correct.

Master SettingResult
Word swap OFF, Byte swap OFFABCD
Word swap ON, Byte swap OFFCDAB (most common with iQ-R)
Word swap OFF, Byte swap ONBADC
Word swap ON, Byte swap ONDCBA

💡 Tip: Test with a known float value first. Write a recognizable number (e.g., 123.456) into a known register pair from the iQ-R side, then check what the SCADA reads. Adjust word/byte swap until the values match.

11. Polling Timing and Connection Behavior

ParameterRecommendedNotes
Typical scan / poll interval100–500 msMatch your SCADA’s needs, not faster
Minimum recommended≥ 50 msBelow this, the iQ-R may return Exception 06 (busy)
Maximum concurrent TCP connections64Hard limit — additional masters will be rejected
Modbus TCP timeout (master side)1–3 secondsIndustry standard

Why Aggressive Polling Hurts

A SCADA polling at 10 ms intervals against a single iQ-R will:

  • Generate Exception 06 (Slave Busy) responses
  • Saturate one of the 64 connection slots
  • Increase network congestion
  • Reduce CPU scan time available for actual control logic

If you need fast updates, increase the registers per request instead of decreasing the interval. One FC 03 read of 100 registers at 200 ms is far more efficient than 100 single-register reads at 10 ms.

12. Step 5: Download and Test

  1. Convert/Compile: F4 or Convert → Rebuild All
  2. Write to PLC: Online → Write to PLC → Parameter + Program → Execute
  3. Reset the CPU: power cycle or use the reset switch
  4. Set CPU to RUN: RUN/STOP switch or Online → Operation of PLC → Remote RUN

Test with Modbus Master Simulator

The article Top Free Modbus Troubleshooting Tools highlights a set of free tools used to diagnose and test Modbus RTU and TCP networks. It covers master simulators, slave simulators, and sniffers that help engineers validate communication, read/write registers, and monitor traffic. These tools are essential for quick troubleshooting, pre-commissioning checks, and isolating issues between devices, network, and SCADA systems.

13. Supported Modbus Function Codes

Verified against the BCN-P5999-1060-B reference manual:

FC (Hex)NameDescription
01HRead CoilsRead 1–2000 coil statuses
02HRead Discrete InputsRead 1–2000 input statuses
03HRead Holding RegistersRead 1–125 holding registers
04HRead Input RegistersRead 1–125 input registers
05HWrite Single CoilWrite ON/OFF to one coil
06HWrite Single RegisterWrite to one holding register
07HRead Exception Status8-bit exception status (serial only)
08HDiagnosticsVarious sub-functions (serial only)
0BHGet Communications Event Counter(serial only)
0CHGet Communications Event Log(serial only)
0FHWrite Multiple CoilsWrite 1–1968 coils
10HWrite Multiple RegistersWrite 1–123 holding registers
11HReport Slave IDRead slave identification
14H (SC: 06H)Read File RecordRead extended file registers
15H (SC: 06H)Write File RecordWrite extended file registers
16HMask Write RegisterAND/OR mask write
17HRead/Write Multiple RegistersRead and write in one transaction

💡 Function codes 07H, 08H, 0BH, 0CH are MODBUS Serial only. They do not work over Ethernet.

14. iQ-R Memory Mapping for Modbus

The iQ-R follows the standard rule: the master sends (device number – 1) in the request PDU.

Master SeesPDU AddressiQ-R Device (default)
Coil 10 (0000H)M0
Coil 10099 (0063H)M99
Holding Register 400010 (0000H)D0
Holding Register 4010099 (0063H)D99
Input Register 300010 (0000H)D0 (read-only access via FC 04)
Discrete Input 100010 (0000H)X0

⚠️ Off-by-one is the #1 source of Exception 02. If the master uses 1-based reference numbers and you mapped to D0, the master must send PDU 0 (subtracting 1). Most master tools handle this automatically — but always verify.

15. Exception Codes

When the iQ-R can’t fulfill a request, it returns the function code OR’d with 0x80 (e.g., 0x83 instead of 0x03), followed by an exception code:

CodeNameCauseAction
01HFunction code errorUnsupported function codeVerify FC list (Section 13). Use a different FC.
02HDevice address errorModbus address out of assigned rangeCheck MODBUS Device Assignment. Verify register is within mapped range.
03HData errorMalformed PDUCheck quantity (FC 03/04 max 125, FC 16 max 123).
04HProcessing failureInternal error during request processingCheck iQ-R diagnostics for hardware/config issue.
06HSlave busyiQ-R processing other requestsRetry. Reduce poll rate or concurrent connections.

For the full reference including gateway exception codes (0AH, 0BH), see: Modbus Exception Codes Explained

16. Diagnostic Counters and Communication Event Log

The iQ-R maintains diagnostic counters in buffer memory:

CounterDescriptionBuffer Memory (CH1 / CH2)
Bus message countMessages detected on the lineUn\G32512 / Un\G32576
Bus communication error countCRC/LRC errors, overruns, short framesUn\G32513 / Un\G32577
Exception error countException responses generatedUn\G32522 / Un\G32586
Slave message countMessages addressed to this iQ-RUn\G32518 / Un\G32582
Character overrun countRequests exceeding upper limitUn\G32514 / Un\G32578

Counters reach FFFFH and stop. Clear them by:

  • Power cycle or reset the CPU
  • FC 08H sub-function 01H (Restart Communications) — serial only
  • FC 08H sub-function 0AH (Clear Counters) — serial only
  • Write 0 to the buffer memory address from a sequence program

Communications Event Log

The iQ-R keeps a 64-entry event log (Un\G32544–Un\G32575 for CH1, Un\G32608–Un\G32639 for CH2). When full, the oldest entry is overwritten. Each entry records:

  • Communication errors
  • Bus character overrun
  • Listen-only mode entry/exit
  • Broadcast message reception
  • Message error (exception 01–03)
  • Processing interruption (exception 04)

17. Field Troubleshooting: Common Failure Patterns

When you’re on site and Modbus TCP isn’t working, this is what to check first:

Pattern 1: SCADA shows “no response” or timeout

Likely causes:

  • iQ-R CPU is in STOP mode → set to RUN
  • Modbus TCP not enabled → verify Application Settings was downloaded
  • IP unreachable → ping from the SCADA server first

Quick checks:

bash

ping 192.168.1.10
nc -zv 192.168.1.10 502

Pattern 2: Master gets Exception 02 (Illegal Data Address)

Likely causes:

  • Off-by-one error — master sending 40001 but expecting iQ-R to interpret it as PDU 1 (should be PDU 0)
  • Address outside assigned range — master requested register 40500 but only 200 registers were assigned
  • Wrong device mapping — register maps to a device that doesn’t exist (e.g., D99999)

Action: Open MODBUS Device Assignment in GX Works3, verify the address is within the configured range.

Pattern 3: Exception 03 (Illegal Data Value)

Likely causes:

  • Master tried to read >125 registers in one FC 03/04 request
  • Master tried to write >123 registers in one FC 16 request
  • Master sent malformed PDU (byte count mismatch)

Action: Split the request into smaller blocks.

Pattern 4: Intermittent connection drops or Exception 06

Likely causes:

  • >64 concurrent connections — iQ-R rejects new requests
  • Polling too aggressive (<50 ms) — iQ-R returns busy
  • Network congestion — switch overload, broadcast storms

Action: Increase poll interval. Reduce master concurrency. Check connection count in iQ-R diagnostics.

Pattern 5: Float values look like garbage (huge numbers, NaN)

Likely causes:

  • Word/byte order mismatch — see Section 10
  • SCADA expects ABCD format, iQ-R provides CDAB (or vice versa)

Action: Try toggling word swap and byte swap options in the SCADA driver. Test with a known recognizable value (e.g., 123.456) until the SCADA matches.

Pattern 6: Some registers read OK, others return wrong values

Likely causes:

  • Custom MODBUS Device Assignment with overlapping or mis-aligned ranges
  • Master and iQ-R using different data type interpretation (signed vs unsigned)

Action: Verify the assignment in GX Works3. Check the master’s data type settings.

Pattern 7: Works in test, fails in production

Likely causes:

  • Firewall blocking the port between SCADA VLAN and PLC VLAN
  • NAT or port forwarding breaking session continuity
  • Multiple masters fighting for the same connection slot

Action: Open Wireshark on the SCADA side. Filter tcp port 502. Look for retransmissions, RST flags, or no SYN-ACK.

For Wireshark-based diagnosis, see: Wireshark for Modbus TCP

Summary

The MELSEC iQ-R supports Modbus TCP through the RJ71EN71 module or built-in Ethernet on RnENCPU. Configuration in GX Works3: enable MODBUS/TCP, set IP, configure MODBUS Device Assignment.

The key things to remember:

  • Slave function needs no ladder logic — the iQ-R handles responses internally
  • MODBUS Device Assignment maps Modbus references to M, X, D, ZR
  • 17 standard function codes supported; 07H, 08H, 0BH, 0CH are serial-only
  • Exception codes returned: 01, 02, 03, 04, 06
  • Off-by-one is the #1 cause of Exception 02
  • Float/32-bit values require matching word and byte order between iQ-R and SCADA — this causes 50% of integration issues
  • Up to 64 concurrent connections; poll at 100–500 ms (not under 50 ms)
  • Diagnostic counters and a 64-entry event log are accessible via buffer memory

Author: Zakaria El Intissar

I'm an automation and industrial computing engineer with 12 years of experience in power system automation, SCADA communication protocols, and electrical protection. I build tools and write guides for Modbus, DNP3, IEC 101/103/104, and IEC 61850 on ScadaProtocols.com to help engineers decode, analyze, and troubleshoot real industrial communication systems.