@fa_yoshinobu/node-red-contrib-plc-comm-slmp 0.2.3 → 0.2.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +80 -24
- package/LICENSE +21 -21
- package/README.md +228 -168
- package/docsrc/assets/README.md +10 -10
- package/docsrc/index.md +11 -11
- package/docsrc/user/GETTING_STARTED.md +99 -87
- package/docsrc/user/LATEST_COMMUNICATION_VERIFICATION.md +35 -28
- package/docsrc/user/SUPPORTED_REGISTERS.md +134 -81
- package/docsrc/user/USER_GUIDE.md +275 -248
- package/docsrc/user/toc.yml +7 -7
- package/examples/flows/README.md +41 -38
- package/examples/flows/slmp-array-string.json +194 -195
- package/examples/flows/slmp-basic-read-write.json +194 -195
- package/examples/flows/slmp-control-error.json +216 -217
- package/examples/flows/slmp-demo.json +268 -269
- package/examples/flows/slmp-device-matrix.json +572 -514
- package/examples/flows/slmp-routing.json +123 -124
- package/examples/flows/slmp-udp-read-write.json +194 -195
- package/lib/index.js +6 -6
- package/lib/slmp/client.js +1513 -866
- package/lib/slmp/constants.js +139 -124
- package/lib/slmp/core.js +564 -406
- package/lib/slmp/errors.js +21 -21
- package/lib/slmp/high-level.js +1084 -973
- package/lib/slmp/index.js +9 -10
- package/nodes/slmp-connection.html +141 -142
- package/nodes/slmp-connection.js +83 -78
- package/nodes/slmp-read.html +431 -275
- package/nodes/slmp-read.js +251 -207
- package/nodes/slmp-write.html +423 -268
- package/nodes/slmp-write.js +323 -275
- package/package.json +54 -54
package/CHANGELOG.md
CHANGED
|
@@ -1,24 +1,80 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
## Unreleased
|
|
4
|
-
|
|
5
|
-
## 0.2.
|
|
6
|
-
|
|
7
|
-
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
-
|
|
17
|
-
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
-
|
|
23
|
-
-
|
|
24
|
-
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## Unreleased
|
|
4
|
+
|
|
5
|
+
## 0.2.12 - 2026-05-02
|
|
6
|
+
|
|
7
|
+
- bump the release revision for npm and Node-RED Flow Library publishing; the Flow Library currently shows `0.2.3` as the public baseline
|
|
8
|
+
- refresh README, user-guide, latest-verification, and example-flow docs with compatibility notes from the published Flow Library version
|
|
9
|
+
- document the public compatibility change from separate `PLC series` / `frame type` fields to one `PLC type` selector
|
|
10
|
+
- document the public device-scope changes since Flow Library `0.2.3`: `LTS`, `LTC`, `LSTS`, `LSTC`, `LCS`, `LCC`, and `LZ` are now in the high-level surface where the selected PLC type supports them
|
|
11
|
+
- document the current device-matrix flow behavior: one-click run-all read/write buttons, status-lamp feedback, JSONL result logging, `plcFamily` records, and skip/error summary counts
|
|
12
|
+
|
|
13
|
+
## 0.2.11 - 2026-05-02
|
|
14
|
+
|
|
15
|
+
- remove the interim device-range catalog helper from the Node-RED package
|
|
16
|
+
- keep ordinary Node-RED read/write validation to address format and protocol constraints, leaving actual device-range errors to the PLC response
|
|
17
|
+
- reject device codes that the selected `plcFamily` does not expose in the public high-level table, aligned with the .NET `DEVICE_RANGES.md` support matrix
|
|
18
|
+
|
|
19
|
+
- remove stale user-guide and TODO wording that still described `LCS` and `LCC`
|
|
20
|
+
as future support; the high-level helpers route reads through direct bit read
|
|
21
|
+
and writes through random bit write (`0x1402`)
|
|
22
|
+
- keep `G` and `HG` out of the default public device-matrix flow while they
|
|
23
|
+
remain routed-device follow-up items
|
|
24
|
+
|
|
25
|
+
## 0.2.10 - 2026-04-27
|
|
26
|
+
|
|
27
|
+
- tighten SLMP device-name parsing to split by known device code instead of a greedy letter regex, so hexadecimal addresses such as `XFF` and `SWFF` parse correctly
|
|
28
|
+
- fail matched-device invalid numbers as that device code instead of treating them as a different unknown code shape
|
|
29
|
+
|
|
30
|
+
## 0.2.9 - 2026-04-27
|
|
31
|
+
|
|
32
|
+
- add packaged helper support for remote control, memory read/write, extend-unit read/write, and label array/random read/write commands
|
|
33
|
+
- add low-level tests for the new helper payloads and response parsing
|
|
34
|
+
- expand Node-RED wrapper participation in the shared cross-library parity suite
|
|
35
|
+
|
|
36
|
+
## 0.2.8 - 2026-04-27
|
|
37
|
+
|
|
38
|
+
- tighten long-device route guards so `LTN/LSTN/LCN/LZ` avoid unsupported direct/raw word and dword paths, while supported random/named dword paths remain available
|
|
39
|
+
- align `LCS/LCC` writes with the random/named bit route policy
|
|
40
|
+
|
|
41
|
+
## 0.2.7 - 2026-04-14
|
|
42
|
+
|
|
43
|
+
- require explicit `plcFamily` on the standard packaged client and connection-node route, while keeping manual frame/profile selection only for internal diagnostic paths
|
|
44
|
+
- switch the standard device-range example to the interim catalog helper so the high-level Node surface consistently derives frame, profile, address, and range handling from one family selection
|
|
45
|
+
|
|
46
|
+
## 0.2.6 - 2026-04-14
|
|
47
|
+
|
|
48
|
+
- replace connection-node `plcSeries` / `frameType` selection with one explicit `plcFamily` that derives the fixed frame, access profile, address-family, and range-family defaults
|
|
49
|
+
- make high-level `X/Y` string addresses require explicit `plcFamily`, treat `iq-f` `X/Y` as octal, and refresh tests, docs, and example flows for the stricter family-driven model
|
|
50
|
+
|
|
51
|
+
## 0.2.5 - 2026-04-14
|
|
52
|
+
|
|
53
|
+
- add interim device-range catalog helpers and CPU operation-state support to the packaged SLMP client surface
|
|
54
|
+
- add regression tests and README coverage for the new device-range and CPU-state helpers
|
|
55
|
+
|
|
56
|
+
## 0.2.4 - 2026-04-13
|
|
57
|
+
|
|
58
|
+
- add client-side guard logic for unsupported long-timer direct reads and unsupported `LCS/LCC` random, block, and monitor-registration commands
|
|
59
|
+
- align long-counter helper behavior and core tests with the shared cross-library consistency rules
|
|
60
|
+
|
|
61
|
+
## 0.2.3 - 2026-04-13
|
|
62
|
+
|
|
63
|
+
- CI now checks out `plc-comm-slmp-cross-verify/specs/shared` before running the shared-vector tests, so the Node package validates against the canonical cross-library parity vectors.
|
|
64
|
+
|
|
65
|
+
## 0.2.2 - 2026-04-01
|
|
66
|
+
|
|
67
|
+
- add an optional `npm run smoke:editor` script that installs the local package into an isolated userDir, starts a temporary Node-RED runtime, imports `slmp-basic-read-write.json`, and verifies the flow starts cleanly
|
|
68
|
+
- refresh README, user guide, and example-flow docs with the editor-smoke command and the current canonical-address helper exports
|
|
69
|
+
|
|
70
|
+
## 0.2.1 - 2026-03-28
|
|
71
|
+
|
|
72
|
+
- move npm package publishing to the scoped name `@fa_yoshinobu/node-red-contrib-plc-comm-slmp`
|
|
73
|
+
- refresh README and user documentation for Flow Library submission, npm badges, and scoped install commands
|
|
74
|
+
|
|
75
|
+
## 0.2.0 - 2026-03-28
|
|
76
|
+
|
|
77
|
+
- add `slmp-connection`, `slmp-read`, and `slmp-write` nodes for binary 3E/4E over TCP and UDP
|
|
78
|
+
- add named address helpers including `,count`, string access, route overrides, and connection control messages
|
|
79
|
+
- add editor validation, example flows, README improvements, and user/maintainer documentation
|
|
80
|
+
- add local test coverage and package dry-run validation
|
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 yoshinobu
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 yoshinobu
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,168 +1,228 @@
|
|
|
1
|
-
[](https://github.com/fa-yoshinobu/node-red-contrib-plc-comm-slmp/actions/workflows/ci.yml)
|
|
2
|
-
[](https://www.npmjs.com/package/@fa_yoshinobu/node-red-contrib-plc-comm-slmp)
|
|
3
|
-
[](https://www.npmjs.com/package/@fa_yoshinobu/node-red-contrib-plc-comm-slmp)
|
|
4
|
-

|
|
5
|
-

|
|
6
|
-

|
|
7
|
-

|
|
8
|
-

|
|
9
|
-
|
|
10
|
-
# Node-RED SLMP Nodes for Mitsubishi PLCs
|
|
11
|
-
|
|
12
|
-

|
|
13
|
-
|
|
14
|
-
Node-RED nodes for Mitsubishi PLC communication over SLMP binary 3E/4E frames.
|
|
15
|
-
|
|
16
|
-
This package uses the same named-device foundation as the SLMP libraries, extended here with Node-RED-friendly count and string forms:
|
|
17
|
-
|
|
18
|
-
- `D100`
|
|
19
|
-
- `D100,10`
|
|
20
|
-
- `D200:F`
|
|
21
|
-
- `D200:F,4`
|
|
22
|
-
- `D300:L`
|
|
23
|
-
- `D50.3`
|
|
24
|
-
- `M1000`
|
|
25
|
-
- `M1000,8`
|
|
26
|
-
- `D100:STR,10`
|
|
27
|
-
- `DSTR100,10`
|
|
28
|
-
|
|
29
|
-
This package is documented for the high-level Node-RED workflow only:
|
|
30
|
-
|
|
31
|
-
- `slmp-connection`
|
|
32
|
-
- `slmp-read`
|
|
33
|
-
- `slmp-write`
|
|
34
|
-
|
|
35
|
-
## Quick Start
|
|
36
|
-
|
|
37
|
-
1. Install the package into your Node-RED user directory and restart Node-RED.
|
|
38
|
-
2. Add one `slmp-connection` config node and set `host`, `port`, `transport`,
|
|
39
|
-
3. Add `slmp-read` for the first smoke test, using a safe address such as `D300`, `D300,4`, or `DSTR320,10`.
|
|
40
|
-
4. When read works, add `slmp-write` and use known-safe test devices before moving to production addresses.
|
|
41
|
-
|
|
42
|
-
If you are working from this repository, import one of the ready-to-run flows under [examples/flows](https://github.com/fa-yoshinobu/node-red-contrib-plc-comm-slmp/blob/main/examples/flows/README.md) first. The safest first choices are:
|
|
43
|
-
|
|
44
|
-
- [`slmp-basic-read-write.json`](https://github.com/fa-yoshinobu/node-red-contrib-plc-comm-slmp/blob/main/examples/flows/slmp-basic-read-write.json) for plain TCP scalar read/write
|
|
45
|
-
- [`slmp-array-string.json`](https://github.com/fa-yoshinobu/node-red-contrib-plc-comm-slmp/blob/main/examples/flows/slmp-array-string.json) for `,count` and string access
|
|
46
|
-
- [`slmp-device-matrix.json`](https://github.com/fa-yoshinobu/node-red-contrib-plc-comm-slmp/blob/main/examples/flows/slmp-device-matrix.json) for one-by-one high-level coverage across the matrix catalog
|
|
47
|
-
- [`slmp-udp-read-write.json`](https://github.com/fa-yoshinobu/node-red-contrib-plc-comm-slmp/blob/main/examples/flows/slmp-udp-read-write.json) for UDP validation
|
|
48
|
-
|
|
49
|
-
Start with `D` word devices for the first smoke test. Do not start with `slmp-device-matrix.json`.
|
|
50
|
-
|
|
51
|
-
## Release Information
|
|
52
|
-
|
|
53
|
-
- package name: `@fa_yoshinobu/node-red-contrib-plc-comm-slmp`
|
|
54
|
-
- package version: `0.2.
|
|
55
|
-
- npm package: <https://www.npmjs.com/package/@fa_yoshinobu/node-red-contrib-plc-comm-slmp>
|
|
56
|
-
- Node-RED requirement: `>=3.0.0`
|
|
57
|
-
- Node.js requirement: `>=18`
|
|
58
|
-
- changelog: <https://github.com/fa-yoshinobu/node-red-contrib-plc-comm-slmp/blob/main/CHANGELOG.md>
|
|
59
|
-
|
|
60
|
-
Install from npm:
|
|
61
|
-
|
|
62
|
-
```bash
|
|
63
|
-
cd ~/.node-red
|
|
64
|
-
npm install @fa_yoshinobu/node-red-contrib-plc-comm-slmp
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
Install from this repository:
|
|
68
|
-
|
|
69
|
-
```bash
|
|
70
|
-
cd ~/.node-red
|
|
71
|
-
npm install /path/to/node-red-contrib-plc-comm-slmp
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
Optional local editor smoke test from the repository root:
|
|
75
|
-
|
|
76
|
-
```bash
|
|
77
|
-
npm run smoke:editor
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
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.
|
|
81
|
-
|
|
82
|
-
Legacy note:
|
|
83
|
-
|
|
84
|
-
- the original unscoped `node-red-contrib-plc-comm-slmp@0.2.0` remains on npm, but new releases move to the scoped package name above
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
-
|
|
91
|
-
-
|
|
92
|
-
-
|
|
93
|
-
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
-
|
|
101
|
-
-
|
|
102
|
-
-
|
|
103
|
-
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
-
|
|
112
|
-
-
|
|
113
|
-
-
|
|
114
|
-
-
|
|
115
|
-
|
|
116
|
-
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
-
|
|
127
|
-
-
|
|
128
|
-
-
|
|
129
|
-
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
- `
|
|
136
|
-
- `
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
-
|
|
141
|
-
-
|
|
142
|
-
-
|
|
143
|
-
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
-
|
|
1
|
+
[](https://github.com/fa-yoshinobu/node-red-contrib-plc-comm-slmp/actions/workflows/ci.yml)
|
|
2
|
+
[](https://www.npmjs.com/package/@fa_yoshinobu/node-red-contrib-plc-comm-slmp)
|
|
3
|
+
[](https://www.npmjs.com/package/@fa_yoshinobu/node-red-contrib-plc-comm-slmp)
|
|
4
|
+

|
|
5
|
+

|
|
6
|
+

|
|
7
|
+

|
|
8
|
+

|
|
9
|
+
|
|
10
|
+
# Node-RED SLMP Nodes for Mitsubishi PLCs
|
|
11
|
+
|
|
12
|
+

|
|
13
|
+
|
|
14
|
+
Node-RED nodes for Mitsubishi PLC communication over SLMP binary 3E/4E frames.
|
|
15
|
+
|
|
16
|
+
This package uses the same named-device foundation as the SLMP libraries, extended here with Node-RED-friendly count and string forms:
|
|
17
|
+
|
|
18
|
+
- `D100`
|
|
19
|
+
- `D100,10`
|
|
20
|
+
- `D200:F`
|
|
21
|
+
- `D200:F,4`
|
|
22
|
+
- `D300:L`
|
|
23
|
+
- `D50.3`
|
|
24
|
+
- `M1000`
|
|
25
|
+
- `M1000,8`
|
|
26
|
+
- `D100:STR,10`
|
|
27
|
+
- `DSTR100,10`
|
|
28
|
+
|
|
29
|
+
This package is documented for the high-level Node-RED workflow only:
|
|
30
|
+
|
|
31
|
+
- `slmp-connection`
|
|
32
|
+
- `slmp-read`
|
|
33
|
+
- `slmp-write`
|
|
34
|
+
|
|
35
|
+
## Quick Start
|
|
36
|
+
|
|
37
|
+
1. Install the package into your Node-RED user directory and restart Node-RED.
|
|
38
|
+
2. Add one `slmp-connection` config node and set `host`, `port`, `transport`, and `PLC type`.
|
|
39
|
+
3. Add `slmp-read` for the first smoke test, using a safe address such as `D300`, `D300,4`, or `DSTR320,10`.
|
|
40
|
+
4. When read works, add `slmp-write` and use known-safe test devices before moving to production addresses.
|
|
41
|
+
|
|
42
|
+
If you are working from this repository, import one of the ready-to-run flows under [examples/flows](https://github.com/fa-yoshinobu/node-red-contrib-plc-comm-slmp/blob/main/examples/flows/README.md) first. The safest first choices are:
|
|
43
|
+
|
|
44
|
+
- [`slmp-basic-read-write.json`](https://github.com/fa-yoshinobu/node-red-contrib-plc-comm-slmp/blob/main/examples/flows/slmp-basic-read-write.json) for plain TCP scalar read/write
|
|
45
|
+
- [`slmp-array-string.json`](https://github.com/fa-yoshinobu/node-red-contrib-plc-comm-slmp/blob/main/examples/flows/slmp-array-string.json) for `,count` and string access
|
|
46
|
+
- [`slmp-device-matrix.json`](https://github.com/fa-yoshinobu/node-red-contrib-plc-comm-slmp/blob/main/examples/flows/slmp-device-matrix.json) for one-by-one and run-all high-level coverage across the matrix catalog
|
|
47
|
+
- [`slmp-udp-read-write.json`](https://github.com/fa-yoshinobu/node-red-contrib-plc-comm-slmp/blob/main/examples/flows/slmp-udp-read-write.json) for UDP validation
|
|
48
|
+
|
|
49
|
+
Start with `D` word devices for the first smoke test. Do not start with `slmp-device-matrix.json`.
|
|
50
|
+
|
|
51
|
+
## Release Information
|
|
52
|
+
|
|
53
|
+
- package name: `@fa_yoshinobu/node-red-contrib-plc-comm-slmp`
|
|
54
|
+
- package version: `0.2.12`
|
|
55
|
+
- npm package: <https://www.npmjs.com/package/@fa_yoshinobu/node-red-contrib-plc-comm-slmp>
|
|
56
|
+
- Node-RED requirement: `>=3.0.0`
|
|
57
|
+
- Node.js requirement: `>=18`
|
|
58
|
+
- changelog: <https://github.com/fa-yoshinobu/node-red-contrib-plc-comm-slmp/blob/main/CHANGELOG.md>
|
|
59
|
+
|
|
60
|
+
Install from npm:
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
cd ~/.node-red
|
|
64
|
+
npm install @fa_yoshinobu/node-red-contrib-plc-comm-slmp
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Install from this repository:
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
cd ~/.node-red
|
|
71
|
+
npm install /path/to/node-red-contrib-plc-comm-slmp
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Optional local editor smoke test from the repository root:
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
npm run smoke:editor
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
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.
|
|
81
|
+
|
|
82
|
+
Legacy note:
|
|
83
|
+
|
|
84
|
+
- the original unscoped `node-red-contrib-plc-comm-slmp@0.2.0` remains on npm, but new releases move to the scoped package name above
|
|
85
|
+
|
|
86
|
+
### Changes Since Flow Library 0.2.3
|
|
87
|
+
|
|
88
|
+
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:
|
|
89
|
+
|
|
90
|
+
- `slmp-connection` now uses one `PLC type` selector. Older `PLC series` and `frame type` fields from Flow Library `0.2.3` flows must be reselected after import.
|
|
91
|
+
- `X/Y` string addresses are PLC-type-specific: iQ-F uses octal `X/Y`, while the other supported PLC types use hexadecimal `X/Y`.
|
|
92
|
+
- `LTS`, `LTC`, `LSTS`, `LSTC`, `LCS`, `LCC`, and `LZ` are now in the high-level surface where the selected PLC type supports them.
|
|
93
|
+
- Device codes unsupported by the selected PLC type are errors by default. The `slmp-device-matrix.json` sample can instead log them as `SKIPPED` records when it sends `slmpSkipUnsupported`.
|
|
94
|
+
|
|
95
|
+
## Supported PLC Registers
|
|
96
|
+
|
|
97
|
+
Start with these register/device families first:
|
|
98
|
+
|
|
99
|
+
- word devices: `D`, `SD`, `R`, `ZR`, `TN`, `CN`
|
|
100
|
+
- bit devices: `M`, `X`, `Y`, `SM`, `B`
|
|
101
|
+
- typed forms: `D100:S`, `D100:I`, `D200:F`, `D300:L`
|
|
102
|
+
- special Node-RED forms: `D100,10`, `M1000,8`, `D100:STR,10`, `DSTR100,10`
|
|
103
|
+
- bit-in-word form: `D50.3`
|
|
104
|
+
|
|
105
|
+
See the full public table in [Supported PLC Registers](https://github.com/fa-yoshinobu/node-red-contrib-plc-comm-slmp/blob/main/docsrc/user/SUPPORTED_REGISTERS.md).
|
|
106
|
+
|
|
107
|
+
## Documentation
|
|
108
|
+
|
|
109
|
+
- [Getting Started](https://github.com/fa-yoshinobu/node-red-contrib-plc-comm-slmp/blob/main/docsrc/user/GETTING_STARTED.md)
|
|
110
|
+
- [Supported PLC Registers](https://github.com/fa-yoshinobu/node-red-contrib-plc-comm-slmp/blob/main/docsrc/user/SUPPORTED_REGISTERS.md)
|
|
111
|
+
- [Latest Communication Verification](https://github.com/fa-yoshinobu/node-red-contrib-plc-comm-slmp/blob/main/docsrc/user/LATEST_COMMUNICATION_VERIFICATION.md)
|
|
112
|
+
- [User Guide](https://github.com/fa-yoshinobu/node-red-contrib-plc-comm-slmp/blob/main/docsrc/user/USER_GUIDE.md)
|
|
113
|
+
- [Example Flows](https://github.com/fa-yoshinobu/node-red-contrib-plc-comm-slmp/blob/main/examples/flows/README.md)
|
|
114
|
+
- [Documentation Index](https://github.com/fa-yoshinobu/node-red-contrib-plc-comm-slmp/blob/main/docsrc/index.md)
|
|
115
|
+
|
|
116
|
+
Maintainer-only notes and retained evidence live under `internal_docs/`.
|
|
117
|
+
|
|
118
|
+
## What You Can Do
|
|
119
|
+
|
|
120
|
+
- Binary 3E and 4E frames
|
|
121
|
+
- TCP and UDP transport
|
|
122
|
+
- reusable `slmp-connection`
|
|
123
|
+
- high-level reads and writes through `slmp-read` and `slmp-write`
|
|
124
|
+
- typed source selection for literal / `msg` / `flow` / `global` / `env`
|
|
125
|
+
- per-request routing via `msg.target` or configured route sources
|
|
126
|
+
- read output selection for object / array / single value
|
|
127
|
+
- metadata emission selection for `msg.slmp`
|
|
128
|
+
- configurable error handling with throw / `msg.error` / second output
|
|
129
|
+
- connection control via `connect` / `disconnect` / `reinitialize` messages
|
|
130
|
+
|
|
131
|
+
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.
|
|
132
|
+
|
|
133
|
+
Supported canonical PLC type values:
|
|
134
|
+
|
|
135
|
+
- `iq-f`
|
|
136
|
+
- `iq-r`
|
|
137
|
+
- `iq-l`
|
|
138
|
+
- `mx-f`
|
|
139
|
+
- `mx-r`
|
|
140
|
+
- `qcpu`
|
|
141
|
+
- `lcpu`
|
|
142
|
+
- `qnu`
|
|
143
|
+
- `qnudv`
|
|
144
|
+
|
|
145
|
+
## Underlying JS Helper
|
|
146
|
+
|
|
147
|
+
The package also exports the underlying SLMP helper library for the same read/write model used by the Node-RED nodes:
|
|
148
|
+
|
|
149
|
+
```js
|
|
150
|
+
const { SlmpClient, readNamed } = require("@fa_yoshinobu/node-red-contrib-plc-comm-slmp/lib/slmp");
|
|
151
|
+
|
|
152
|
+
async function main() {
|
|
153
|
+
const client = new SlmpClient({
|
|
154
|
+
host: "192.168.250.100",
|
|
155
|
+
port: 1025,
|
|
156
|
+
plcFamily: "qnu",
|
|
157
|
+
});
|
|
158
|
+
const values = await readNamed(client, ["D300", "D300,4"]);
|
|
159
|
+
console.log(values);
|
|
160
|
+
}
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
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.
|
|
164
|
+
If an address is outside the connected PLC's actual range, the PLC response is returned as the runtime error.
|
|
165
|
+
|
|
166
|
+
## Current Public Register Scope
|
|
167
|
+
|
|
168
|
+
- 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`
|
|
169
|
+
- word devices: `SD`, `D`, `W`, `TN`, `LTN`, `STN`, `LSTN`, `CN`, `LCN`, `SW`, `Z`, `LZ`, `R`, `ZR`, `RD`
|
|
170
|
+
- typed views: `:S`, `:I` (alias of `:S`), `:D`, `:L`, `:F`
|
|
171
|
+
- string/count views: `,count`, `:STR`, `DSTR`
|
|
172
|
+
- word-bit view: `.bit`
|
|
173
|
+
|
|
174
|
+
Public device-code support by `plcFamily`:
|
|
175
|
+
|
|
176
|
+
| PLC type | Public device codes accepted by the high-level API and Node-RED editor |
|
|
177
|
+
| --- | --- |
|
|
178
|
+
| `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` |
|
|
179
|
+
| `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` |
|
|
180
|
+
| `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` |
|
|
181
|
+
| `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` |
|
|
182
|
+
|
|
183
|
+
Validated public hardware summary:
|
|
184
|
+
|
|
185
|
+
- `FX5UC-32MT/D`
|
|
186
|
+
- `Q06UDVCPU`
|
|
187
|
+
- `R08CPU`
|
|
188
|
+
|
|
189
|
+
## Example Flows
|
|
190
|
+
|
|
191
|
+
- [`slmp-demo.json`](https://github.com/fa-yoshinobu/node-red-contrib-plc-comm-slmp/blob/main/examples/flows/slmp-demo.json): combined demo
|
|
192
|
+
- [`slmp-basic-read-write.json`](https://github.com/fa-yoshinobu/node-red-contrib-plc-comm-slmp/blob/main/examples/flows/slmp-basic-read-write.json): scalar, float, and bit read/write over TCP
|
|
193
|
+
- [`slmp-array-string.json`](https://github.com/fa-yoshinobu/node-red-contrib-plc-comm-slmp/blob/main/examples/flows/slmp-array-string.json): array and string read/write over TCP
|
|
194
|
+
- [`slmp-control-error.json`](https://github.com/fa-yoshinobu/node-red-contrib-plc-comm-slmp/blob/main/examples/flows/slmp-control-error.json): control messages, `msg` source, and second-output errors
|
|
195
|
+
- [`slmp-device-matrix.json`](https://github.com/fa-yoshinobu/node-red-contrib-plc-comm-slmp/blob/main/examples/flows/slmp-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 in `Node-RED userDir/logs/slmp-device-matrix-<session>.jsonl`
|
|
196
|
+
- [`slmp-routing.json`](https://github.com/fa-yoshinobu/node-red-contrib-plc-comm-slmp/blob/main/examples/flows/slmp-routing.json): per-request routing with `msg.target`
|
|
197
|
+
- [`slmp-udp-read-write.json`](https://github.com/fa-yoshinobu/node-red-contrib-plc-comm-slmp/blob/main/examples/flows/slmp-udp-read-write.json): basic UDP read/write
|
|
198
|
+
|
|
199
|
+
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.
|
|
200
|
+
|
|
201
|
+
## Known Limitations
|
|
202
|
+
|
|
203
|
+
- the high-level Node-RED surface requires explicit PLC type selection
|
|
204
|
+
- `.bit,count` is not supported
|
|
205
|
+
- a single client connection keeps requests serialized by default
|
|
206
|
+
- the read and write nodes keep the caller-visible logical request shape and do not silently retry with a different fallback split semantics
|
|
207
|
+
- `G` and `HG` are not part of the current public high-level register table
|
|
208
|
+
|
|
209
|
+
## Development
|
|
210
|
+
|
|
211
|
+
Run the local test suite:
|
|
212
|
+
|
|
213
|
+
```bash
|
|
214
|
+
cmd /c npm.cmd test
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
## Notes
|
|
218
|
+
|
|
219
|
+
- `.bit` notation is only valid for word devices such as `D50.3`
|
|
220
|
+
- direct bit devices should be addressed directly as `M1000`, `X1F`, `Y20`
|
|
221
|
+
- `LTN`, `LSTN`, `LCN`, and `LZ` default to 32-bit `:D` access in high-level helpers; iQ-F `LZ` samples should use `LZ0` or `LZ1`
|
|
222
|
+
- `LCN` current-value reads and writes use random dword access in the high-level helpers
|
|
223
|
+
- `LTS`, `LTC`, `LSTS`, and `LSTC` state reads use the long timer 4-word decode helpers
|
|
224
|
+
- `LCS` and `LCC` state reads use direct bit read; high-level state writes use random bit write (`0x1402`)
|
|
225
|
+
- low-level direct bit writes are guarded for `LTS`/`LTC`/`LSTS`/`LSTC`/`LCS`/`LCC`
|
|
226
|
+
- `X/Y` string addresses require explicit PLC type selection
|
|
227
|
+
- `iq-f` interprets `X/Y` string addresses in octal, while other supported families use hexadecimal `X/Y`
|
|
228
|
+
- random read batching follows the Python helper layer for batchable word devices
|
package/docsrc/assets/README.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
# Assets
|
|
2
|
-
|
|
3
|
-
See also:
|
|
4
|
-
|
|
5
|
-
- [Project README](../../README.md)
|
|
6
|
-
- [Documentation Index](../index.md)
|
|
7
|
-
|
|
8
|
-
Place shared documentation assets for `@fa_yoshinobu/node-red-contrib-plc-comm-slmp` here.
|
|
9
|
-
|
|
10
|
-
- `node-red-slmp.png`: README hero image for the Node-RED SLMP package
|
|
1
|
+
# Assets
|
|
2
|
+
|
|
3
|
+
See also:
|
|
4
|
+
|
|
5
|
+
- [Project README](../../README.md)
|
|
6
|
+
- [Documentation Index](../index.md)
|
|
7
|
+
|
|
8
|
+
Place shared documentation assets for `@fa_yoshinobu/node-red-contrib-plc-comm-slmp` here.
|
|
9
|
+
|
|
10
|
+
- `node-red-slmp.png`: README hero image for the Node-RED SLMP package
|
package/docsrc/index.md
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
# Documentation Index
|
|
2
|
-
|
|
3
|
-
Documentation landing page for `@fa_yoshinobu/node-red-contrib-plc-comm-slmp`.
|
|
4
|
-
|
|
5
|
-
- [Project README](../README.md)
|
|
6
|
-
- [Changelog](../CHANGELOG.md)
|
|
7
|
-
- [Getting Started](user/GETTING_STARTED.md)
|
|
8
|
-
- [Supported PLC Registers](user/SUPPORTED_REGISTERS.md)
|
|
9
|
-
- [Latest Communication Verification](user/LATEST_COMMUNICATION_VERIFICATION.md)
|
|
10
|
-
- [User Guide](user/USER_GUIDE.md)
|
|
11
|
-
- [Example Flows](../examples/flows/README.md)
|
|
1
|
+
# Documentation Index
|
|
2
|
+
|
|
3
|
+
Documentation landing page for `@fa_yoshinobu/node-red-contrib-plc-comm-slmp`.
|
|
4
|
+
|
|
5
|
+
- [Project README](../README.md)
|
|
6
|
+
- [Changelog](../CHANGELOG.md)
|
|
7
|
+
- [Getting Started](user/GETTING_STARTED.md)
|
|
8
|
+
- [Supported PLC Registers](user/SUPPORTED_REGISTERS.md)
|
|
9
|
+
- [Latest Communication Verification](user/LATEST_COMMUNICATION_VERIFICATION.md)
|
|
10
|
+
- [User Guide](user/USER_GUIDE.md)
|
|
11
|
+
- [Example Flows](../examples/flows/README.md)
|