Mitsubishi PLC as Modbus TCP Server: A Quick Tutorial

Programmable logic controllers (PLCs) are the backbone of industrial automation, ensuring precise control and seamless data exchange across devices. Among the many PLC options available, Mitsubishi PLCs stand out for their reliability, scalability, and advanced features. Coupled with the power of the Modbus TCP protocol, these PLCs can transform industrial networks into efficient, interconnected systems.

This tutorial focuses on configuring a Mitsubishi FX PLC as a Modbus TCP server. By leveraging Modbus TCP’s ability to communicate over Ethernet networks, you can enable real-time data exchange between the PLC and other devices in your automation system. Whether you’re an experienced engineer or a beginner in industrial automation, this guide provides a clear pathway to setting up your Mitsubishi FX PLC for Modbus TCP communication.

Mitsubishi PLCs and Modbus

Why Choose a Mitsubishi PLC?

Mitsubishi PLCs are more than just controllers; they are a symbol of reliability and innovation in industrial automation. With over a century of expertise, Mitsubishi Electric has earned its reputation as a global leader in manufacturing electrical and electronic equipment, transforming industries across the world.

  • Proven Reliability

Mitsubishi PLCs are trusted by industries ranging from manufacturing to energy and transportation. Their robust design ensures dependable operation even in the harshest environments. Whether it’s controlling complex machinery or managing data exchange across a network, Mitsubishi PLCs deliver consistent performance.

  • Innovation at Its Core

Mitsubishi PLCs incorporate cutting-edge features like high-speed processing, seamless network integration, and compatibility with protocols like Modbus TCP, making them a smart choice for modern industrial applications.

  • Scalability and Flexibility

From compact models for small-scale applications to advanced modular systems, Mitsubishi offers a wide range of PLCs to fit any project. Need to expand functionality? Mitsubishi PLCs are designed to scale with your business, ensuring long-term value and adaptability.

  • Global Support Network

With a presence in over 120 countries, Mitsubishi Electric provides comprehensive customer support and a wealth of resources. From training to troubleshooting, their global team ensures smooth implementation and maintenance, no matter where your operations are located.

  • Industry-Specific Expertise

Mitsubishi PLCs are tailored to meet the demands of specific industries, including automotive, packaging, and renewable energy. Their specialized features, combined with compatibility with leading protocols like Modbus TCP, make integration seamless and efficient.

Types of Mitsubishi PLCs

Mitsubishi offers a diverse range of PLCs to meet the needs of various industries and applications. From compact controllers for small-scale operations to advanced systems for large-scale automation, Mitsubishi PLCs provide robust performance, scalability, and reliability. Below is an overview of the key Mitsubishi PLC series and their strengths.

MELSEC iQ-R Series Best for medium- to large-scale control

The MELSEC iQ-R Series is designed to address the challenges of modern automation. It emphasizes productivity, quality, and security while reducing total cost of ownership. This series features:

  • Enhanced Processing Power: Guarantees reliable production with reduced downtime.
  • Cybersecurity Features: Includes IP-based access filters, user authentication, and hardware security keys.
  • Industry 4.0 Integration: An embedded database function turns raw data into actionable insights.
  • Seamless Compatibility: Backward compatibility with MELSEC-Q Series hardware and software for easy migration.

The iQ-R Series is ideal for manufacturers seeking scalable, high-performance solutions with advanced connectivity options.

MELSEC iQ-F Series Perfect for small-scale and standalone applications

The MELSEC iQ-F Series combines compact package with powerful functionality. This series is engineered for small- to medium-sized automation projects and includes features such as:

  • High-Speed Processing: Quick response times for fast-paced operations.
  • Built-In Ethernet: Simplifies integration into modern networks.
  • SD Card Slot: Supports secure data storage and transfer.
  • Flexible I/O Options: Handles a wide range of digital and analog inputs/outputs.

With its affordability and ease of use, the iQ-F Series is a reliable choice for standalone systems and smaller automation setups.


MELSEC-Q Series Medium- to large-scale automation excellence

Since its introduction in 1999, the MELSEC-Q Series has been a cornerstone of factory automation. It remains a go-to solution for industries requiring:

  • Multi-CPU Architecture: Manages multiple processes simultaneously for improved efficiency.
  • High-Speed Instruction Processing: Boosts overall system performance to meet modern production demands.
  • Scalability: Supports complex applications with versatile CPU and module options.

The Q Series offers unparalleled reliability for operations demanding precision and speed.


MELSEC-L Series Compact controllers with advanced features

