smithtek-mako-rf 3.3.2 → 3.3.4
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/README.md +57 -81
- package/package.json +1 -1
- package/smithtek-mako-rf.html +1 -1
- package/smithtek-mako-rf.js +2 -0
package/README.md
CHANGED
|
@@ -1,82 +1,3 @@
|
|
|
1
|
-
# Cloud data/alarms and local debug — 3.3.2
|
|
2
|
-
|
|
3
|
-
- **Top pin, output 1 — Data / alarm:** successful decoded readings and write responses, or the friendly named fault JSON when a request fails. Connect this to the cloud flow.
|
|
4
|
-
- **Bottom pin, output 2 — Debug:** technical error payloads containing `ok:false`, `error`, `code` and `req`. Connect this to a local Debug node, or leave it disconnected. Successful requests send nothing here.
|
|
5
|
-
|
|
6
|
-
A timeout alarm is emitted after **one poll exhausts its configured retries**. Retries 0 means one failed attempt; retries 2 means three failed attempts. There is no separate bad-poll counter. If a retry succeeds, only normal data is emitted. Permanent Modbus exceptions (such as an unsupported register), invalid configuration and queue rejection are reported immediately. Each failed poll emits one friendly alarm on output 1 and one technical message on output 2. Intentional shutdown/redeploy cancellation emits neither.
|
|
7
|
-
|
|
8
|
-
Existing first-output wires keep both data and friendly alarms. Node-RED logs, status and Catch handling remain enabled. Refresh the editor after updating to see the pin labels. This corrects the output routing introduced in 3.3.1.
|
|
9
|
-
|
|
10
|
-
---
|
|
11
|
-
|
|
12
|
-
# Prefixes and operator fault messages — 3.3.0
|
|
13
|
-
|
|
14
|
-
## Prefix
|
|
15
|
-
|
|
16
|
-
Set the node's **Prefix** once, for example `b1`. A decoder row named `Pressure` then outputs `{"b1 Pressure":12}`. Copy the node and change its prefix to `b2` to reuse every table entry without renaming them. Leading/trailing prefix whitespace is trimmed, and exactly one space separates it from the row name. A blank prefix preserves existing output names. Existing nested names retain their structure: `tank=>level` becomes `{"b1 tank":{"level":12}}`.
|
|
17
|
-
|
|
18
|
-
## Operator fault JSON
|
|
19
|
-
|
|
20
|
-
Failed requests emit a flat numeric alarm on output 1 in `msg.payload`, suitable for forwarding as a named cloud value. For example:
|
|
21
|
-
|
|
22
|
-
```json
|
|
23
|
-
{"b1 RF ID2 Not communicating — check power/RF; disable if out of service":1}
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
The key uses the prefix (or node Name when no prefix is set), actual channel (RF, RS485-1 or RS485-2), device ID and a short operator message. RS485 timeouts advise checking power and wiring. Disabling an out-of-service asset is operator advice; the node never disables a device automatically.
|
|
27
|
-
|
|
28
|
-
Only a final failed request emits this alarm: a timeout that recovers within its configured retries produces normal data, with no fault payload. Permanent device exceptions and configuration errors are reported immediately when retrying cannot help. Each failed poll emits one fault message. Queue overload, gateway port problems, invalid configuration and decoding failures have distinct messages; they are not described as RF failures. Intentional shutdown/redeploy cancellation emits no fault alarm. An optional RSSI diagnostic failure remains in `msg.rssi_error` and does not turn a successful register read into an asset communication fault.
|
|
29
|
-
|
|
30
|
-
Full technical details remain in `msg.modbus`: `ok:false`, `code`, `error`, `req`, and `fault` (key, reason, operator summary, channel, device ID, prefix, node name and timestamp). Node-RED Catch handling remains supported. Successful requests output normal prefixed readings. No synthetic zero/clear alarm is sent on recovery; cloud alarm reset/expiry must be handled by the receiving flow or service.
|
|
31
|
-
|
|
32
|
-
**Output change:** failure payloads previously contained `{ok:false,error,req}`; they now contain the flat named alarm above. Use `msg.modbus.ok`, `msg.modbus.error` and `msg.modbus.req` in flows that inspect errors. This package does not connect to or configure 3dm.space; compatibility with a particular cloud ingestion schema must be verified there.
|
|
33
|
-
|
|
34
|
-
---
|
|
35
|
-
|
|
36
|
-
Digital read outputs in msg.payload use numeric 1 (on) and 0 (off), including coils (FC1), discrete inputs (FC2), and individual register bits. The raw Modbus response retains its original representation. Coil writes still accept true/false and 1/0.
|
|
37
|
-
|
|
38
|
-
# Simple bus settings and range scaling — 3.2.4
|
|
39
|
-
|
|
40
|
-
The bus editor retains the original timeout, retries, gap, maximum queue and RSSI controls. Queue age, coalescing, offline probe and recovery-quiet controls have been removed. Any saved values for those removed controls are ignored. All accepted requests wait in FIFO order; recovery timing is managed internally. The Range option in the decoder table remains available.
|
|
41
|
-
|
|
42
|
-
Each numeric decoder row has a compact Scaling dropdown: None (unchanged), Math (+ − × ÷), or Range (input → output). New rows start at None, with all calculation fields hidden. Math and Range settings appear beside the dropdown on the same line. Range shows In low, In high, Out low, Out high and Clamp side by side. Every decoder entry stays on one line; narrow dialogs scroll horizontally. Selecting None hides the fields and disables both calculations, retaining the entered settings for reuse. Existing configured Math and Range rows keep their active mode.
|
|
43
|
-
|
|
44
|
-
For Range, enter Input low, Input high, Output low and Output high. For example:
|
|
45
|
-
|
|
46
|
-
| Input low | Input high | Output low | Output high | Result at input 12 |
|
|
47
|
-
|---|---|---|---|---|
|
|
48
|
-
| 4 | 20 | 0 | 100 | 50 |
|
|
49
|
-
|
|
50
|
-
The input endpoints must match the values reported in Modbus registers. If a sensor reports 4000–20000 instead of 4–20, enter 4000 and 20000. No PLC calculation or extra Function node is needed.
|
|
51
|
-
|
|
52
|
-
Range scaling uses outputLow + (value - inputLow) * (outputHigh - outputLow) / (inputHigh - inputLow). It operates on the decoded numeric value after any existing integer mask. Range replaces the Math expression, retaining that expression for switching back. Negative, decimal and reversed ranges are supported. Equal input endpoints and invalid/nonfinite values are rejected. Digital/boolean rows cannot use Range mode.
|
|
53
|
-
|
|
54
|
-
Values outside the input span continue along the same line unless Clamp to output range is checked. For example, 0 mA maps to -25 for a 4–20 to 0–100 range; with Clamp it maps to 0. Floating-point results are not automatically rounded.
|
|
55
|
-
|
|
56
|
-
Existing rows without a scaling mode continue using Math. Raw Modbus data remains available in msg.modbus.raw. All FIFO queue and recovery behaviour from 3.1.2 is retained, and dependencies are unchanged.
|
|
57
|
-
|
|
58
|
-
---
|
|
59
|
-
# Reliability update 3.1.2
|
|
60
|
-
|
|
61
|
-
This release retains the pinned serial dependencies and supports Node.js 14 syntax.
|
|
62
|
-
|
|
63
|
-
- One worker owns each bus. Closing a runtime node cancels only its own work.
|
|
64
|
-
- Open, request, diagnostic and close operations have deadlines. A port whose close cannot be confirmed stays quarantined rather than acquiring a second owner.
|
|
65
|
-
- Serial errors are handled. Dead connections are retired before reopening.
|
|
66
|
-
- Reads and writes use FIFO order. Queue overflow returns an explicit error and completes once.
|
|
67
|
-
- Every accepted request is retained in FIFO order, including repeated reads from the same node. Requests are not coalesced or expired while waiting.
|
|
68
|
-
- Each queued request gets the configured timeout retry count before moving to the next. There is no offline cooldown or skipped polling.
|
|
69
|
-
- After a communication error, the bus waits for a quiet period and flushes stale buffered data. Automatic quiet time is the response timeout on RF and 100ms on RS485. Late RF frames outside that interval remain a protocol limitation: Modbus RTU read replies carry no register address or transaction ID.
|
|
70
|
-
- RSSI queries verify their checksum, isolate diagnostic bytes, settle on cancellation and retain the serial connection after success.
|
|
71
|
-
- Invalid addresses, quantities and write values are rejected before transmission. Signed scale expressions add/subtract, and incomplete 32-bit values are rejected.
|
|
72
|
-
|
|
73
|
-
No additional bus settings are required. Recovery timing is automatic: the response timeout on RF and 100ms on RS485.
|
|
74
|
-
|
|
75
|
-
Failures emit msg.modbus.ok=false and the fault payload documented above. msg.modbus.code identifies queue, offline and transport conditions; done(error) also enables Node-RED Catch handling. Intentional node/bus shutdown settles callbacks without emitting from closed nodes. No retry can guarantee a timed-out write was not applied at the device: retain an appropriate retry setting for the PLC command semantics.
|
|
76
|
-
|
|
77
|
-
Validated on a Passport with Raspbian Buster, Node.js 14.21.3, native serial dependencies and two physical RF Makos. Node.js 16 has not been separately executed. No dependency upgrade is required.
|
|
78
|
-
|
|
79
|
-
---
|
|
80
1
|
**Installation**
|
|
81
2
|
Install using the `NodeRED palette manager`
|
|
82
3
|
|
|
@@ -194,6 +115,12 @@ Each row defines how raw Modbus data is converted into structured JSON.
|
|
|
194
115
|
### Name
|
|
195
116
|
Becomes the output key in `msg.payload`. The name could be your sensor name like "level sensor" or " thermal trip" " pump control" choose a name that suits your SCADA scheme.
|
|
196
117
|
|
|
118
|
+
### Prefix
|
|
119
|
+
|
|
120
|
+
The Prefix field applies to every name in the decoder table. Enter `b1` and a row named `Pressure` becomes `b1 Pressure` in `msg.payload`, with a space between the prefix and name.
|
|
121
|
+
|
|
122
|
+
Copy the node and change only the prefix to reuse the same table for another asset. Leave it blank to use the table names as entered.
|
|
123
|
+
|
|
197
124
|
### Register Data Type
|
|
198
125
|
|
|
199
126
|
- 16 bit integer
|
|
@@ -226,9 +153,21 @@ After Bit 15, the next row moves to the next register.
|
|
|
226
153
|
|
|
227
154
|
## Scale
|
|
228
155
|
|
|
229
|
-
Optional value transformation applied after the Modbus register is read.
|
|
156
|
+
Optional value transformation applied after the Modbus register is read.
|
|
157
|
+
|
|
158
|
+
Decoded numeric readings are rounded to a maximum of six decimal places after Math or Range scaling. Values remain numbers, without added trailing zeros. Very small values may round to zero. Raw data in `msg.modbus.raw` is unchanged.
|
|
230
159
|
The Scale field lets you adjust raw register data into meaningful engineering values without needing extra function nodes. Think of it as lightweight post-processing built directly into the driver.
|
|
231
160
|
|
|
161
|
+
Choose a scaling mode for each row:
|
|
162
|
+
|
|
163
|
+
- **None** leaves the value unchanged.
|
|
164
|
+
- **Math** applies an operator and number, such as `/100` or `+5`.
|
|
165
|
+
- **Range** maps input low/high values to output low/high values.
|
|
166
|
+
|
|
167
|
+
All controls stay on the same row. Selecting None disables the calculation while keeping the entered settings for reuse.
|
|
168
|
+
|
|
169
|
+
### Math
|
|
170
|
+
|
|
232
171
|
You can apply the following operators:
|
|
233
172
|
|
|
234
173
|
- Addition +
|
|
@@ -258,11 +197,48 @@ Example:
|
|
|
258
197
|
|
|
259
198
|
If you want to multiple your modbus value by 10 you would put "* 10" without the quotes and use a space between the number and the match function.
|
|
260
199
|
|
|
200
|
+
### Range — 4–20 mA Scaling
|
|
201
|
+
|
|
202
|
+
Select **Range** and enter **In low**, **In high**, **Out low** and **Out high**. This converts a sensor reading into engineering units in the Passport without a separate Function node or a calculation in the Mako.
|
|
203
|
+
|
|
204
|
+
For a 4–20 mA signal representing 0–100%:
|
|
205
|
+
|
|
206
|
+
| In low | In high | Out low | Out high |
|
|
207
|
+
|---|---|---|---|
|
|
208
|
+
| 4 | 20 | 0 | 100 |
|
|
209
|
+
|
|
210
|
+
A reading of 4 becomes 0, 12 becomes 50, and 20 becomes 100.
|
|
211
|
+
|
|
212
|
+
Use the values actually reported by the register. If it reports 4000–20000, enter 4000 and 20000 as the input limits instead of 4 and 20.
|
|
213
|
+
|
|
214
|
+
Tick **Clamp** to keep the result within the output limits. Otherwise, values outside the input limits continue scaling beyond the output range. Input low and high must differ. Negative, decimal and reversed ranges are supported. Range applies to numeric values and replaces the Math calculation for that row.
|
|
215
|
+
|
|
261
216
|
This allows you to convert raw Modbus numbers into readable, usable data straight from the node — reducing additional processing and keeping flows clean and simple.
|
|
262
217
|
|
|
263
218
|
---
|
|
264
219
|
|
|
265
|
-
## Output Behaviour
|
|
220
|
+
## Output Behaviour
|
|
221
|
+
|
|
222
|
+
### Output Pins
|
|
223
|
+
|
|
224
|
+
- **Top pin — Data / alarm:** sends parsed Modbus readings or write confirmations. If a request fails, it sends the friendly fault JSON for the cloud instead.
|
|
225
|
+
- **Bottom pin — Debug:** sends technical error details for a local Debug node. Leave it disconnected if these details are not needed. Successful requests send nothing from this pin.
|
|
226
|
+
|
|
227
|
+
### Fault Messages
|
|
228
|
+
|
|
229
|
+
Example payload from the top pin:
|
|
230
|
+
|
|
231
|
+
```json
|
|
232
|
+
{"b1 RF ID1 Not communicating — check power/RF; disable if out of service":1}
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
The fault name identifies the prefix, bus and device ID, followed by an operator message. If the prefix is blank, the node Name is used. Other problems, such as an unsupported register or invalid settings, receive a message appropriate to that fault.
|
|
236
|
+
|
|
237
|
+
A timeout fault is sent after one poll exhausts its retries: retries set to 0 means one failed attempt; retries set to 2 means three failed attempts. A successful retry sends normal data only. An unsupported-register error is reported immediately because retrying cannot correct the address. Each failed poll sends a fault; a redeploy cancellation does not.
|
|
238
|
+
|
|
239
|
+
The bottom pin carries `msg.payload.ok`, `msg.payload.error`, `msg.payload.code` and `msg.payload.req` for troubleshooting. Technical details are also available in `msg.modbus`. Node-RED error logs and Catch handling remain available.
|
|
240
|
+
|
|
241
|
+
When communication succeeds again, the top pin resumes normal readings. No automatic zero/clear alarm is sent.
|
|
266
242
|
|
|
267
243
|
### Successful Read
|
|
268
244
|
|
package/package.json
CHANGED
package/smithtek-mako-rf.html
CHANGED
|
@@ -678,7 +678,7 @@
|
|
|
678
678
|
<script type="text/markdown" data-help-name="smithtek-mako-rf">
|
|
679
679
|
Smithtek Mako RF / RS485.
|
|
680
680
|
|
|
681
|
-
Read mode outputs decoded JSON in msg.payload using the Decoder map rows. Digital points (coils, discrete inputs and register bits) output numeric 1 for on and 0 for off.
|
|
681
|
+
Read mode outputs decoded JSON in msg.payload using the Decoder map rows. Numeric readings are rounded to at most six decimal places after Math or Range scaling, and remain numbers. Digital points (coils, discrete inputs and register bits) output numeric 1 for on and 0 for off.
|
|
682
682
|
Raw modbus response is kept in msg.modbus.raw.
|
|
683
683
|
|
|
684
684
|
Prefix adds text and one space before each decoder name. Leave blank to preserve names.
|
package/smithtek-mako-rf.js
CHANGED
|
@@ -308,6 +308,8 @@ function toNum(v, fallback) {
|
|
|
308
308
|
// Digital points are numeric at the output boundary. Keep the internal
|
|
309
309
|
// boolean until here so saved math/masks cannot change a bit into another value.
|
|
310
310
|
if (typeof val === 'boolean') val = val ? 1 : 0;
|
|
311
|
+
// Round final readings, including Math/Range results, without stringifying them.
|
|
312
|
+
if (typeof val === 'number' && Number.isFinite(val)) val = Number(val.toFixed(6)) || 0;
|
|
311
313
|
setObjectProperty(decoded, name, val, "=>", prefix);
|
|
312
314
|
}
|
|
313
315
|
|