In the automotive welding workshop, the operation screen suddenly displayed a “D840.3” communication alarm, indicating that the data interruption of equipment utilization rate between the PLC and the MES system has lasted for 23 minutes.
At this time, although the production line is still running, the lack of quality traceability information will result in the inability to deliver an entire batch of products, with direct losses exceeding ¥8600 per minute.

01 Problem Diagnosis
Fault Phenomenon manifests as an unstable MQTT connection between the Mitsubishi FX5U PLC and the ThingsBoard platform, with “Connection reset by peer” exceptions (error code 0406H) occurring every 2-3 hours.
Through diagnostics in GX Works3, it was found that the TCP retransmission rate reached 17%, causing temperature sensor data (range 0-200℃) to exhibit jumps of ≥5℃.
Production Impact: This anomaly causes the temperature control system in the coating drying room to malfunction 3-4 times a month, resulting in a single downtime of 45 minutes per line, with an estimated annual scrap cost for carbon fiber components reaching ¥760,000.
02 Implementation Steps
1. Hardware Configuration
-
Main Station: FX5U-32MT/ES (Firmware version 1.260)
-
Communication Module: FX5-ENET (hardware version B and above must be confirmed)
-
Signal Isolator: ADAM-4561 (RS485 to fiber optic, to prevent workshop arc interference)
2. Software Environment
-
GX Works3 version 1.050S (earlier version 1.023 has a defect in MQTT heartbeat packets)
-
Protocol Stack Configuration:
// MQTT client parameters MOV K10 D100 // Keep-alive interval 10 seconds DMOVP K12345 D200 // PLC station number
3. Core Program
// Data upload task (period 50ms)
LD SM400
MOV U0\G100 D300 // Read temperature value
MOVP D300 H'iot/data/temp'
CALL MQTT_Publish
Data Compression uses differential encoding, automatically skipping uploads when the temperature change is <0.5℃, reducing network load.
4. Debugging and Verification
-
Forced Testing: In GX Works3, force D100=0 to simulate network disconnection, observing that the PLC should switch to the 4G backup channel within 28 seconds (refer to Mitsubishi FA Manual SH-081215 P.204)
-
Crossover Testing: Use Modbus TCP to parallel transmit pressure data, verifying that MQTT channel bandwidth usage is ≤85%
-
Stress Testing: Simulate 300 devices connecting concurrently, with a message arrival rate of ≥99.9% (packet loss compensation mechanism see below)
03 Safety Memorandum
❗️Must operate with power off: When replacing the FX5-ENET module, first disconnect the 24VDC power plug on the left side of the PLC (X0 terminal side), and use a multimeter to confirm the voltage is <2V
Three Prohibitions for Online Modifications:
-
Prohibit modifying the MQTT topic structure while the device is running
-
Prohibit disabling the watchdog timer (WDT setting must be ≤150ms)
-
Prohibit more than 3 online connections simultaneously writing to D registers
Mechanical Interlock Protection:
When MQTT communication is interrupted for more than 120 seconds, immediately activate the STO safety torque shutdown (parameter settings refer to Q173DSCPU manual section 6.2.3), ensuring that the robotic arm remains in a locked position.
Protocol Fault Tolerance Settings:
-
Baud rate tolerance ±2% (115200bps actual acceptance 112896-117504bps)
-
Message retry count = 3 (interval 500ms/1.5s/4s exponential backoff)
-
TLS certificate validity check with a 30-day warning in advance
(The parameters mentioned in this article are based on FX5U v1.26 and ThingsBoard v3.4.2 verification; please verify specific device versions before implementation)
Please like, view, and bookmark