The MELSEC-L Series is a compact PLC that delivers functionality typically associated with larger control systems. Key features include:

  • Built-In I/O and Functions: Reduces the need for additional modules.
  • On-Device Display: Allows status checks and error troubleshooting without a computer.
  • SD Memory Card Support: Enables quick data storage and retrieval.

This series is ideal for applications requiring a small footprint but demanding advanced capabilities.


MELSEC-F Series Simple and scalable for small-scale operations

The MELSEC-F Series (FX Series PLC) is renowned for its versatility and ease of use in standalone applications. Highlights include:

  • Integrated Features: Includes high-speed counters, positioning, communication ports, and more.
  • Scalability: Expansion units allow seamless integration of analog, communication, and sensor control modules.
  • Compact Dimensions: Optimized for small-scale systems while maintaining robust performance.

The FX Series is a dependable solution for applications requiring simplicity and flexibility.


What is Modbus?

Modbus is a communication protocol widely used in industrial automation for data exchange between devices. Developed in 1979 by Modicon, it is designed to facilitate simple and reliable communication between programmable logic controllers (PLCs), sensors, and other devices. Its straightforward structure and open nature have made it a standard in manufacturing, energy, and transportation industries.

The protocol organizes data into registers and coils, allowing devices to share numerical values or discrete states. Modbus comes in several variants, including Modbus RTU for serial communication and Modbus TCP for Ethernet networks. These options make it versatile, supporting both local and distributed systems. Modbus is commonly used in data monitoring, equipment control, and supervisory systems where predictable and efficient communication is essential.

Despite its age, Modbus remains relevant due to its simplicity, interoperability, and wide adoption across industrial equipment. Its ability to integrate devices from different manufacturers ensures it continues to play a vital role in modern automation systems.

Modbus TCP and Its Advantages

Modbus TCP is a variant of the Modbus communication protocol designed to operate over Ethernet networks. Unlike Modbus RTU, which relies on serial communication, Modbus TCP leverages the Transmission Control Protocol (TCP) to enable faster and more flexible data exchange. This modern adaptation of the protocol simplifies integration with existing IT infrastructure and supports larger networks with more devices.

One of the main advantages of Modbus TCP is its ability to use standard Ethernet hardware, eliminating the need for specialized communication equipment. This not only reduces installation costs but also allows devices to communicate over longer distances and at higher speeds. Additionally, Ethernet’s support for simultaneous connections enables Modbus TCP to handle multiple client requests efficiently, making it ideal for applications requiring real-time monitoring or control.

Modbus TCP also improves scalability and interoperability. With widespread support from industrial equipment manufacturers, it seamlessly integrates devices from different vendors into a single network. This open and standardized approach makes Modbus TCP a preferred choice for industrial automation, particularly in systems where flexibility, speed, and compatibility are critical.


Step-by-Step Guide

Requirements

  • Mitsubishi FX3S PLC
  • Either an RS-232 or RS-485 communication module (for example, the FX3U-232ADP-MB or FX3U-485ADP-MB with an FX3S-CNV-ADP adaptor)
  • GX Works2 (the programming software used to configure the PLC and write the ladder logic). Download it here with a Mitsubishi account.
  • Modbus polling software (a Modbus master simulator to test the results. We use ModbusClientX in the guide)
  • The appropriate communication cable for the module used (RS-232 or RS-485). In our example we will be using RS-485 configuration.

PLC Configuration in GX Works2

  • Communication Settings:
    • Open GX Works2 and create a new project.
  • Go to "Parameter" ⟶ "Communication Setting" ⟶ "Serial Port 1 (or 2)".
  • Set the following parameters:
    • Transmission Speed: Match the Modbus polling baud rate (e.g., 19200).
    • Data Length: 8 bits
    • Parity: Even
    • Stop Bit: 1 bit
  • Ladder Logic:

To configure the PLC as a Modbus TCP server, you'll need to write ladder logic to map Modbus registers to the PLC's internal data registers (D registers):

Explanation of the example shown in the picture:

  1. M8411:

M8411 enables Modbus communication settings for channel 1.

  1. H1097 (Communication Parameters):

Writing H1097 into D8400 sets the communication parameters:

  • 8-bit data
  • Even parity
  • 1 stop bit
  • 19200 bps
  • RS485 communication mode
  1. D8400 (Register for Communication Settings):
  • This is the designated register where the communication parameters (e.g., H1097) are written.
  1. D8401 (Protocol Mode Setting):  

Writing H11 into D8401 sets the PLC's communication protocol to Modbus RTU Slave mode, enabling it to act as a slave in Modbus communication.

  1. D8411 (Timing Parameters):
  • Writing K10 to D8411 configures timing parameters for the Modbus communication.
  1. D8414 (Slave Address):
  • Writing H1 into D8414 sets the PLC's Modbus slave address to 1.

