@fa_yoshinobu/node-red-contrib-plc-comm-slmp 0.2.12
Node-RED nodes for Mitsubishi PLC communication over SLMP binary 3E/4E frames.
Node-RED SLMP Nodes for Mitsubishi PLCs

Node-RED nodes for Mitsubishi PLC communication over SLMP binary 3E/4E frames.
This package uses the same named-device foundation as the SLMP libraries, extended here with Node-RED-friendly count and string forms:
D100D100,10D200:FD200:F,4D300:LD50.3M1000M1000,8D100:STR,10DSTR100,10
This package is documented for the high-level Node-RED workflow only:
slmp-connectionslmp-readslmp-write
Quick Start
- Install the package into your Node-RED user directory and restart Node-RED.
- Add one
slmp-connectionconfig node and sethost,port,transport, andPLC type. - Add
slmp-readfor the first smoke test, using a safe address such asD300,D300,4, orDSTR320,10. - When read works, add
slmp-writeand use known-safe test devices before moving to production addresses.
If you are working from this repository, import one of the ready-to-run flows under examples/flows first. The safest first choices are:
slmp-basic-read-write.jsonfor plain TCP scalar read/writeslmp-array-string.jsonfor,countand string accessslmp-device-matrix.jsonfor one-by-one and run-all high-level coverage across the matrix catalogslmp-udp-read-write.jsonfor UDP validation
Start with D word devices for the first smoke test. Do not start with slmp-device-matrix.json.
Release Information
- package name:
@fa_yoshinobu/node-red-contrib-plc-comm-slmp - package version:
0.2.12 - npm package: https://www.npmjs.com/package/@fa_yoshinobu/node-red-contrib-plc-comm-slmp
- Node-RED requirement:
>=3.0.0 - Node.js requirement:
>=18 - changelog: https://github.com/fa-yoshinobu/node-red-contrib-plc-comm-slmp/blob/main/CHANGELOG.md
Install from npm:
cd ~/.node-red
npm install @fa_yoshinobu/node-red-contrib-plc-comm-slmp
Install from this repository:
cd ~/.node-red
npm install /path/to/node-red-contrib-plc-comm-slmp
Optional local editor smoke test from the repository root:
npm run smoke:editor
This command installs the local package into an isolated temporary userDir, starts a temporary Node-RED runtime, imports slmp-basic-read-write.json, verifies the flow starts, and then shuts the runtime down again.
Legacy note:
- the original unscoped
[email protected]remains on npm, but new releases move to the scoped package name above
Changes Since Flow Library 0.2.3
The Node-RED Flow Library currently shows 0.2.3 as the published baseline for this scoped package. Check these changes before updating an existing flow:
slmp-connectionnow uses onePLC typeselector. OlderPLC seriesandframe typefields from Flow Library0.2.3flows must be reselected after import.X/Ystring addresses are PLC-type-specific: iQ-F uses octalX/Y, while the other supported PLC types use hexadecimalX/Y.LTS,LTC,LSTS,LSTC,LCS,LCC, andLZare now in the high-level surface where the selected PLC type supports them.- Device codes unsupported by the selected PLC type are errors by default. The
slmp-device-matrix.jsonsample can instead log them asSKIPPEDrecords when it sendsslmpSkipUnsupported.
Supported PLC Registers
Start with these register/device families first:
- word devices:
D,SD,R,ZR,TN,CN - bit devices:
M,X,Y,SM,B - typed forms:
D100:S,D100:I,D200:F,D300:L - special Node-RED forms:
D100,10,M1000,8,D100:STR,10,DSTR100,10 - bit-in-word form:
D50.3
See the full public table in Supported PLC Registers.
Documentation
- Getting Started
- Supported PLC Registers
- Latest Communication Verification
- User Guide
- Example Flows
- Documentation Index
Maintainer-only notes and retained evidence live under internal_docs/.
What You Can Do
- Binary 3E and 4E frames
- TCP and UDP transport
- reusable
slmp-connection - high-level reads and writes through
slmp-readandslmp-write - typed source selection for literal /
msg/flow/global/env - per-request routing via
msg.targetor configured route sources - read output selection for object / array / single value
- metadata emission selection for
msg.slmp - configurable error handling with throw /
msg.error/ second output - connection control via
connect/disconnect/reinitializemessages
Set one explicit PLC type for each connection. The node stores it as plcFamily internally and derives frameType, access profile, and X/Y string-address rules from that selection.
Supported canonical PLC type values:
iq-fiq-riq-lmx-fmx-rqcpulcpuqnuqnudv
Underlying JS Helper
The package also exports the underlying SLMP helper library for the same read/write model used by the Node-RED nodes:
const { SlmpClient, readNamed } = require("@fa_yoshinobu/node-red-contrib-plc-comm-slmp/lib/slmp");
async function main() {
const client = new SlmpClient({
host: "192.168.250.100",
port: 1025,
plcFamily: "qnu",
});
const values = await readNamed(client, ["D300", "D300,4"]);
console.log(values);
}
The helper validates address format, protocol constraints, and device-code support for the selected plcFamily, but does not pre-check PLC model-specific device ranges or upper bounds.
If an address is outside the connected PLC's actual range, the PLC response is returned as the runtime error.
Current Public Register Scope
- bit devices:
SM,X,Y,M,L,F,V,B,TS,TC,LTS,LTC,STS,STC,LSTS,LSTC,CS,CC,LCS,LCC,SB,DX,DY - word devices:
SD,D,W,TN,LTN,STN,LSTN,CN,LCN,SW,Z,LZ,R,ZR,RD - typed views:
:S,:I(alias of:S),:D,:L,:F - string/count views:
,count,:STR,DSTR - word-bit view:
.bit
Public device-code support by plcFamily:
| PLC type | Public device codes accepted by the high-level API and Node-RED editor |
|---|---|
iq-r, iq-l, mx-f, mx-r |
SM, SD, X, Y, M, L, F, V, B, D, W, TS, TC, TN, LTS, LTC, LTN, STS, STC, STN, LSTS, LSTC, LSTN, CS, CC, CN, LCS, LCC, LCN, SB, SW, DX, DY, Z, LZ, R, ZR, RD |
iq-f |
SM, SD, X, Y, M, L, F, B, D, W, TS, TC, TN, STS, STC, STN, CS, CC, CN, LCS, LCC, LCN, SB, SW, Z, LZ, R |
qcpu |
SM, SD, X, Y, M, L, F, V, B, D, W, TS, TC, TN, STS, STC, STN, CS, CC, CN, SB, SW, DX, DY, Z, R, ZR |
lcpu, qnu, qnudv |
SM, SD, X, Y, M, L, F, V, B, D, W, TS, TC, TN, STS, STC, STN, CS, CC, CN, SB, SW, DX, DY, Z, R, ZR |
Validated public hardware summary:
FX5UC-32MT/DQ06UDVCPUR08CPU
Example Flows
slmp-demo.json: combined demoslmp-basic-read-write.json: scalar, float, and bit read/write over TCPslmp-array-string.json: array and string read/write over TCPslmp-control-error.json: control messages,msgsource, and second-output errorsslmp-device-matrix.json: one-by-one and run-all high-level read, write, and readback across the matrix catalog with one outstanding request at a time, status lamp feedback, completed-result history, run summary, unsupported-device skip records, and JSONL logging inNode-RED userDir/logs/slmp-device-matrix-<session>.jsonlslmp-routing.json: per-request routing withmsg.targetslmp-udp-read-write.json: basic UDP read/write
The device-matrix flow records plcFamily in each JSONL result, keeps one outstanding request at a time, and summarizes OK, SKIPPED, NG, mismatch, timeout, and pending counts.
Known Limitations
- the high-level Node-RED surface requires explicit PLC type selection
.bit,countis not supported- a single client connection keeps requests serialized by default
- the read and write nodes keep the caller-visible logical request shape and do not silently retry with a different fallback split semantics
GandHGare not part of the current public high-level register table
Development
Run the local test suite:
cmd /c npm.cmd test
Notes
.bitnotation is only valid for word devices such asD50.3- direct bit devices should be addressed directly as
M1000,X1F,Y20 LTN,LSTN,LCN, andLZdefault to 32-bit:Daccess in high-level helpers; iQ-FLZsamples should useLZ0orLZ1LCNcurrent-value reads and writes use random dword access in the high-level helpersLTS,LTC,LSTS, andLSTCstate reads use the long timer 4-word decode helpersLCSandLCCstate reads use direct bit read; high-level state writes use random bit write (0x1402)- low-level direct bit writes are guarded for
LTS/LTC/LSTS/LSTC/LCS/LCC X/Ystring addresses require explicit PLC type selectioniq-finterpretsX/Ystring addresses in octal, while other supported families use hexadecimalX/Y- random read batching follows the Python helper layer for batchable word devices