Skip to content

Mitsubishi MC Protocol integration

Mitsubishi PLCs (the A, QnA, Q, L, and R series) don't speak Modbus — they use their own MC Protocol over Ethernet instead. To talk to one from a flow, install node-red-contrib-mcprotocol-ind from the Install tab of Manage palette — see Managing the palette. It isn't installed on this gateway by default.

Note

There's also a node-red-contrib-mcprotocol package by the same author, without the -ind suffix. The -ind ("independent") variant is the actively maintained one and the one described here.

Once installed, filter the palette for "mc" to find two new nodes under a MITSUBISHI category:

Node-RED palette filtered to "mc", showing the Ind MC Read and Ind MC Write nodes

Node Role
Ind MC Protocol Connection A shared config node — one TCP/UDP connection to the PLC, reused by any number of Read/Write nodes
Ind MC Read Reads one or more devices from the PLC
Ind MC Write Writes one or more devices to the PLC

Setting up the connection

Double-click a Read or Write node and click the pencil next to Connection to create an Ind MC Protocol Connection config node:

Ind MC Protocol Connection config dialog

Field Notes
Host The PLC's IP address
Port TCP/UDP port the PLC's Ethernet module is listening on
Protocol TCP or UDP
Frame 1E, 3E, or 4E — which MC Protocol frame format to use
PLC Type A, QnA, Q, L, or R
ascii mode Send frames as ASCII text instead of binary (unavailable for 3E/4E — binary only)
Network No Routing number for 3E/4E frames only
PC No Target CPU number, hex (e.g. 0xff)
Dest Module No Target I/O module number, hex (default 0x3ff, 3E/4E only)
Dest Module Stn No Target station number (0x0 addresses the PLC itself)
Timeout MS How long to wait for a response before failing

Which frame to pick

If the PLC's Ethernet module supports it, UDP with the 4E frame is the most reliable combination and the one the node's author recommends starting with. Older A-series PLCs only support the 1E frame.

Device addressing

Read and Write nodes both take an Address in one form:

[DS] DEV [DT] DN [.BIT] [,CNT] [:OPTS]
Part Meaning
DS Optional digit specifier, e.g. K4 (4 nibbles — used for bit devices read as a word, see below). Don't combine with DT.
DEV Device type: X (input), Y (output), D (data register), F, W (link register), B (link relay), R (file register), and others per the PLC's own device list
DT Optional data type override: REAL, FLOAT, STR, WORD, DWORD, DINT, UINT (defaults to a plain word if omitted)
DN Device number — decimal or hex depending on the device's own notation (e.g. YA, X1E, WBA4, B3D)
.BIT Optional bit number, for reading/writing a single bit within a device
,CNT Optional count of consecutive items to read/write (defaults to 1 if omitted)
:OPTS Optional JSON for routing to a different network/station, e.g. {N:2,S:3} to route to station 3 on network 2

A few concrete examples from the node's own documentation:

Address Reads/writes
K4Y0 4 nibbles of bit device Y, starting at Y0, packed into one word (-32768 to 32767)
DSTR0,10 A string up to 10 characters long, starting at D0
DUINT0,10 An array of 10 unsigned words (0–65535 each), starting at D0

Consult the PLC's own device/label list for what's actually mapped at each address — the node has no way of knowing your program's memory layout.

Reading

A basic poll: an inject node on a repeat interval → Ind MC Read, with its Address field set → a debug node to inspect the result.

Ind MC Read node, configured with a connection and address

The node's Output format setting controls the shape of msg.payload: a JSON object, or a plain array of values. If the read fails, msg.payload comes back null and msg.mcWriteDetails carries the error detail instead — check for that rather than assuming every trigger produces good data. Errors controls where that failure goes: thrown (the default), attached to msg.error, or sent out a second output port.

Writing

Ind MC Write takes an Address the same way, plus a Data field — a single value, or an array of values when ,CNT addresses more than one item:

Ind MC Write node, configured with a connection, address, and numeric data

On success msg.payload is true; msg.mcWriteDetails again carries error detail on failure, handled the same way as Read's Errors setting.

Both Read and Write nodes also accept connection-management commands on msg.connect, msg.disconnect, or msg.reinitialize (or the equivalent msg.topic strings "connect", "disconnect", "reinitialize"), useful for a flow that needs to explicitly reset the connection after a PLC power-cycle rather than waiting for a timeout.

Next: MQTT broker (Aedes), or back to Modbus / PLC integration if your PLC speaks Modbus instead.