After configuring the ladder logic, build the program pressing F4 (Windows).

  • Finally, go to Online ⟶ Write to PLC ⟶ Parameter+Program ⟶ Execute. The program will be written to the PLC. 

Now your PLC is acting as a Modbus server (or slave) and is ready to be polled from a client.

Testing the PLC With ModbusClientX

Now we will test the PLC’s configuration by using our computer as a Modbus client with the ModbusClientX software.

1. Install and Open ModbusClientX

  • Download ModbusClientX from this link and install it.
  • Open ModbusClientX.

2. Connecting

  • Create a new connection.
  • Select "RTU" as the Modbus mode.
  • Choose the correct COM port.
  • Configure the communication settings to match the PLC (baud rate, parity, etc.).
  • Click “connect”.

3. Read Data from the PLC

  • Set the "Slave ID" to match the PLC's station number.
  • Click "Read" from address 0 to 9.
  • The current values stored in the PLC’s M and D registers should now be displayed.
  • Any data stored from sensors or field devices in these registers will now be accessible to the master device.

4. Verify Communication

Now, let's go one step further to verify whether changes in the Modbus registers are correctly reflected in the master device.

  • Modify the PLC ladder logic to write a value to the M or D registers.
    • For example, add a line to use M8001 to write the constant number 10 to memory register D0.
  • Build and write the program to the PLC.
  • Use Monitor Mode to verify that the values are correctly written into the PLC.

You should now see the expected values displayed.

5. Check ModbusClientX for Updated Values

  • Open ModbusClientX. The value at address 0 should now display 10.
  • Modify other register values in the PLC and monitor the changes in ModbusClientX.
  • You can also use the master device to write values to the PLC registers:
    • Double-click any holding register in ModbusClientX.
    • Enter a value (e.g., write 20 to register D1).
    • Click "Write to Device" to send the value to the PLC.

6. Confirm Changes in the PLC

  • In GX Works2, go to Online → Monitor → Device Buffer/Memory Batch.
  • In the Device Name field, enter D0 and press Enter.
  • A table should appear, showing that D0 and D1 reflect the values written from ModbusClientX.

At this point, the PLC is successfully communicating as a Modbus TCP server, and the master device can read and write register values in real time.

Use IoT Gateway as Modbus Client

In industrial automation, polling data from a Modbus server is just the beginning. Often, there’s a need to visualize that data from remote locations for monitoring and analysis. This is where an IoT gateway comes into play. With its built-in support for Modbus and MQTT communication, the gateway can replace the simulated client used earlier in the guide. By configuring the IoT gateway as a Modbus client, it can poll data directly from the Mitsubishi PLC and seamlessly transmit it to cloud platforms or remote systems for visualization and further processing.

Let's do this step by step.

  • Go to the log in page of the Teltonika gateway. By default, it is 192.168.1.1, or refer to your gateway’s manual for credentials.
  • After logging in you should see a window like the one below. Navigate to the “Modbus” option within the “services” menu.
  • Ensure the Modbus TCP slave option is disabled. This is because we are going to use the gateway as master/client and the PLC as slave/server.
  • Go to the “Modbus Serial Master” tab and then into the “RS485” tab. Here we will add the PLC as a slave device. Add the slave configurations as were previously defined.
  • Click on “add”. Then edit the slave device parameters. Configure the slave device as follows (you should input the parameters as per your project settings):
  • Scroll down to the “request configuration” section. Click on “add” to add details of the PLC registers to be polled. 

Name: Give a meaningful name for the data you want to read.

Data type: Choose an appropriate data type from the drop-down menu. 

Function: If you want to read only, select “read holding register”.

First Register: The address of the PLC register.

Register Count: The length of the data (how many registers it occupies).

Enabled: Keep it checked to poll data continuously.

Now click on “test”. If the configuration is good you should see the PLC register value appear at the bottom. Here it shows the value “10” which was stored in the first register of our PLC.

  • Click on “save” to finish the process.

Now the gateway is polling data continuously from the PLC, acting as a Modbus client.

FAQS

What is the difference between Modbus RTU and Modbus TCP?

Modbus RTU uses serial communication (e.g., RS-232 or RS-485) to transmit data in a compact binary format, making it efficient for smaller networks with limited devices. However, it requires point-to-point or daisy-chained connections, which can limit scalability.

Modbus TCP, on the other hand, operates over Ethernet networks using the Transmission Control Protocol (TCP). It allows for faster communication, supports multiple simultaneous connections, and integrates easily into modern IT infrastructure. This makes Modbus TCP more suitable for larger, distributed systems that require high-speed data exchange and flexibility.

