Mitsubishi Communication Case: FX3U PLC and 485 Relay Module Communication Application

The 485 relay module uses the RS-485 communication protocol for data transmission, allowing independent or simultaneous control of multiple relay switch states through serial communication. This makes it easier to control multiple devices or circuits.

It not only saves wiring costs but also features a compact size, strong anti-interference capability, long transmission distance, and high stability, making it suitable for industrial environments and long-distance transmission. It is widely used in industrial control, smart agriculture, smart homes, building automation, and other fields.

1. Control Requirements:

1. Equipment used: FX3U-PLC (with 485-BD board), 485 relay module.

2. Control requirements: The PLC communicates with the 485 relay module via serial communication to control the switch states of the 485 relay module channels.

Mitsubishi Communication Case: FX3U PLC and 485 Relay Module Communication Application

2. Hardware Wiring Instructions:

Mitsubishi Communication Case: FX3U PLC and 485 Relay Module Communication Application

3. Communication Parameter Settings:

The communication parameters of the 485 relay module can be found in the manual: Data bits are 8 bits, no parity, stop bits 1 bit, baud rate 9600.

The corresponding 3U PLC’s 485 BD board also needs to set communication parameters. Click on PLC parameters to enter the settings interface. Select PLC system settings 2. Check channel 1 communication settings, protocol is no sequence protocol. Data length, parity, stop bits, and baud rate should all be consistent with the settings of the 485 relay module.

Type, select RS-485. Finally, click to finish the settings.

Mitsubishi Communication Case: FX3U PLC and 485 Relay Module Communication Application

4. RS Instruction Explanation:

RS instruction is a type of serial protocol-free communication instruction. Data exchange can be achieved with just a few simple settings.

Sending data writing: Set the sending request instruction ON in pulse mode, write the data to be sent into the soft components starting from D100 (designated point area), and set the sending request (M8122) ON to execute data sending.

Note: After sending is completed, the sending request (M8122) will automatically reset, and there is no need for the program to reset it.

Receiving data movement: After receiving data from the connected device, the receiving end flag (M8123) is set ON, moving the received data stored in D200 to another storage area.

Note: After moving the received data, the receiving end flag (M8123) must be reset. When M8123 is ON, the next received data cannot be obtained.

Mitsubishi Communication Case: FX3U PLC and 485 Relay Module Communication Application

The special soft components used are: M8122 sending request, M8123 receiving end flag. Also, M8161, 8-bit processing mode. There are two data processing formats for protocol-free communication. When M8161 is set to OFF, it is in 16-bit data processing mode; conversely, it is in 8-bit data processing mode.

In 16-bit data mode, the D register value is divided into low 8 bits and high 8 bits for sending and receiving. In 8-bit data mode, the high 8 bits are ignored, and only the low 8 bits are considered valid data.

Mitsubishi Communication Case: FX3U PLC and 485 Relay Module Communication Application

5. Application Program Writing:

According to the relay module manual, the protocol message for opening the relay is AA 00 02 01 BB. The protocol message for closing the relay is AA 01 03 01 BB, and we are using the first relay module. The address bit is 00. Therefore, the protocol message for closing the first relay module is: AA 00 03 01 BB.

Mitsubishi Communication Case: FX3U PLC and 485 Relay Module Communication Application

It is also possible to send AA 00 06 01 BB to get the current relay status of the module. If the data bit returns 00, it means the relay is off. If the data bit returns FF, it means the relay is on.

Mitsubishi Communication Case: FX3U PLC and 485 Relay Module Communication Application

Program writing:

Mitsubishi Communication Case: FX3U PLC and 485 Relay Module Communication Application

Mitsubishi Communication Case: FX3U PLC and 485 Relay Module Communication Application

6. Conclusion:

1. When using 16-bit processing mode, high and low byte swapping is required. It is recommended to use 8-bit processing mode if you are not familiar with RS instructions, as it is easier for programming and understanding.

2. During a complete communication process, the RS instruction must remain valid until the receiving data is completed. The RS instruction can be used multiple times in the program, but please ensure that only one instruction is driving at a time.

3. The RS instruction only executes data sending and receiving for PLC channel 1. If using PLC channel 2 for communication, please use the RS2 instruction. The usage is similar, but the special soft component addresses are different.

Mitsubishi Communication Case: FX3U PLC and 485 Relay Module Communication Application

Source: Original article from Jicheng Training Network, author: Fan Tengkai; unauthorized reproduction is prohibited, and offenders will be prosecuted!

Get It for Free

The editor has compiled the Mitsubishi Full Series PLC Electronic Data Package, which includes the complete set of Mitsubishi PLC manuals, cases, programs, etc., friends who are interested can scan the code to get it for free!

Mitsubishi Communication Case: FX3U PLC and 485 Relay Module Communication Application

Long press the QR code to get it immediately

Mitsubishi FX5U PID Automatic Regulation Control Case

2023-11-25

Mitsubishi Communication Case: FX3U PLC and 485 Relay Module Communication Application

How to Use Kunlun Tongtai Configuration Software (MCGSPro) for FX5U Simulation Communication, Very Detailed!

2023-11-23

Mitsubishi Communication Case: FX3U PLC and 485 Relay Module Communication Application

Beginner’s Guide: Must-Know Most Common Mitsubishi FX3U PLC Function Instructions

2023-09-15

Mitsubishi Communication Case: FX3U PLC and 485 Relay Module Communication Application

[Case Sharing] Manual, Semi-Automatic, and Fully Automatic Cases Based on FX3U for Material Handling

2023-09-07

Mitsubishi Communication Case: FX3U PLC and 485 Relay Module Communication Application

Leave a Comment