Language: EN
Request a demo
Solutions

Mitsubishi MC protocol (SLMP) to MQTT

PLCGateway reads MELSEC iQ-R, iQ-F, Q and L controllers with the MC protocol (SLMP) and publishes data registers, bit devices, timers and counters to your MQTT broker.

MELSEC CPUs answer the MC protocol (SLMP) on their Ethernet port once a port is opened in GX Works; no ladder program or function block is needed. PLCGateway uses 3E or 4E frames, binary or ASCII, over TCP or UDP, reads the devices you list and publishes them as MQTT topics.

Word devices are read in blocks and bit devices in 16-bit words, so a few requests cover hundreds of tags. Values go out when they change, with quality and timestamp, ready for a broker, a cloud platform or a time-series database.

Source
Mitsubishi MC protocol (SLMP)
mc3e_binary mc3e_ascii mc4e_binary mc4e_ascii
Connection
TCP / UDP · binary or ASCII
Target
MQTT
Writing
yes

Set it up in five steps

  1. In GX Works open an Ethernet port for the MC protocol (SLMP) as TCP or UDP and allow writing in RUN if values are to be written.

  2. Add a device with frame (3E or 4E), coding (binary or ASCII), IP address and port, and choose the series (Q/L/FX5 or iQ-R).

  3. Enter the device addresses as tags or import them from CSV and test the connection.

  4. Open Gateway → MQTT, enter the broker address, port and login, switch on TLS if the broker requires it, and choose the base topic.

  5. Choose publishing on change or at an interval and the JSON or plain-value format, then check the topics with mosquitto_sub or in your platform.

Example: topics and payloads

A device with the id line2 and these tags is published as shown below; the lines are what mosquitto_sub -v prints. Names and values are examples.

TagAddressExample value
OvenTemperatureD200182.5 °C
CycleCountD1005120
AutoModeM100true

MQTT topics and payloads

plcgateway/status online
plcgateway/line2/OvenTemperature {"q":"GOOD","t":1794465246839,"u":"°C","v":182.5}
plcgateway/line2/CycleCount {"q":"GOOD","t":1794465246839,"v":5120}
plcgateway/line2/AutoMode {"q":"GOOD","t":1794465246839,"v":true}

Topic: base topic / device id / tag name. The JSON payload carries the value (v), the quality (q), the timestamp in milliseconds (t) and the unit (u).

The MQTT publisher in PLCGateway

PLCGateway publishes every tag to your MQTT broker – Mosquitto, EMQX, HiveMQ, AWS IoT Core or a cloud platform behind a bridge – so IT systems subscribe to topics instead of polling the controller. It speaks MQTT 3.1.1 over TCP or TLS, with user name and password.

Values are sent when they change or at a fixed interval, as JSON with quality and timestamp or as the bare value. A retained status topic with a last will tells subscribers whether the gateway is online.

  • One topic per tag: base topic / device / tag, with a base topic of your choice
  • QoS 0 or 1, retained messages, birth message and last will
  • Optional writing: a value published to the tag's /set topic is written to the controller
  • Messages are queued while the broker is unreachable and sent after the reconnect
MQTT publisher settings: broker, TLS, base topic, publish mode and payload format

Questions and answers

Which settings are needed in GX Works?

An Ethernet port opened for the MC protocol (SLMP) as TCP or UDP, with the same binary or ASCII coding as in PLCGateway, and writing in RUN allowed if values are to be written.

Does it work with the FX5U?

Yes. FX5U, FX5UC, FX5UJ and FX5S are read over their built-in Ethernet port with 3E frames; choose the series Q/L/FX5 for the device.

Which devices can be published?

Data registers (D), link registers (W), file registers (R, ZR), internal and special relays (M, SM), inputs and outputs (X, Y), timers and counters.

Connect your machines

Tell us which controllers you run; we show you PLCGateway with your own addresses.

Product and model names are trademarks of their owners. They are named only to show which equipment the drivers communicate with; PLCGateway is not affiliated with these companies.

PricingRequest a demo