Does Mitsubishi make PLCs?

Yes, Mitsubishi Electric is a world market leader in the programmable logic controllers (PLCs) space. Their PLC lineup includes a wide range of models, such as the MELSEC iQ-R, iQ-F, Q, L, and F Series, designed to meet the needs of small-scale, standalone systems as well as complex, large-scale industrial automation. Mitsubishi PLCs are known for their reliability, scalability, and compatibility with protocols like Modbus TCP, delivering performance across various industies.

How many types of Mitsubishi PLCs are there?

Mitsubishi offers several types of PLCs, each tailored to different automation needs. The main series include the MELSEC iQ-R (their new flagship line) for medium- to large-scale systems with advanced features, the MELSEC iQ-F for small-scale and standalone applications, the MELSEC-Q for high-speed, large-scale automation, the MELSEC-L for compact yet versatile control, and the MELSEC-F (FX Series) for simple, scalable solutions in small-scale operations. Each series is designed to meet specific industrial demands, offering flexibility, performance, and reliability.

What programming language do Mitsubishi PLCs use?

Mitsubishi PLCs are programmed using ladder logic, a graphical programming language widely used in industrial automation. They are compatible with programming environments like GX Works2 and GX Works3, which support ladder logic along with other IEC 61131-3 standard languages such as structured text (ST) and function block diagrams (FBD). These options provide flexibility for both traditional and modern programming approaches, depending on the application.

What software do Mitsubishi Electric PLCs use?

Mitsubishi PLCs are programmed and configured using software like GX Works2 and GX Works3, both part of the iQ Works engineering suite. GX Works2 is commonly used for legacy PLCs, while GX Works3 offers a modern interface and advanced features for newer models like the MELSEC iQ-R and iQ-F series. These tools support ladder logic, structured text, structured programming, and function block programming, providing flexibility for a wide range of industrial applications.

What is GX Works2?

GX Works2 is a programming software developed by Mitsubishi Electric for configuring and programming their PLCs. It supports various programming languages, including ladder logic, structured text, and function block diagrams, making it versatile for industrial automation tasks. Having come after GX Developer, it's designed primarily for older and legacy PLCs like the MELSEC-Q and MELSEC-F series, it offers tools for creating, debugging, and maintaining control programs. GX Works2 is a reliable solution for engineers working with Mitsubishi’s robust line of programmable logic controllers.

Is Modbus TCP compatible with third-party devices and SCADA systems?

Yes, Modbus TCP is widely compatible with third-party devices and SCADA systems. As an open and standardized protocol, it allows seamless integration across different manufacturers and platforms. This makes it ideal for connecting PLCs, sensors, HMIs, and SCADA systems in industrial automation. Its use of Ethernet networks ensures flexibility and scalability, making Modbus TCP a reliable choice for diverse and interconnected systems.

What are the best practices for writing ladder logic to map Modbus registers?

When writing ladder logic to map Modbus registers, start by clearly identifying the PLC's data registers (e.g., D registers) that correspond to the required Modbus addresses. Use consistent and organized naming conventions to make your program easy to read and troubleshoot. Always enable Modbus communication settings (e.g., M8411 for Mitsubishi PLCs) and carefully configure the communication parameters to match the client’s settings, including baud rate, parity, and slave address.

Keep the logic simple and modular, mapping only the necessary data to avoid unnecessary complexity. Add comments to clarify each rung’s purpose, and test your program using Modbus polling software to ensure proper functionality. These practices will help maintain an efficient and reliable setup.

What are the key features of the Mitsubishi PLC FX Series?

The Mitsubishi PLC FX Series is known for its compact design, high-speed processing, and versatility. It includes built-in features like analog I/O, Ethernet communication, positioning control, and high-speed counters, making it suitable for a wide range of applications. Since Mitsubishi Electric launched it, the FX Series has been a standard in the compact controllers class, thanks to, among other things, its suppport of seamless expansion through additional modules for analog, communication, and sensor control. Its ease of programming and robust performance make it a reliable choice for small-scale automation systems.

Why are Mitsubishi FX Series PLCs considered low-cost compact controllers?

Mitsubishi FX Series PLCs are designed with affordability and efficiency in mind, offering essential automation features without unnecessary complexity. Their compact size offers many advantages by reducing installation space requirements, while built-in functions like high-speed I/O, analog inputs, and communication ports eliminate the need for additional modules in many applications. This all-in-one design minimizes hardware costs, making them an economical choice for small-scale or standalone automation systems, reasons that explain how Mitsubishi has millions of compact controller installations to its credit.