Getting started
Start here
Use this page to make your first MELSEC SLMP read from Node-RED. Start with one simple TCP flow, then move to arrays, strings, UDP, routing, or broader verification.
Prerequisites
| Requirement | Value |
|---|---|
| Node.js | 18 or later |
| Node-RED | 3.0 or later |
| PLC | MELSEC PLC reachable from your Node-RED host |
| First TCP target | 192.168.250.100:1025 |
| Starting PLC profile | melsec:iq-r |
Install
- Open the Node-RED editor.
- Open Manage palette.
- Open the Install tab.
- Search for
@fa_yoshinobu/node-red-contrib-plc-comm-slmp. - Install the package.
- Restart Node-RED if your environment requires it.
Create a connection node
Create or open a slmp-connection config node and set these fields:
slmp-connection field |
Example value | Description |
|---|---|---|
| Host | 192.168.250.100 |
PLC IP address or host name. |
| Port | 1025 |
TCP port for the first example. |
| Transport | TCP |
Use TCP for the first run. |
| PLC profile | melsec:iq-r |
Required canonical PLC profile. |
Confirm all route fields initialized by the editor. Use the own-station values unless your PLC network needs a different target.
Import the basic flow
- Open the Node-RED import dialog.
- Import
examples/flows/slmp-basic-read-write.json. - Open its
slmp-connectionnode. - Confirm Host is
192.168.250.100. - Confirm Port is
1025. - Confirm Transport is
TCP. - Confirm the PLC profile is
melsec:iq-r. - Deploy.
- Trigger the read inject node.
- Open the debug sidebar and verify
msg.payload.
The optional Test values (random + restore) Inject is state-changing. Use it only after replacing
the sample addresses with controlled test addresses. It saves the original values, performs
separate supported word and float writes, restores the snapshot after confirmed acknowledgements,
and reads again. D302.3 remains read-only because it cannot be mixed into that named write
contract. An error or outcome-unknown result stops the automatic sequence; inspect and reconcile
the target values manually instead of retrying.
In object output mode, a successful read looks like this shape:
{
"D300:U": 123
}
The value depends on your PLC memory.
Read your first value
To build the first read manually, add an slmp-read node and set:
slmp-read field |
Example value | Description |
|---|---|---|
| Connection | Your slmp-connection node |
Shared PLC connection. |
| Source | Literal text | The address list is entered in the editor. |
| Addresses | D300:U |
First safe word register to read. |
| Output | Object payload | Returns an object keyed by address. |
| Metadata | Full msg.slmp |
Includes connection and target metadata. |
| Errors | Throw | Lets Node-RED route runtime errors normally. |
Trigger the node with any message. A successful response sets msg.payload["D300:U"] to the current value.
Confirm success
- The flow deploys without editor validation errors.
- The
slmp-connectionnode has PLC profilemelsec:iq-r. - The PLC-side communication data code is Binary and the port/open setting matches your transport; see the MELSEC SLMP PLC Setup Guide.
- PLC-side RUN-time write permission is enabled before you run a write flow where the PLC exposes that setting, and every write address is a controlled test address.
- The read inject node produces a debug message.
msg.payloadcontains aD300:Ukey.- The connection status does not stay red after repeated reads.
If it does not work
| Symptom | Check |
|---|---|
| The read returns nothing or errors immediately | PLC profile on slmp-connection must be set. It is required, and there is no runtime default. |
| Connection opens but all requests fail | Confirm Binary communication data code in the PLC setup guide. |
| Reads work but writes fail | Confirm RUN-time write permission in the PLC setup guide and the selected profile write policy. |
| The first flow feels too busy | Import slmp-basic-read-write.json first, not slmp-device-matrix.json. |
| Address validation fails on the first run | Start with D300:U. Do not test with G or HG on the first run. |
| TCP does not connect | Confirm the PLC is reachable at 192.168.250.100:1025 from the Node-RED host. |
| UDP is your target | Move to the UDP example after TCP works, and set the UDP port to 1035. |