New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

node-red-contrib-modbus

Package Overview
Dependencies
Maintainers
1
Versions
197
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-red-contrib-modbus - npm Package Compare versions

Comparing version 5.8.0 to 5.9.0

examples/Modbus-Buffer-Server.json

29

CHANGELOG.md

@@ -1,13 +0,33 @@

# Changelog
# [5.9.0](https://github.com/biancoroyal/node-red-contrib-modbus/compare/v5.8.0...v5.9.0) (2020-04-09)
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
## [5.8.0](https://github.com/biancoroyal/node-red-contrib-modbus/compare/v5.7.0...v5.8.0) (2020-04-02)
### Bug Fixes
* FSM double take on running in the same states with multiple consumer ([5072e40](https://github.com/biancoroyal/node-red-contrib-modbus/commit/5072e407961ba5145ea9d50bc742c7494ba482b4))
* HTTP messaging did not work ([8e87053](https://github.com/biancoroyal/node-red-contrib-modbus/commit/8e870534f14c0f20f7445bfe214c790b8124e7fd))
* improve register and de-register for issue [#165](https://github.com/biancoroyal/node-red-contrib-modbus/issues/165) ([c68d59b](https://github.com/biancoroyal/node-red-contrib-modbus/commit/c68d59b41a8081bb9a345165098e360b787e2336))
* read node should not use basic status handling cause of the own interval ([dea606f](https://github.com/biancoroyal/node-red-contrib-modbus/commit/dea606f8d7bcf15c385f0b9336d195e82100126a))
* remove all listeners was lost in code ([92ada63](https://github.com/biancoroyal/node-red-contrib-modbus/commit/92ada63499a9bd0683817308cbb3f3c27393e4bb))
* test timeout passing ([0dcf966](https://github.com/biancoroyal/node-red-contrib-modbus/commit/0dcf966d021d7abc7726976bec8be84d7d1b968b))
* timer problem on partial deploy issue [#187](https://github.com/biancoroyal/node-red-contrib-modbus/issues/187) ([66066c0](https://github.com/biancoroyal/node-red-contrib-modbus/commit/66066c07b9b5f9e7666ebcc9e16ebf8e9d53de85))
### Features
* **getter:** empty msg on catch error ([c8ac4a6](https://github.com/biancoroyal/node-red-contrib-modbus/commit/c8ac4a675ce17ca1992a1018ad113652cd5b97a4))
* **write:** empty msg on fail as the other node ([d6fd30b](https://github.com/biancoroyal/node-red-contrib-modbus/commit/d6fd30b20cf638b824852cad4a66ef42de6a07da))
* new status update concept for nodes with less traffic ([eb2afba](https://github.com/biancoroyal/node-red-contrib-modbus/commit/eb2afbabac913eaa3d017735dc7a11eb9d02d60f))
# [5.8.0](https://github.com/biancoroyal/node-red-contrib-modbus/compare/v5.7.0...v5.8.0) (2020-04-02)
### Features
* keep the whole msg and add data for tcp request answers ([74271d3](https://github.com/biancoroyal/node-red-contrib-modbus/commit/74271d3be55f4719e83e8a044b956be64c20ca57))
* new server write concept via input msg and Uint8 list ([ad485ea](https://github.com/biancoroyal/node-red-contrib-modbus/commit/ad485ea07e1d0be139b32e035344fa043f3b1e99))
# [5.7.0](https://github.com/biancoroyal/node-red-contrib-modbus/compare/v5.4.0...v5.7.0) (2020-04-01)

@@ -182,1 +202,4 @@

# 1.0.0 (2017-01-18)

683

examples/Modbus-HTTP.json
[
{
"id": "902e934.890cb7",
"id": "c0b62dd9.950f9",
"type": "tab",

@@ -10,26 +10,27 @@ "label": "Modbus HTTP",

{
"id": "5618dfe4.3dd0e",
"id": "1c656af3.94d24d",
"type": "modbus-getter",
"z": "902e934.890cb7",
"z": "c0b62dd9.950f9",
"name": "",
"showStatusActivities": false,
"showErrors": false,
"showErrors": true,
"logIOActivities": false,
"unitid": "",
"dataType": "HoldingRegister",
"dataType": "InputRegister",
"adr": "0",
"quantity": "4",
"server": "c5220d90.b900b",
"server": "f9b8ac6a.afd908",
"useIOFile": false,
"ioFile": "",
"useIOForPayload": false,
"x": 410,
"y": 190,
"emptyMsgOnFail": true,
"x": 460,
"y": 180,
"wires": [
[
"f1f278e6.413e",
"b04622ff.e2a0e"
"760a3d8e.21bd24",
"bea2e3c0.7a07b8"
],
[
"a03cc0d0.7b9118"
"d77ee222.693218"
]

@@ -39,5 +40,5 @@ ]

{
"id": "3948fe6a.852a9a",
"id": "f96691bb.0cea4",
"type": "http in",
"z": "902e934.890cb7",
"z": "c0b62dd9.950f9",
"name": "",

@@ -48,7 +49,7 @@ "url": "/modbus/flex/read",

"swaggerDoc": "",
"x": 190,
"y": 340,
"x": 160,
"y": 300,
"wires": [
[
"fa59a119.4e3e88"
"72f77499.748114"
]

@@ -58,5 +59,5 @@ ]

{
"id": "f1f278e6.413e",
"id": "760a3d8e.21bd24",
"type": "debug",
"z": "902e934.890cb7",
"z": "c0b62dd9.950f9",
"name": "",

@@ -68,37 +69,41 @@ "active": true,

"complete": "true",
"x": 770,
"y": 130,
"wires": []
"targetType": "full",
"x": 675,
"y": 160,
"wires": [],
"l": false
},
{
"id": "a03cc0d0.7b9118",
"id": "d77ee222.693218",
"type": "modbus-response",
"z": "902e934.890cb7",
"z": "c0b62dd9.950f9",
"name": "",
"registerShowMax": 20,
"x": 680,
"y": 170,
"wires": []
"x": 675,
"y": 200,
"wires": [],
"l": false
},
{
"id": "fa59a119.4e3e88",
"id": "2ee03cab.ca00d4",
"type": "modbus-flex-getter",
"z": "902e934.890cb7",
"z": "c0b62dd9.950f9",
"name": "",
"showStatusActivities": false,
"showErrors": false,
"showErrors": true,
"logIOActivities": false,
"server": "c5220d90.b900b",
"server": "f9b8ac6a.afd908",
"useIOFile": false,
"ioFile": "",
"useIOForPayload": false,
"x": 430,
"y": 340,
"emptyMsgOnFail": true,
"x": 480,
"y": 300,
"wires": [
[
"843b944a.740ce8",
"534b7417.621544"
"8d4dbfe7.3142b",
"3ab090b.a59f67"
],
[
"39ea504.1e8373"
"67969169.f43b3"
]

@@ -108,15 +113,16 @@ ]

{
"id": "39ea504.1e8373",
"id": "67969169.f43b3",
"type": "modbus-response",
"z": "902e934.890cb7",
"z": "c0b62dd9.950f9",
"name": "",
"registerShowMax": 20,
"x": 670,
"y": 330,
"wires": []
"x": 675,
"y": 340,
"wires": [],
"l": false
},
{
"id": "843b944a.740ce8",
"id": "8d4dbfe7.3142b",
"type": "debug",
"z": "902e934.890cb7",
"z": "c0b62dd9.950f9",
"name": "",

@@ -128,35 +134,12 @@ "active": true,

"complete": "true",
"x": 750,
"y": 290,
"wires": []
"targetType": "full",
"x": 675,
"y": 300,
"wires": [],
"l": false
},
{
"id": "e8f3ea.d02bcc18",
"type": "catch",
"z": "902e934.890cb7",
"name": "",
"scope": null,
"x": 650,
"y": 80,
"wires": [
[
"ab1ddfb6.4bc69"
]
]
},
{
"id": "534b7417.621544",
"type": "http response",
"z": "902e934.890cb7",
"name": "",
"statusCode": "",
"headers": {},
"x": 630,
"y": 290,
"wires": []
},
{
"id": "f0c904e9.661f58",
"id": "8e6dd380.5cc8a8",
"type": "http in",
"z": "902e934.890cb7",
"z": "c0b62dd9.950f9",
"name": "",

@@ -167,7 +150,7 @@ "url": "/modbus/read",

"swaggerDoc": "",
"x": 180,
"y": 190,
"x": 150,
"y": 180,
"wires": [
[
"5618dfe4.3dd0e"
"53a77523.9da744"
]

@@ -177,42 +160,19 @@ ]

{
"id": "b04622ff.e2a0e",
"type": "http response",
"z": "902e934.890cb7",
"name": "",
"statusCode": "",
"headers": {},
"x": 640,
"y": 130,
"wires": []
},
{
"id": "ab1ddfb6.4bc69",
"type": "debug",
"z": "902e934.890cb7",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"x": 800,
"y": 80,
"wires": []
},
{
"id": "7ec241bc.5591b8",
"id": "2ad5b74f.eb36c",
"type": "modbus-flex-write",
"z": "902e934.890cb7",
"z": "c0b62dd9.950f9",
"name": "",
"showStatusActivities": false,
"showErrors": false,
"server": "c5220d90.b900b",
"x": 420,
"y": 530,
"showErrors": true,
"server": "f9b8ac6a.afd908",
"emptyMsgOnFail": true,
"x": 470,
"y": 540,
"wires": [
[
"c1772f12.2323e8"
"4f218709.c704d",
"ec3f0782.94afa8"
],
[
"ab322570.ca9f9"
"7d2b0de9.ae18e4"
]

@@ -222,8 +182,8 @@ ]

{
"id": "ef98fd29.286c2",
"id": "d9cfe3e3.d3b2f",
"type": "modbus-write",
"z": "902e934.890cb7",
"z": "c0b62dd9.950f9",
"name": "",
"showStatusActivities": false,
"showErrors": false,
"showErrors": true,
"unitid": "",

@@ -233,11 +193,13 @@ "dataType": "HoldingRegister",

"quantity": "1",
"server": "c5220d90.b900b",
"x": 410,
"y": 440,
"server": "f9b8ac6a.afd908",
"emptyMsgOnFail": true,
"x": 460,
"y": 420,
"wires": [
[
"b267c9ac.6c24a"
"c94ffa5e.733c38",
"688dd518.b81db4"
],
[
"91d225d4.323e08"
"5c222c40.f8d8cc"
]

@@ -247,5 +209,5 @@ ]

{
"id": "8c24f8f1.076c3",
"id": "4774c80c.8bd24",
"type": "http in",
"z": "902e934.890cb7",
"z": "c0b62dd9.950f9",
"name": "",

@@ -256,7 +218,7 @@ "url": "/modbus/write",

"swaggerDoc": "",
"x": 180,
"y": 440,
"x": 150,
"y": 420,
"wires": [
[
"ef98fd29.286c2"
"eb829548.f1b578"
]

@@ -266,26 +228,16 @@ ]

{
"id": "b267c9ac.6c24a",
"type": "http response",
"z": "902e934.890cb7",
"name": "",
"statusCode": "",
"headers": {},
"x": 640,
"y": 400,
"wires": []
},
{
"id": "91d225d4.323e08",
"id": "5c222c40.f8d8cc",
"type": "modbus-response",
"z": "902e934.890cb7",
"z": "c0b62dd9.950f9",
"name": "",
"registerShowMax": 20,
"x": 680,
"y": 440,
"wires": []
"x": 675,
"y": 480,
"wires": [],
"l": false
},
{
"id": "aaa6cddc.4d4e98",
"id": "f70d8d60.a3fbf8",
"type": "http in",
"z": "902e934.890cb7",
"z": "c0b62dd9.950f9",
"name": "",

@@ -296,7 +248,7 @@ "url": "/modbus/flex/write",

"swaggerDoc": "",
"x": 190,
"y": 530,
"x": 160,
"y": 540,
"wires": [
[
"7ec241bc.5591b8"
"8d1f705c.9bef7"
]

@@ -306,29 +258,19 @@ ]

{
"id": "c1772f12.2323e8",
"type": "http response",
"z": "902e934.890cb7",
"name": "",
"statusCode": "",
"headers": {},
"x": 640,
"y": 490,
"wires": []
},
{
"id": "ab322570.ca9f9",
"id": "7d2b0de9.ae18e4",
"type": "modbus-response",
"z": "902e934.890cb7",
"z": "c0b62dd9.950f9",
"name": "",
"registerShowMax": 20,
"x": 680,
"y": 530,
"wires": []
"x": 675,
"y": 620,
"wires": [],
"l": false
},
{
"id": "63e72729.5c78c",
"id": "d6a910c3.0db218",
"type": "comment",
"z": "902e934.890cb7",
"z": "c0b62dd9.950f9",
"name": "HTTP request GET working examples",
"info": "## Read\n\n### Flex Read\n\nhttp://localhost:1880/modbus/flex/read?value=0&unitid=1&fc=3&address=0&quantity=1\n\nhttp://localhost:1880/modbus/flex/read?value=0&unitid=1&fc=4&address=0&quantity=1\n\nhttp://localhost:1880/modbus/flex/read?value=0&unitid=1&fc=3&address=0&quantity=5\n\nhttp://localhost:1880/modbus/flex/read?value=0&unitid=1&fc=4&address=0&quantity=5\n\n### Read\n\nhttp://localhost:1880/modbus/read\n\n## Write\n\n### Test HTTP without Modbus\n\nhttp://localhost:1880/modbus/flex/write/test?value=[1,2,3,4,5]&unitid=1&fc=16&address=0&quantity=5\n\n\n### Flex Write\n\nhttp://localhost:1880/modbus/flex/write?value=10&unitid=1&fc=6&address=0&quantity=1\n\nhttp://localhost:1880/modbus/flex/write?value=[1,2,3,4,5]&unitid=1&fc=16&address=0&quantity=5\n\n### Write\n\nhttp://localhost:1880/modbus/write\n",
"x": 240,
"x": 210,
"y": 140,

@@ -338,5 +280,5 @@ "wires": []

{
"id": "f1e67858.da17f8",
"id": "4ab62656.012248",
"type": "http in",
"z": "902e934.890cb7",
"z": "c0b62dd9.950f9",
"name": "",

@@ -347,7 +289,7 @@ "url": "/modbus/flex/write/test",

"swaggerDoc": "",
"x": 220,
"y": 620,
"x": 180,
"y": 700,
"wires": [
[
"c483eff.12aaa9"
"c5d0d1aa.df86b"
]

@@ -357,5 +299,5 @@ ]

{
"id": "1948e40b.d0d95c",
"id": "17420af8.7a189d",
"type": "debug",
"z": "902e934.890cb7",
"z": "c0b62dd9.950f9",
"name": "",

@@ -367,10 +309,12 @@ "active": true,

"complete": "true",
"x": 590,
"y": 620,
"wires": []
"targetType": "full",
"x": 675,
"y": 720,
"wires": [],
"l": false
},
{
"id": "c483eff.12aaa9",
"id": "76fbf7b4.dc7508",
"type": "function",
"z": "902e934.890cb7",
"z": "c0b62dd9.950f9",
"name": "",

@@ -380,8 +324,8 @@ "func": "if (msg.payload.value && msg.payload.value.indexOf(',') > -1) {\n msg.payload.value = JSON.parse(msg.payload.value)\n}\n\nif (msg.value && msg.value.indexOf(',') > -1) {\n msg.value = JSON.parse(msg.payload.value)\n}\nreturn msg;",

"noerr": 0,
"x": 450,
"y": 620,
"x": 470,
"y": 700,
"wires": [
[
"1948e40b.d0d95c",
"f8925c0c.04a3d8"
"17420af8.7a189d",
"fcde874a.63069"
]

@@ -391,16 +335,5 @@ ]

{
"id": "f8925c0c.04a3d8",
"type": "http response",
"z": "902e934.890cb7",
"name": "",
"statusCode": "",
"headers": {},
"x": 590,
"y": 660,
"wires": []
},
{
"id": "8155e732.2c79a8",
"id": "d97b7367.ef84d8",
"type": "modbus-flex-server",
"z": "902e934.890cb7",
"z": "c0b62dd9.950f9",
"name": "",

@@ -423,4 +356,4 @@ "logEnabled": false,

"funcSetRegister": "function setFlexRegister(addr, value, unitID) { \n\tif (unitID === node.unitId && \n\t\taddr >= node.minAddress && \n\t\taddr <= node.splitAddress * 2) { \n\n\t\tnode.registers.writeUInt16BE(value, addr * node.bufferFactor) \n\t} \n}",
"showErrors": false,
"x": 200,
"showErrors": true,
"x": 160,
"y": 60,

@@ -431,2 +364,3 @@ "wires": [

[],
[],
[]

@@ -436,5 +370,356 @@ ]

{
"id": "c5220d90.b900b",
"id": "c94ffa5e.733c38",
"type": "debug",
"z": "c0b62dd9.950f9",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"x": 675,
"y": 440,
"wires": [],
"l": false
},
{
"id": "4f218709.c704d",
"type": "debug",
"z": "c0b62dd9.950f9",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"x": 675,
"y": 580,
"wires": [],
"l": false
},
{
"id": "53a77523.9da744",
"type": "function",
"z": "c0b62dd9.950f9",
"name": "",
"func": "delete msg['queueLengthByUnitIdd'];\ndelete msg['messageId'];\ndelete msg['topic'];\ndelete msg['unitId'];\n\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 315,
"y": 180,
"wires": [
[
"1c656af3.94d24d",
"88ba25a0.a9dce"
]
],
"l": false
},
{
"id": "88ba25a0.a9dce",
"type": "debug",
"z": "c0b62dd9.950f9",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"x": 430,
"y": 240,
"wires": []
},
{
"id": "c4de15f2.ddcf9",
"type": "http response",
"z": "c0b62dd9.950f9",
"name": "",
"statusCode": "200",
"headers": {
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Methods": "POST, GET, OPTIONS",
"content-type": "application/json"
},
"x": 900,
"y": 400,
"wires": []
},
{
"id": "be33e61.12fae98",
"type": "catch",
"z": "c0b62dd9.950f9",
"name": "",
"scope": null,
"uncaught": true,
"x": 440,
"y": 60,
"wires": [
[
"2e6e26a0.c0042a",
"a369154a.b5f71"
]
]
},
{
"id": "2e6e26a0.c0042a",
"type": "debug",
"z": "c0b62dd9.950f9",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"x": 595,
"y": 80,
"wires": [],
"l": false
},
{
"id": "5100f802.f3bff8",
"type": "debug",
"z": "c0b62dd9.950f9",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"x": 430,
"y": 360,
"wires": []
},
{
"id": "72f77499.748114",
"type": "function",
"z": "c0b62dd9.950f9",
"name": "",
"func": "delete msg['queueLengthByUnitIdd'];\ndelete msg['messageId'];\ndelete msg['topic'];\ndelete msg['unitId'];\n\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 315,
"y": 300,
"wires": [
[
"5100f802.f3bff8",
"2ee03cab.ca00d4"
]
],
"l": false
},
{
"id": "22f0fe58.49296a",
"type": "debug",
"z": "c0b62dd9.950f9",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"x": 430,
"y": 480,
"wires": []
},
{
"id": "eb829548.f1b578",
"type": "function",
"z": "c0b62dd9.950f9",
"name": "",
"func": "delete msg['queueLengthByUnitIdd'];\ndelete msg['messageId'];\ndelete msg['topic'];\ndelete msg['unitId'];\n\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 315,
"y": 420,
"wires": [
[
"22f0fe58.49296a",
"d9cfe3e3.d3b2f"
]
],
"l": false
},
{
"id": "5436848e.83425c",
"type": "debug",
"z": "c0b62dd9.950f9",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"x": 430,
"y": 600,
"wires": []
},
{
"id": "8d1f705c.9bef7",
"type": "function",
"z": "c0b62dd9.950f9",
"name": "",
"func": "delete msg['queueLengthByUnitIdd'];\ndelete msg['messageId'];\ndelete msg['topic'];\ndelete msg['unitId'];\n\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 315,
"y": 540,
"wires": [
[
"5436848e.83425c",
"2ad5b74f.eb36c"
]
],
"l": false
},
{
"id": "80ec413e.acd828",
"type": "debug",
"z": "c0b62dd9.950f9",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"x": 435,
"y": 740,
"wires": [],
"l": false
},
{
"id": "c5d0d1aa.df86b",
"type": "function",
"z": "c0b62dd9.950f9",
"name": "",
"func": "delete msg['queueLengthByUnitIdd'];\ndelete msg['messageId'];\ndelete msg['topic'];\ndelete msg['unitId'];\n\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 355,
"y": 700,
"wires": [
[
"80ec413e.acd828",
"76fbf7b4.dc7508"
]
],
"l": false
},
{
"id": "a369154a.b5f71",
"type": "function",
"z": "c0b62dd9.950f9",
"name": "",
"func": "if(msg.res) {\n msg.payload.error = msg.error;\n return msg;\n}",
"outputs": 1,
"noerr": 0,
"x": 595,
"y": 40,
"wires": [
[
"d72bb270.87ba88"
]
],
"l": false
},
{
"id": "d72bb270.87ba88",
"type": "link out",
"z": "c0b62dd9.950f9",
"name": "",
"links": [
"9e70e1cd.2d7fb"
],
"x": 675,
"y": 40,
"wires": []
},
{
"id": "9e70e1cd.2d7fb",
"type": "link in",
"z": "c0b62dd9.950f9",
"name": "",
"links": [
"d72bb270.87ba88",
"bea2e3c0.7a07b8",
"3ab090b.a59f67",
"688dd518.b81db4",
"ec3f0782.94afa8",
"fcde874a.63069"
],
"x": 795,
"y": 400,
"wires": [
[
"c4de15f2.ddcf9"
]
]
},
{
"id": "bea2e3c0.7a07b8",
"type": "link out",
"z": "c0b62dd9.950f9",
"name": "",
"links": [
"9e70e1cd.2d7fb"
],
"x": 675,
"y": 120,
"wires": []
},
{
"id": "3ab090b.a59f67",
"type": "link out",
"z": "c0b62dd9.950f9",
"name": "",
"links": [
"9e70e1cd.2d7fb"
],
"x": 675,
"y": 260,
"wires": []
},
{
"id": "688dd518.b81db4",
"type": "link out",
"z": "c0b62dd9.950f9",
"name": "",
"links": [
"9e70e1cd.2d7fb"
],
"x": 675,
"y": 400,
"wires": []
},
{
"id": "ec3f0782.94afa8",
"type": "link out",
"z": "c0b62dd9.950f9",
"name": "",
"links": [
"9e70e1cd.2d7fb"
],
"x": 675,
"y": 540,
"wires": []
},
{
"id": "fcde874a.63069",
"type": "link out",
"z": "c0b62dd9.950f9",
"name": "",
"links": [
"9e70e1cd.2d7fb"
],
"x": 675,
"y": 680,
"wires": []
},
{
"id": "f9b8ac6a.afd908",
"type": "modbus-client",
"z": "902e934.890cb7",
"z": "c0b62dd9.950f9",
"name": "Modbus Flex Server",

@@ -454,7 +739,9 @@ "clienttype": "tcp",

"serialConnectionDelay": "100",
"unit_id": 1,
"commandDelay": 1,
"clientTimeout": 1000,
"reconnectTimeout": 2000
"unit_id": "1",
"commandDelay": "1",
"clientTimeout": "1000",
"reconnectOnTimeout": true,
"reconnectTimeout": "2000",
"parallelUnitIdsAllowed": true
}
]
[
{
"id": "fd2839f5.ec4bb8",
"id": "c88a71c9.688818",
"type": "tab",

@@ -10,3 +10,3 @@ "label": "Modbus Simple Servers",

{
"id": "8d20aae9.512968",
"id": "5b26a23d.a8a06c",
"type": "tab",

@@ -18,5 +18,5 @@ "label": "Modbus Server Reading",

{
"id": "ac510364.795d8",
"id": "7d09e02b.55be3",
"type": "tab",
"label": "Modbus Flex Server Reading",
"label": "Modbus Server Writing",
"disabled": false,

@@ -26,5 +26,5 @@ "info": ""

{
"id": "76bf8772.3da7d",
"id": "f819cc75.23b27",
"type": "tab",
"label": "Modbus Server Writing",
"label": "Modbus Flex Server Reading",
"disabled": false,

@@ -34,3 +34,3 @@ "info": ""

{
"id": "39c7f60e.ee0a4a",
"id": "3f96c5b3.72cd02",
"type": "tab",

@@ -42,3 +42,3 @@ "label": "Modbus Flex Server Writing",

{
"id": "1a6a9eee.5d9ce1",
"id": "a9050e37.a6f618",
"type": "modbus-client",

@@ -50,2 +50,3 @@ "z": "",

"stateLogEnabled": false,
"queueLogEnabled": false,
"tcpHost": "127.0.0.1",

@@ -61,9 +62,11 @@ "tcpPort": "15502",

"serialConnectionDelay": "100",
"unit_id": "1",
"commandDelay": "1",
"clientTimeout": "1000",
"reconnectTimeout": "2000"
"unit_id": 1,
"commandDelay": 1,
"clientTimeout": 1000,
"reconnectOnTimeout": true,
"reconnectTimeout": 2000,
"parallelUnitIdsAllowed": true
},
{
"id": "dc8c863a.cac5d",
"id": "352955bb.be6e6a",
"type": "modbus-client",

@@ -75,2 +78,3 @@ "z": "",

"stateLogEnabled": false,
"queueLogEnabled": false,
"tcpHost": "127.0.0.1",

@@ -89,8 +93,10 @@ "tcpPort": "14502",

"clientTimeout": "1000",
"reconnectTimeout": "2000"
"reconnectOnTimeout": true,
"reconnectTimeout": "2000",
"parallelUnitIdsAllowed": true
},
{
"id": "48d1112b.16e66",
"id": "7dd49c19.29e75c",
"type": "modbus-server",
"z": "fd2839f5.ec4bb8",
"z": "c88a71c9.688818",
"name": "",

@@ -106,3 +112,3 @@ "logEnabled": false,

"discreteBufferSize": "1024",
"showErrors": false,
"showErrors": true,
"x": 360,

@@ -112,12 +118,15 @@ "y": 80,

[
"d36e101b.21b57"
"e4beac85.1d4d78"
],
[
"d36e101b.21b57"
"e4beac85.1d4d78"
],
[
"d36e101b.21b57"
"e4beac85.1d4d78"
],
[
"d36e101b.21b57"
"e4beac85.1d4d78"
],
[
"2534b73c.f4a13"
]

@@ -127,5 +136,5 @@ ]

{
"id": "469fbe81.5d038",
"id": "699046ec.3e1b78",
"type": "inject",
"z": "fd2839f5.ec4bb8",
"z": "c88a71c9.688818",
"name": "",

@@ -138,2 +147,3 @@ "topic": "",

"once": false,
"onceDelay": "",
"x": 180,

@@ -143,3 +153,3 @@ "y": 80,

[
"48d1112b.16e66"
"7dd49c19.29e75c"
]

@@ -149,9 +159,12 @@ ]

{
"id": "d36e101b.21b57",
"id": "e4beac85.1d4d78",
"type": "debug",
"z": "fd2839f5.ec4bb8",
"z": "c88a71c9.688818",
"name": "",
"active": true,
"console": "false",
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"x": 590,

@@ -162,9 +175,12 @@ "y": 80,

{
"id": "ce6542b7.a08f38",
"id": "f25bd8a6.734138",
"type": "debug",
"z": "8d20aae9.512968",
"z": "5b26a23d.a8a06c",
"name": "",
"active": false,
"console": "false",
"complete": "false",
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"x": 610,

@@ -175,9 +191,12 @@ "y": 440,

{
"id": "ba3310a.dc4f9f",
"id": "c0e162d2.6db27",
"type": "debug",
"z": "8d20aae9.512968",
"z": "5b26a23d.a8a06c",
"name": "",
"active": false,
"console": "false",
"complete": "false",
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"x": 710,

@@ -188,5 +207,5 @@ "y": 320,

{
"id": "d6a45ece.ee086",
"id": "f9c3ebf8.f2e6b8",
"type": "modbus-response",
"z": "8d20aae9.512968",
"z": "5b26a23d.a8a06c",
"name": "",

@@ -199,5 +218,5 @@ "registerShowMax": "10",

{
"id": "57074b23.918ad4",
"id": "e0e8e21c.f917b",
"type": "modbus-read",
"z": "8d20aae9.512968",
"z": "5b26a23d.a8a06c",
"name": "Automatic Read FC3",

@@ -212,19 +231,19 @@ "topic": "",

"quantity": "10",
"rate": "10",
"rate": "8",
"rateUnit": "s",
"delayOnStart": false,
"startDelayTime": "",
"server": "dc8c863a.cac5d",
"delayOnStart": true,
"startDelayTime": "2",
"server": "352955bb.be6e6a",
"useIOFile": false,
"ioFile": "",
"useIOForPayload": false,
"x": 170,
"x": 150,
"y": 100,
"wires": [
[
"fbc04ec7.2348f8"
"1d537db5.0353fa"
],
[
"a73c9f52.9d32f8",
"75dc31da.86d828"
"eba31f91.af43a",
"4118dde8.6df054"
]

@@ -234,5 +253,5 @@ ]

{
"id": "a73c9f52.9d32f8",
"id": "eba31f91.af43a",
"type": "modbus-response",
"z": "8d20aae9.512968",
"z": "5b26a23d.a8a06c",
"name": "",

@@ -245,9 +264,12 @@ "registerShowMax": "20",

{
"id": "fbc04ec7.2348f8",
"id": "1d537db5.0353fa",
"type": "debug",
"z": "8d20aae9.512968",
"z": "5b26a23d.a8a06c",
"name": "",
"active": false,
"console": "false",
"complete": "false",
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"x": 450,

@@ -258,5 +280,5 @@ "y": 60,

{
"id": "b250b495.1c5ec",
"id": "a7fbe888.fdf11",
"type": "modbus-response",
"z": "8d20aae9.512968",
"z": "5b26a23d.a8a06c",
"name": "",

@@ -269,5 +291,5 @@ "registerShowMax": "20",

{
"id": "10c2d38f.34c72c",
"id": "e1a56f7c.98a5c8",
"type": "inject",
"z": "8d20aae9.512968",
"z": "5b26a23d.a8a06c",
"name": "Get!",

@@ -279,3 +301,4 @@ "topic": "",

"crontab": "",
"once": false,
"once": true,
"onceDelay": "2",
"x": 130,

@@ -285,3 +308,3 @@ "y": 460,

[
"20b41a1b.4118ae"
"a765793e.a9ac"
]

@@ -291,5 +314,5 @@ ]

{
"id": "17163ede.0b6171",
"id": "7123d832.8f5228",
"type": "inject",
"z": "8d20aae9.512968",
"z": "5b26a23d.a8a06c",
"name": "Get every second",

@@ -299,5 +322,6 @@ "topic": "",

"payloadType": "date",
"repeat": "1",
"repeat": "2",
"crontab": "",
"once": false,
"once": true,
"onceDelay": "2",
"x": 170,

@@ -307,3 +331,3 @@ "y": 340,

[
"c522d208.93afd"
"2ccc10d7.f00728"
]

@@ -313,5 +337,5 @@ ]

{
"id": "d27fed69.22bcb",
"id": "cda168cc.b7a57",
"type": "modbus-response",
"z": "8d20aae9.512968",
"z": "5b26a23d.a8a06c",
"name": "",

@@ -324,5 +348,5 @@ "registerShowMax": "5",

{
"id": "25e05b9d.0e2ce4",
"id": "6293ed5b.e22d6c",
"type": "inject",
"z": "8d20aae9.512968",
"z": "5b26a23d.a8a06c",
"name": "Get flexible!",

@@ -335,2 +359,3 @@ "topic": "",

"once": false,
"onceDelay": "",
"x": 150,

@@ -340,3 +365,3 @@ "y": 220,

[
"105359df.7116f6"
"391d65b9.85b07a"
]

@@ -346,5 +371,5 @@ ]

{
"id": "105359df.7116f6",
"id": "391d65b9.85b07a",
"type": "function",
"z": "8d20aae9.512968",
"z": "5b26a23d.a8a06c",
"name": "Read 0-9 on Unit 1 FC3",

@@ -358,3 +383,3 @@ "func": "msg.payload = { input: msg.payload, 'fc': 3, 'unitid': 1, 'address': 0 , 'quantity': 10 }\nreturn msg;",

[
"499d9b42.4843cc"
"823b8c53.ee14b8"
]

@@ -364,5 +389,5 @@ ]

{
"id": "f91a8f53.35d68",
"id": "21d10a41.4a5d56",
"type": "function",
"z": "8d20aae9.512968",
"z": "5b26a23d.a8a06c",
"name": "Read 10-18 on Unit 1 FC3",

@@ -376,3 +401,3 @@ "func": "msg.payload = { input: msg.payload, 'fc': 3, 'unitid': 1, 'address': 10 , 'quantity': 8 }\nreturn msg;",

[
"499d9b42.4843cc"
"823b8c53.ee14b8"
]

@@ -382,5 +407,5 @@ ]

{
"id": "f9519563.fe2b7",
"id": "c4a87f77.06804",
"type": "inject",
"z": "8d20aae9.512968",
"z": "5b26a23d.a8a06c",
"name": "Get flexible!",

@@ -393,2 +418,3 @@ "topic": "",

"once": false,
"onceDelay": "",
"x": 150,

@@ -398,3 +424,3 @@ "y": 260,

[
"f91a8f53.35d68"
"21d10a41.4a5d56"
]

@@ -404,12 +430,14 @@ ]

{
"id": "499d9b42.4843cc",
"id": "823b8c53.ee14b8",
"type": "modbus-flex-getter",
"z": "8d20aae9.512968",
"z": "5b26a23d.a8a06c",
"name": "",
"showStatusActivities": false,
"showErrors": false,
"server": "dc8c863a.cac5d",
"logIOActivities": false,
"server": "352955bb.be6e6a",
"useIOFile": false,
"ioFile": "",
"useIOForPayload": false,
"emptyMsgOnFail": true,
"x": 740,

@@ -419,7 +447,7 @@ "y": 240,

[
"dfc00629.0630c"
"399af77.a109088"
],
[
"d27fed69.22bcb",
"88c20b3a.153e38"
"cda168cc.b7a57",
"f12542b3.505cf"
]

@@ -429,9 +457,12 @@ ]

{
"id": "febaa8f0.1d3d6",
"id": "ffc9d28b.806998",
"type": "debug",
"z": "8d20aae9.512968",
"z": "5b26a23d.a8a06c",
"name": "",
"active": false,
"console": "false",
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"x": 610,

@@ -442,5 +473,5 @@ "y": 560,

{
"id": "1861ed40.2adfdb",
"id": "52ff3397.1902ac",
"type": "modbus-response",
"z": "8d20aae9.512968",
"z": "5b26a23d.a8a06c",
"name": "",

@@ -453,5 +484,5 @@ "registerShowMax": "20",

{
"id": "8f82c891.95cff8",
"id": "5d569041.3b246",
"type": "inject",
"z": "8d20aae9.512968",
"z": "5b26a23d.a8a06c",
"name": "Get!",

@@ -463,3 +494,4 @@ "topic": "",

"crontab": "",
"once": false,
"once": true,
"onceDelay": "2",
"x": 130,

@@ -469,3 +501,3 @@ "y": 600,

[
"53f5d643.b269e8"
"60c1ec4c.275374"
]

@@ -475,9 +507,12 @@ ]

{
"id": "15e0121c.f5ced6",
"id": "759e0070.059d38",
"type": "debug",
"z": "8d20aae9.512968",
"z": "5b26a23d.a8a06c",
"name": "",
"active": false,
"console": "false",
"complete": "false",
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"x": 610,

@@ -488,5 +523,5 @@ "y": 690,

{
"id": "4dec48d6.60fb28",
"id": "f89ba70c.f95b2",
"type": "modbus-response",
"z": "8d20aae9.512968",
"z": "5b26a23d.a8a06c",
"name": "",

@@ -499,5 +534,5 @@ "registerShowMax": "20",

{
"id": "8853aa36.8859f",
"id": "3c12b070.610f98",
"type": "inject",
"z": "8d20aae9.512968",
"z": "5b26a23d.a8a06c",
"name": "Get!",

@@ -509,3 +544,4 @@ "topic": "",

"crontab": "",
"once": false,
"once": true,
"onceDelay": "2",
"x": 130,

@@ -515,3 +551,3 @@ "y": 720,

[
"3e3e3294.129606"
"54e29432.0aa5cc"
]

@@ -521,8 +557,9 @@ ]

{
"id": "c522d208.93afd",
"id": "2ccc10d7.f00728",
"type": "modbus-getter",
"z": "8d20aae9.512968",
"z": "5b26a23d.a8a06c",
"name": "Half-Automatic Getter FC4",
"showStatusActivities": false,
"showStatusActivities": true,
"showErrors": false,
"logIOActivities": false,
"unitid": "",

@@ -532,14 +569,15 @@ "dataType": "InputRegister",

"quantity": "10",
"server": "dc8c863a.cac5d",
"server": "352955bb.be6e6a",
"useIOFile": false,
"ioFile": "",
"useIOForPayload": false,
"x": 460,
"emptyMsgOnFail": true,
"x": 440,
"y": 340,
"wires": [
[
"ba3310a.dc4f9f"
"c0e162d2.6db27"
],
[
"d6a45ece.ee086"
"f9c3ebf8.f2e6b8"
]

@@ -549,8 +587,9 @@ ]

{
"id": "20b41a1b.4118ae",
"id": "a765793e.a9ac",
"type": "modbus-getter",
"z": "8d20aae9.512968",
"z": "5b26a23d.a8a06c",
"name": "Manual Getter FC3",
"showStatusActivities": false,
"showErrors": false,
"logIOActivities": false,
"unitid": "",

@@ -560,6 +599,7 @@ "dataType": "HoldingRegister",

"quantity": "10",
"server": "dc8c863a.cac5d",
"server": "352955bb.be6e6a",
"useIOFile": false,
"ioFile": "",
"useIOForPayload": false,
"emptyMsgOnFail": true,
"x": 330,

@@ -569,6 +609,6 @@ "y": 460,

[
"ce6542b7.a08f38"
"f25bd8a6.734138"
],
[
"b250b495.1c5ec"
"a7fbe888.fdf11"
]

@@ -578,8 +618,9 @@ ]

{
"id": "53f5d643.b269e8",
"id": "60c1ec4c.275374",
"type": "modbus-getter",
"z": "8d20aae9.512968",
"z": "5b26a23d.a8a06c",
"name": "Manual Getter FC1",
"showStatusActivities": false,
"showErrors": false,
"logIOActivities": false,
"unitid": "",

@@ -589,6 +630,7 @@ "dataType": "Coil",

"quantity": "1",
"server": "dc8c863a.cac5d",
"server": "352955bb.be6e6a",
"useIOFile": false,
"ioFile": "",
"useIOForPayload": false,
"emptyMsgOnFail": true,
"x": 330,

@@ -598,6 +640,6 @@ "y": 600,

[
"febaa8f0.1d3d6"
"ffc9d28b.806998"
],
[
"1861ed40.2adfdb"
"52ff3397.1902ac"
]

@@ -607,8 +649,9 @@ ]

{
"id": "3e3e3294.129606",
"id": "54e29432.0aa5cc",
"type": "modbus-getter",
"z": "8d20aae9.512968",
"z": "5b26a23d.a8a06c",
"name": "Manual Getter FC2",
"showStatusActivities": false,
"showErrors": false,
"logIOActivities": false,
"unitid": "",

@@ -618,6 +661,7 @@ "dataType": "Input",

"quantity": "10",
"server": "dc8c863a.cac5d",
"server": "352955bb.be6e6a",
"useIOFile": false,
"ioFile": "",
"useIOForPayload": false,
"emptyMsgOnFail": true,
"x": 330,

@@ -627,6 +671,6 @@ "y": 720,

[
"15e0121c.f5ced6"
"759e0070.059d38"
],
[
"4dec48d6.60fb28"
"f89ba70c.f95b2"
]

@@ -636,9 +680,10 @@ ]

{
"id": "cabf3281.74204",
"id": "101179f2.207b46",
"type": "modbus-flex-write",
"z": "76bf8772.3da7d",
"z": "7d09e02b.55be3",
"name": "",
"showStatusActivities": false,
"showErrors": false,
"server": "dc8c863a.cac5d",
"server": "352955bb.be6e6a",
"emptyMsgOnFail": true,
"x": 730,

@@ -648,7 +693,7 @@ "y": 300,

[
"61d1c12.ddbaec"
"d5f6943c.f31168"
],
[
"102f4759.a440e9",
"a5314de.8ec743"
"22682227.4cff5e",
"74137990.5ced8"
]

@@ -658,9 +703,10 @@ ]

{
"id": "a49756e7.28f2c8",
"id": "c33ab024.fd8f38",
"type": "modbus-flex-write",
"z": "76bf8772.3da7d",
"z": "7d09e02b.55be3",
"name": "",
"showStatusActivities": false,
"showErrors": false,
"server": "dc8c863a.cac5d",
"showErrors": true,
"server": "352955bb.be6e6a",
"emptyMsgOnFail": true,
"x": 730,

@@ -670,7 +716,7 @@ "y": 140,

[
"626d0209.569d94"
"4f4487c.d2af0f8"
],
[
"19bb16f9.a49a51",
"483e121e.a70694"
"b94da021.2eef68",
"c5a256e9.8a997"
]

@@ -680,5 +726,5 @@ ]

{
"id": "19bb16f9.a49a51",
"id": "b94da021.2eef68",
"type": "modbus-response",
"z": "76bf8772.3da7d",
"z": "7d09e02b.55be3",
"name": "",

@@ -691,5 +737,5 @@ "registerShowMax": 20,

{
"id": "e058bad6.f31e88",
"id": "e2ef7b30.196b5",
"type": "inject",
"z": "76bf8772.3da7d",
"z": "7d09e02b.55be3",
"name": "Write multiple!",

@@ -702,2 +748,3 @@ "topic": "",

"once": false,
"onceDelay": "",
"x": 150,

@@ -707,3 +754,3 @@ "y": 80,

[
"4c73691f.c96e78"
"40f5364e.ac0c2"
]

@@ -713,5 +760,5 @@ ]

{
"id": "4c73691f.c96e78",
"id": "40f5364e.ac0c2",
"type": "function",
"z": "76bf8772.3da7d",
"z": "7d09e02b.55be3",
"name": "Write 0-9 on Unit 1 FC15",

@@ -725,3 +772,3 @@ "func": "msg.payload = { value: msg.payload, 'fc': 15, 'unitid': 1, 'address': 0 , 'quantity': 10 };\nreturn msg;",

[
"a49756e7.28f2c8"
"c33ab024.fd8f38"
]

@@ -731,5 +778,5 @@ ]

{
"id": "e9424897.359ef8",
"id": "c60dd8e2.d29288",
"type": "function",
"z": "76bf8772.3da7d",
"z": "7d09e02b.55be3",
"name": "Write 10-18 on Unit 1 FC15",

@@ -743,3 +790,3 @@ "func": "msg.payload = { value: msg.payload, 'fc': 15, 'unitid': 1, 'address': 10 , 'quantity': 9 };\nreturn msg;",

[
"a49756e7.28f2c8"
"c33ab024.fd8f38"
]

@@ -749,5 +796,5 @@ ]

{
"id": "4bb4a13e.aacf2",
"id": "58b094c3.988e74",
"type": "inject",
"z": "76bf8772.3da7d",
"z": "7d09e02b.55be3",
"name": "Write wrong multiple!",

@@ -760,2 +807,3 @@ "topic": "",

"once": false,
"onceDelay": "",
"x": 180,

@@ -765,3 +813,3 @@ "y": 120,

[
"e9424897.359ef8"
"c60dd8e2.d29288"
]

@@ -771,5 +819,5 @@ ]

{
"id": "102f4759.a440e9",
"id": "22682227.4cff5e",
"type": "modbus-response",
"z": "76bf8772.3da7d",
"z": "7d09e02b.55be3",
"name": "",

@@ -782,5 +830,5 @@ "registerShowMax": 20,

{
"id": "26c71e2b.9c8f12",
"id": "2bd17c1b.842a4c",
"type": "inject",
"z": "76bf8772.3da7d",
"z": "7d09e02b.55be3",
"name": "Write wrong multiple!",

@@ -793,2 +841,3 @@ "topic": "",

"once": false,
"onceDelay": "",
"x": 180,

@@ -798,3 +847,3 @@ "y": 260,

[
"3f86fa3d.a908de"
"1a6a17c2.18d91"
]

@@ -804,5 +853,5 @@ ]

{
"id": "3f86fa3d.a908de",
"id": "1a6a17c2.18d91",
"type": "function",
"z": "76bf8772.3da7d",
"z": "7d09e02b.55be3",
"name": "Write 0-9 on Unit 1 FC16",

@@ -816,3 +865,3 @@ "func": "msg.payload = { value: msg.payload, 'fc': 16, 'unitid': 1, 'address': 0 , 'quantity': 10 };\nreturn msg;",

[
"cabf3281.74204"
"101179f2.207b46"
]

@@ -822,5 +871,5 @@ ]

{
"id": "871c9ab3.e97518",
"id": "f22c680d.2cd4e",
"type": "function",
"z": "76bf8772.3da7d",
"z": "7d09e02b.55be3",
"name": "Write 10 on Unit 1 FC6",

@@ -834,3 +883,3 @@ "func": "msg.payload = { value: msg.payload, 'fc': 6, 'unitid': 1, 'address': 10 , 'quantity': 1 };\nreturn msg;",

[
"cabf3281.74204"
"101179f2.207b46"
]

@@ -840,5 +889,5 @@ ]

{
"id": "2a426ee9.308042",
"id": "ba0b6d46.9d8168",
"type": "inject",
"z": "76bf8772.3da7d",
"z": "7d09e02b.55be3",
"name": "Write single!",

@@ -851,2 +900,3 @@ "topic": "",

"once": false,
"onceDelay": "",
"x": 150,

@@ -856,3 +906,3 @@ "y": 340,

[
"871c9ab3.e97518"
"f22c680d.2cd4e"
]

@@ -862,9 +912,12 @@ ]

{
"id": "61d1c12.ddbaec",
"id": "d5f6943c.f31168",
"type": "debug",
"z": "76bf8772.3da7d",
"z": "7d09e02b.55be3",
"name": "",
"active": false,
"console": "false",
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"x": 950,

@@ -875,5 +928,5 @@ "y": 240,

{
"id": "6246571a.b5e318",
"id": "bb6d29e7.8f04c",
"type": "inject",
"z": "76bf8772.3da7d",
"z": "7d09e02b.55be3",
"name": "Write single!",

@@ -886,2 +939,3 @@ "topic": "",

"once": false,
"onceDelay": "",
"x": 150,

@@ -891,3 +945,3 @@ "y": 200,

[
"578c19f9.e2392"
"c2e47ce8.03bc48"
]

@@ -897,5 +951,5 @@ ]

{
"id": "578c19f9.e2392",
"id": "c2e47ce8.03bc48",
"type": "function",
"z": "76bf8772.3da7d",
"z": "7d09e02b.55be3",
"name": "Write 10 on Unit 1 FC5",

@@ -909,3 +963,3 @@ "func": "msg.payload = { value: msg.payload, 'fc': 5, 'unitid': 1, 'address': 10 , 'quantity': 1 };\nreturn msg;",

[
"a49756e7.28f2c8"
"c33ab024.fd8f38"
]

@@ -915,5 +969,5 @@ ]

{
"id": "830f86c8.27db",
"id": "9c966449.aa6798",
"type": "inject",
"z": "76bf8772.3da7d",
"z": "7d09e02b.55be3",
"name": "Write multiple!",

@@ -926,2 +980,3 @@ "topic": "",

"once": false,
"onceDelay": "",
"x": 150,

@@ -931,3 +986,3 @@ "y": 160,

[
"e9424897.359ef8"
"c60dd8e2.d29288"
]

@@ -937,5 +992,5 @@ ]

{
"id": "2fba6d2f.84e3e2",
"id": "2a2eb89a.eac0b",
"type": "inject",
"z": "76bf8772.3da7d",
"z": "7d09e02b.55be3",
"name": "Write multiple!",

@@ -948,2 +1003,3 @@ "topic": "",

"once": false,
"onceDelay": "",
"x": 150,

@@ -953,3 +1009,3 @@ "y": 300,

[
"3f86fa3d.a908de"
"1a6a17c2.18d91"
]

@@ -959,9 +1015,12 @@ ]

{
"id": "a5314de.8ec743",
"id": "74137990.5ced8",
"type": "debug",
"z": "76bf8772.3da7d",
"z": "7d09e02b.55be3",
"name": "",
"active": false,
"console": "false",
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"x": 950,

@@ -972,9 +1031,12 @@ "y": 280,

{
"id": "626d0209.569d94",
"id": "4f4487c.d2af0f8",
"type": "debug",
"z": "76bf8772.3da7d",
"z": "7d09e02b.55be3",
"name": "",
"active": false,
"console": "false",
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"x": 950,

@@ -985,9 +1047,12 @@ "y": 80,

{
"id": "483e121e.a70694",
"id": "c5a256e9.8a997",
"type": "debug",
"z": "76bf8772.3da7d",
"z": "7d09e02b.55be3",
"name": "",
"active": false,
"console": "false",
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"x": 950,

@@ -998,9 +1063,12 @@ "y": 120,

{
"id": "dfc00629.0630c",
"id": "399af77.a109088",
"type": "debug",
"z": "8d20aae9.512968",
"z": "5b26a23d.a8a06c",
"name": "",
"active": false,
"console": "false",
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"x": 990,

@@ -1011,9 +1079,12 @@ "y": 220,

{
"id": "88c20b3a.153e38",
"id": "f12542b3.505cf",
"type": "debug",
"z": "8d20aae9.512968",
"z": "5b26a23d.a8a06c",
"name": "",
"active": false,
"console": "false",
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"x": 970,

@@ -1024,9 +1095,12 @@ "y": 260,

{
"id": "1672aa1d.dd347e",
"id": "8ffaec31.e2a02",
"type": "debug",
"z": "fd2839f5.ec4bb8",
"z": "c88a71c9.688818",
"name": "",
"active": true,
"console": "false",
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"x": 570,

@@ -1037,5 +1111,5 @@ "y": 180,

{
"id": "18cff55c.42cbeb",
"id": "62981a95.cd186c",
"type": "inject",
"z": "fd2839f5.ec4bb8",
"z": "c88a71c9.688818",
"name": "",

@@ -1048,2 +1122,3 @@ "topic": "",

"once": false,
"onceDelay": "",
"x": 180,

@@ -1053,3 +1128,3 @@ "y": 180,

[
"7007d2a6.6cdc44"
"a56de452.aafbd8"
]

@@ -1059,5 +1134,5 @@ ]

{
"id": "b76297b6.ec5ac",
"id": "eb74a645.8cc998",
"type": "comment",
"z": "76bf8772.3da7d",
"z": "7d09e02b.55be3",
"name": "Modbus Server",

@@ -1070,9 +1145,12 @@ "info": "These nodes are to write to the Modbus Server.",

{
"id": "75dc31da.86d828",
"id": "4118dde8.6df054",
"type": "debug",
"z": "8d20aae9.512968",
"z": "5b26a23d.a8a06c",
"name": "",
"active": false,
"console": "false",
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"x": 430,

@@ -1083,5 +1161,5 @@ "y": 100,

{
"id": "180de34c.0a6925",
"id": "3532c602.c961ba",
"type": "modbus-write",
"z": "76bf8772.3da7d",
"z": "7d09e02b.55be3",
"name": "Write Reset FC5",

@@ -1094,11 +1172,12 @@ "showStatusActivities": false,

"quantity": "1",
"server": "dc8c863a.cac5d",
"x": 320,
"y": 400,
"server": "352955bb.be6e6a",
"emptyMsgOnFail": true,
"x": 720,
"y": 420,
"wires": [
[
"23db990b.d75436"
"8fc3a875.c9f84"
],
[
"b6655efb.283ae"
"e3c3726.265e89"
]

@@ -1108,5 +1187,5 @@ ]

{
"id": "d0f0e8c8.55913",
"id": "f9f646cd.d28fb8",
"type": "inject",
"z": "76bf8772.3da7d",
"z": "7d09e02b.55be3",
"name": "",

@@ -1118,3 +1197,4 @@ "topic": "",

"crontab": "",
"once": false,
"once": true,
"onceDelay": "2",
"x": 131,

@@ -1124,3 +1204,3 @@ "y": 390,

[
"180de34c.0a6925"
"3532c602.c961ba"
]

@@ -1130,27 +1210,30 @@ ]

{
"id": "23db990b.d75436",
"id": "8fc3a875.c9f84",
"type": "debug",
"z": "76bf8772.3da7d",
"z": "7d09e02b.55be3",
"name": "",
"active": false,
"console": "false",
"complete": "false",
"x": 611,
"y": 390,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"x": 950,
"y": 380,
"wires": []
},
{
"id": "b6655efb.283ae",
"id": "e3c3726.265e89",
"type": "modbus-response",
"z": "76bf8772.3da7d",
"z": "7d09e02b.55be3",
"name": "",
"registerShowMax": 20,
"x": 631,
"y": 430,
"x": 990,
"y": 420,
"wires": []
},
{
"id": "16937cf0.68d133",
"id": "43c92684.cce2f",
"type": "inject",
"z": "76bf8772.3da7d",
"z": "7d09e02b.55be3",
"name": "",

@@ -1162,3 +1245,4 @@ "topic": "",

"crontab": "",
"once": false,
"once": true,
"onceDelay": "2",
"x": 131,

@@ -1168,3 +1252,3 @@ "y": 430,

[
"180de34c.0a6925"
"3532c602.c961ba"
]

@@ -1174,5 +1258,5 @@ ]

{
"id": "dd33b983.319fa8",
"id": "a865fbaf.367808",
"type": "comment",
"z": "8d20aae9.512968",
"z": "5b26a23d.a8a06c",
"name": "Modbus Server",

@@ -1185,9 +1269,12 @@ "info": "These nodes are to write to the Modbus Server.",

{
"id": "4f4614f0.f2519c",
"id": "a4b0567c.c9ca18",
"type": "debug",
"z": "ac510364.795d8",
"z": "f819cc75.23b27",
"name": "",
"active": false,
"console": "false",
"complete": "false",
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"x": 630,

@@ -1198,5 +1285,5 @@ "y": 460,

{
"id": "2e9b3861.844f88",
"id": "df7e5ef2.38f65",
"type": "debug",
"z": "ac510364.795d8",
"z": "f819cc75.23b27",
"name": "",

@@ -1211,5 +1298,5 @@ "active": false,

{
"id": "47041b60.28486c",
"id": "fd17a154.42454",
"type": "modbus-response",
"z": "ac510364.795d8",
"z": "f819cc75.23b27",
"name": "",

@@ -1222,9 +1309,10 @@ "registerShowMax": "10",

{
"id": "925b83e.c9b88",
"id": "a62ceb23.ca5f",
"type": "modbus-read",
"z": "ac510364.795d8",
"name": "Automatic Read FC3",
"z": "f819cc75.23b27",
"name": "Automatic Read Flex FC3",
"topic": "",
"showStatusActivities": false,
"showErrors": false,
"showStatusActivities": true,
"logIOActivities": false,
"showErrors": true,
"unitid": "",

@@ -1236,5 +1324,5 @@ "dataType": "HoldingRegister",

"rateUnit": "s",
"delayOnStart": false,
"startDelayTime": "",
"server": "1a6a9eee.5d9ce1",
"delayOnStart": true,
"startDelayTime": "2",
"server": "a9050e37.a6f618",
"useIOFile": false,

@@ -1247,7 +1335,7 @@ "ioFile": "",

[
"4d2ed49b.fbce1c"
"b5b49663.94d3e"
],
[
"317ec8ca.b8148",
"1786bcb9.4d912b"
"ce347a0d.6f9618",
"b2085c61.0f8218"
]

@@ -1257,5 +1345,5 @@ ]

{
"id": "317ec8ca.b8148",
"id": "ce347a0d.6f9618",
"type": "modbus-response",
"z": "ac510364.795d8",
"z": "f819cc75.23b27",
"name": "",

@@ -1268,9 +1356,12 @@ "registerShowMax": "20",

{
"id": "4d2ed49b.fbce1c",
"id": "b5b49663.94d3e",
"type": "debug",
"z": "ac510364.795d8",
"z": "f819cc75.23b27",
"name": "",
"active": false,
"console": "false",
"complete": "false",
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"x": 470,

@@ -1281,5 +1372,5 @@ "y": 80,

{
"id": "a0f35bfe.633158",
"id": "f16ef99a.d686b8",
"type": "modbus-response",
"z": "ac510364.795d8",
"z": "f819cc75.23b27",
"name": "",

@@ -1292,5 +1383,5 @@ "registerShowMax": "20",

{
"id": "c33ffd44.6fdd7",
"id": "6c19f11.23bfb1",
"type": "inject",
"z": "ac510364.795d8",
"z": "f819cc75.23b27",
"name": "Get!",

@@ -1302,3 +1393,4 @@ "topic": "",

"crontab": "",
"once": false,
"once": true,
"onceDelay": "2",
"x": 150,

@@ -1308,3 +1400,3 @@ "y": 480,

[
"435c2e5.8655e5"
"1674f8e1.fdfe8f"
]

@@ -1314,5 +1406,5 @@ ]

{
"id": "21f8b145.284e6e",
"id": "4505efaa.4c38a",
"type": "inject",
"z": "ac510364.795d8",
"z": "f819cc75.23b27",
"name": "Get every second",

@@ -1324,3 +1416,4 @@ "topic": "",

"crontab": "",
"once": false,
"once": true,
"onceDelay": "2",
"x": 190,

@@ -1330,3 +1423,3 @@ "y": 360,

[
"9d7d1ac6.f06528"
"f4193204.e18"
]

@@ -1336,5 +1429,5 @@ ]

{
"id": "fd4d426f.5a4b98",
"id": "b8b9aa5f.a152f",
"type": "modbus-response",
"z": "ac510364.795d8",
"z": "f819cc75.23b27",
"name": "",

@@ -1347,5 +1440,5 @@ "registerShowMax": "5",

{
"id": "3c0c989c.897e28",
"id": "3153c927.8496de",
"type": "inject",
"z": "ac510364.795d8",
"z": "f819cc75.23b27",
"name": "Get flexible!",

@@ -1358,2 +1451,3 @@ "topic": "",

"once": false,
"onceDelay": "",
"x": 170,

@@ -1363,3 +1457,3 @@ "y": 240,

[
"76561a13.6fb414"
"677eb47b.294d54"
]

@@ -1369,5 +1463,5 @@ ]

{
"id": "76561a13.6fb414",
"id": "677eb47b.294d54",
"type": "function",
"z": "ac510364.795d8",
"z": "f819cc75.23b27",
"name": "Read 0-9 on Unit 1 FC3",

@@ -1381,3 +1475,3 @@ "func": "msg.payload = { input: msg.payload, 'fc': 3, 'unitid': 1, 'address': 0 , 'quantity': 10 }\nreturn msg;",

[
"f1389ca0.4d6e7"
"352074dc.bbbb44"
]

@@ -1387,5 +1481,5 @@ ]

{
"id": "c95c4d1d.459038",
"id": "a1aca335.01abe8",
"type": "function",
"z": "ac510364.795d8",
"z": "f819cc75.23b27",
"name": "Read 10-18 on Unit 1 FC3",

@@ -1399,3 +1493,3 @@ "func": "msg.payload = { input: msg.payload, 'fc': 3, 'unitid': 1, 'address': 10 , 'quantity': 8 }\nreturn msg;",

[
"f1389ca0.4d6e7"
"352074dc.bbbb44"
]

@@ -1405,5 +1499,5 @@ ]

{
"id": "6912c89a.b6e5f8",
"id": "7cc2fa48.db70cc",
"type": "inject",
"z": "ac510364.795d8",
"z": "f819cc75.23b27",
"name": "Get flexible!",

@@ -1416,2 +1510,3 @@ "topic": "",

"once": false,
"onceDelay": "",
"x": 170,

@@ -1421,3 +1516,3 @@ "y": 280,

[
"c95c4d1d.459038"
"a1aca335.01abe8"
]

@@ -1427,5 +1522,5 @@ ]

{
"id": "f1389ca0.4d6e7",
"id": "352074dc.bbbb44",
"type": "modbus-flex-getter",
"z": "ac510364.795d8",
"z": "f819cc75.23b27",
"name": "",

@@ -1435,6 +1530,7 @@ "showStatusActivities": false,

"logIOActivities": false,
"server": "1a6a9eee.5d9ce1",
"server": "a9050e37.a6f618",
"useIOFile": false,
"ioFile": "",
"useIOForPayload": false,
"emptyMsgOnFail": true,
"x": 760,

@@ -1444,7 +1540,7 @@ "y": 260,

[
"8c8f24be.a568c8"
"88c7e9bb.184e28"
],
[
"fd4d426f.5a4b98",
"63234de.4866b34"
"b8b9aa5f.a152f",
"d841a49e.2529c8"
]

@@ -1454,9 +1550,12 @@ ]

{
"id": "3e62407a.98e2a8",
"id": "9c71ba37.9be1b",
"type": "debug",
"z": "ac510364.795d8",
"z": "f819cc75.23b27",
"name": "",
"active": false,
"console": "false",
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"x": 630,

@@ -1467,5 +1566,5 @@ "y": 580,

{
"id": "7faef17d.4d9bb8",
"id": "f5aea6f3.3fb8b",
"type": "modbus-response",
"z": "ac510364.795d8",
"z": "f819cc75.23b27",
"name": "",

@@ -1478,5 +1577,5 @@ "registerShowMax": "20",

{
"id": "fe06a2a5.5aba",
"id": "f42e134e.8b7c78",
"type": "inject",
"z": "ac510364.795d8",
"z": "f819cc75.23b27",
"name": "Get!",

@@ -1488,3 +1587,4 @@ "topic": "",

"crontab": "",
"once": false,
"once": true,
"onceDelay": "2",
"x": 150,

@@ -1494,3 +1594,3 @@ "y": 620,

[
"f8042010.fd4028"
"202ae9e5.0aa426"
]

@@ -1500,5 +1600,5 @@ ]

{
"id": "bd2c24e4.2a1f08",
"id": "7c02de95.ae17c",
"type": "debug",
"z": "ac510364.795d8",
"z": "f819cc75.23b27",
"name": "",

@@ -1513,5 +1613,5 @@ "active": false,

{
"id": "62fd58af.77542",
"id": "e0c9d009.3c206",
"type": "modbus-response",
"z": "ac510364.795d8",
"z": "f819cc75.23b27",
"name": "",

@@ -1524,5 +1624,5 @@ "registerShowMax": "20",

{
"id": "18516901.41bd8f",
"id": "da2c72f8.030828",
"type": "inject",
"z": "ac510364.795d8",
"z": "f819cc75.23b27",
"name": "Get!",

@@ -1534,3 +1634,4 @@ "topic": "",

"crontab": "",
"once": false,
"once": true,
"onceDelay": "2",
"x": 150,

@@ -1540,3 +1641,3 @@ "y": 740,

[
"8d80d032.5a9b28"
"971115d3.09e608"
]

@@ -1546,5 +1647,5 @@ ]

{
"id": "9d7d1ac6.f06528",
"id": "f4193204.e18",
"type": "modbus-getter",
"z": "ac510364.795d8",
"z": "f819cc75.23b27",
"name": "Half-Automatic Getter FC4",

@@ -1557,3 +1658,3 @@ "showStatusActivities": false,

"quantity": "10",
"server": "1a6a9eee.5d9ce1",
"server": "a9050e37.a6f618",
"useIOFile": false,

@@ -1566,6 +1667,6 @@ "ioFile": "",

[
"2e9b3861.844f88"
"df7e5ef2.38f65"
],
[
"47041b60.28486c"
"fd17a154.42454"
]

@@ -1575,8 +1676,9 @@ ]

{
"id": "435c2e5.8655e5",
"id": "1674f8e1.fdfe8f",
"type": "modbus-getter",
"z": "ac510364.795d8",
"z": "f819cc75.23b27",
"name": "Manual Getter FC3",
"showStatusActivities": false,
"showErrors": false,
"logIOActivities": false,
"unitid": "",

@@ -1586,6 +1688,7 @@ "dataType": "HoldingRegister",

"quantity": "10",
"server": "1a6a9eee.5d9ce1",
"server": "a9050e37.a6f618",
"useIOFile": false,
"ioFile": "",
"useIOForPayload": false,
"emptyMsgOnFail": true,
"x": 350,

@@ -1595,6 +1698,6 @@ "y": 480,

[
"4f4614f0.f2519c"
"a4b0567c.c9ca18"
],
[
"a0f35bfe.633158"
"f16ef99a.d686b8"
]

@@ -1604,8 +1707,9 @@ ]

{
"id": "f8042010.fd4028",
"id": "202ae9e5.0aa426",
"type": "modbus-getter",
"z": "ac510364.795d8",
"z": "f819cc75.23b27",
"name": "Manual Getter FC1",
"showStatusActivities": false,
"showErrors": false,
"logIOActivities": false,
"unitid": "",

@@ -1615,6 +1719,7 @@ "dataType": "Coil",

"quantity": "1",
"server": "1a6a9eee.5d9ce1",
"server": "a9050e37.a6f618",
"useIOFile": false,
"ioFile": "",
"useIOForPayload": false,
"emptyMsgOnFail": true,
"x": 350,

@@ -1624,6 +1729,6 @@ "y": 620,

[
"3e62407a.98e2a8"
"9c71ba37.9be1b"
],
[
"7faef17d.4d9bb8"
"f5aea6f3.3fb8b"
]

@@ -1633,8 +1738,9 @@ ]

{
"id": "8d80d032.5a9b28",
"id": "971115d3.09e608",
"type": "modbus-getter",
"z": "ac510364.795d8",
"z": "f819cc75.23b27",
"name": "Manual Getter FC2",
"showStatusActivities": false,
"showErrors": false,
"logIOActivities": false,
"unitid": "",

@@ -1644,6 +1750,7 @@ "dataType": "Input",

"quantity": "10",
"server": "1a6a9eee.5d9ce1",
"server": "a9050e37.a6f618",
"useIOFile": false,
"ioFile": "",
"useIOForPayload": false,
"emptyMsgOnFail": true,
"x": 350,

@@ -1653,6 +1760,6 @@ "y": 740,

[
"bd2c24e4.2a1f08"
"7c02de95.ae17c"
],
[
"62fd58af.77542"
"e0c9d009.3c206"
]

@@ -1662,5 +1769,5 @@ ]

{
"id": "8c8f24be.a568c8",
"id": "88c7e9bb.184e28",
"type": "debug",
"z": "ac510364.795d8",
"z": "f819cc75.23b27",
"name": "",

@@ -1675,5 +1782,5 @@ "active": false,

{
"id": "63234de.4866b34",
"id": "d841a49e.2529c8",
"type": "debug",
"z": "ac510364.795d8",
"z": "f819cc75.23b27",
"name": "",

@@ -1688,9 +1795,12 @@ "active": false,

{
"id": "1786bcb9.4d912b",
"id": "b2085c61.0f8218",
"type": "debug",
"z": "ac510364.795d8",
"z": "f819cc75.23b27",
"name": "",
"active": false,
"console": "false",
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"x": 450,

@@ -1701,5 +1811,5 @@ "y": 120,

{
"id": "9f26bc1a.c7b0b8",
"id": "262f08f6.a82fb8",
"type": "comment",
"z": "ac510364.795d8",
"z": "f819cc75.23b27",
"name": "Modbus Flex Server",

@@ -1712,9 +1822,10 @@ "info": "These nodes are to write to the Modbus Flex Server.",

{
"id": "ec38942a.ee573",
"id": "2c0aa5f.9ef9d5a",
"type": "modbus-flex-write",
"z": "39c7f60e.ee0a4a",
"z": "3f96c5b3.72cd02",
"name": "",
"showStatusActivities": false,
"showErrors": false,
"server": "1a6a9eee.5d9ce1",
"server": "a9050e37.a6f618",
"emptyMsgOnFail": true,
"x": 770,

@@ -1724,7 +1835,7 @@ "y": 300,

[
"595f54b3.e02ec4"
"450c068a.c5bd88"
],
[
"efa238c4.2708c8",
"9d658172.28f638"
"265b6a2c.a2c256",
"bc150c1e.72946"
]

@@ -1734,9 +1845,10 @@ ]

{
"id": "399c6da0.a0749a",
"id": "79cfb326.6f93a4",
"type": "modbus-flex-write",
"z": "39c7f60e.ee0a4a",
"z": "3f96c5b3.72cd02",
"name": "",
"showStatusActivities": false,
"showErrors": false,
"server": "1a6a9eee.5d9ce1",
"showErrors": true,
"server": "a9050e37.a6f618",
"emptyMsgOnFail": true,
"x": 770,

@@ -1746,7 +1858,7 @@ "y": 140,

[
"2aeb19a3.89a6c6"
"254f54b4.237a9c"
],
[
"677930e2.7b28e8",
"46f68c45.cf4ed4"
"65130716.4ebcc",
"7887793e.221e5"
]

@@ -1756,5 +1868,5 @@ ]

{
"id": "677930e2.7b28e8",
"id": "65130716.4ebcc",
"type": "modbus-response",
"z": "39c7f60e.ee0a4a",
"z": "3f96c5b3.72cd02",
"name": "",

@@ -1767,5 +1879,5 @@ "registerShowMax": 20,

{
"id": "dca6f004.8aaa08",
"id": "8f31cedb.2ef6e",
"type": "inject",
"z": "39c7f60e.ee0a4a",
"z": "3f96c5b3.72cd02",
"name": "Write multiple!",

@@ -1778,2 +1890,3 @@ "topic": "",

"once": false,
"onceDelay": "",
"x": 190,

@@ -1783,3 +1896,3 @@ "y": 80,

[
"c6d03cb3.5743a"
"7e52fe0a.b0d808"
]

@@ -1789,5 +1902,5 @@ ]

{
"id": "c6d03cb3.5743a",
"id": "7e52fe0a.b0d808",
"type": "function",
"z": "39c7f60e.ee0a4a",
"z": "3f96c5b3.72cd02",
"name": "Write 0-9 on Unit 1 FC15",

@@ -1801,3 +1914,3 @@ "func": "msg.payload = { value: msg.payload, 'fc': 15, 'unitid': 1, 'address': 0 , 'quantity': 10 };\nreturn msg;",

[
"399c6da0.a0749a"
"79cfb326.6f93a4"
]

@@ -1807,5 +1920,5 @@ ]

{
"id": "e6dd89aa.ba334",
"id": "84718058.fd93d",
"type": "function",
"z": "39c7f60e.ee0a4a",
"z": "3f96c5b3.72cd02",
"name": "Write 10-18 on Unit 1 FC15",

@@ -1819,3 +1932,3 @@ "func": "msg.payload = { value: msg.payload, 'fc': 15, 'unitid': 1, 'address': 10 , 'quantity': 9 };\nreturn msg;",

[
"399c6da0.a0749a"
"79cfb326.6f93a4"
]

@@ -1825,5 +1938,5 @@ ]

{
"id": "b8170831.9ed25",
"id": "f8a40860.a906e",
"type": "inject",
"z": "39c7f60e.ee0a4a",
"z": "3f96c5b3.72cd02",
"name": "Write wrong multiple!",

@@ -1836,2 +1949,3 @@ "topic": "",

"once": false,
"onceDelay": "",
"x": 220,

@@ -1841,3 +1955,3 @@ "y": 120,

[
"e6dd89aa.ba334"
"84718058.fd93d"
]

@@ -1847,5 +1961,5 @@ ]

{
"id": "efa238c4.2708c8",
"id": "265b6a2c.a2c256",
"type": "modbus-response",
"z": "39c7f60e.ee0a4a",
"z": "3f96c5b3.72cd02",
"name": "",

@@ -1858,5 +1972,5 @@ "registerShowMax": 20,

{
"id": "4cd334c6.2d8dec",
"id": "7ed5896e.c51ff",
"type": "inject",
"z": "39c7f60e.ee0a4a",
"z": "3f96c5b3.72cd02",
"name": "Write wrong multiple!",

@@ -1869,2 +1983,3 @@ "topic": "",

"once": false,
"onceDelay": "",
"x": 220,

@@ -1874,3 +1989,3 @@ "y": 260,

[
"fdc259f8.05e0e"
"3eefe4d0.f45544"
]

@@ -1880,5 +1995,5 @@ ]

{
"id": "fdc259f8.05e0e",
"id": "3eefe4d0.f45544",
"type": "function",
"z": "39c7f60e.ee0a4a",
"z": "3f96c5b3.72cd02",
"name": "Write 0-9 on Unit 1 FC16",

@@ -1892,3 +2007,3 @@ "func": "msg.payload = { value: msg.payload, 'fc': 16, 'unitid': 1, 'address': 0 , 'quantity': 10 };\nreturn msg;",

[
"ec38942a.ee573"
"2c0aa5f.9ef9d5a"
]

@@ -1898,5 +2013,5 @@ ]

{
"id": "536334c0.f1a05c",
"id": "88c32a01.71c17",
"type": "function",
"z": "39c7f60e.ee0a4a",
"z": "3f96c5b3.72cd02",
"name": "Write 10 on Unit 1 FC6",

@@ -1910,3 +2025,3 @@ "func": "msg.payload = { value: msg.payload, 'fc': 6, 'unitid': 1, 'address': 10 , 'quantity': 1 };\nreturn msg;",

[
"ec38942a.ee573"
"2c0aa5f.9ef9d5a"
]

@@ -1916,5 +2031,5 @@ ]

{
"id": "4f880fc7.eebfc8",
"id": "cf2c6eae.078bd8",
"type": "inject",
"z": "39c7f60e.ee0a4a",
"z": "3f96c5b3.72cd02",
"name": "Write single!",

@@ -1927,2 +2042,3 @@ "topic": "",

"once": false,
"onceDelay": "",
"x": 190,

@@ -1932,3 +2048,3 @@ "y": 340,

[
"536334c0.f1a05c"
"88c32a01.71c17"
]

@@ -1938,9 +2054,12 @@ ]

{
"id": "595f54b3.e02ec4",
"id": "450c068a.c5bd88",
"type": "debug",
"z": "39c7f60e.ee0a4a",
"z": "3f96c5b3.72cd02",
"name": "",
"active": false,
"console": "false",
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"x": 990,

@@ -1951,5 +2070,5 @@ "y": 240,

{
"id": "ee707845.3a6b58",
"id": "ceff98ed.ceb478",
"type": "inject",
"z": "39c7f60e.ee0a4a",
"z": "3f96c5b3.72cd02",
"name": "Write single!",

@@ -1962,2 +2081,3 @@ "topic": "",

"once": false,
"onceDelay": "",
"x": 190,

@@ -1967,3 +2087,3 @@ "y": 200,

[
"f8cd809f.ebccf"
"bf1652af.654dc"
]

@@ -1973,5 +2093,5 @@ ]

{
"id": "f8cd809f.ebccf",
"id": "bf1652af.654dc",
"type": "function",
"z": "39c7f60e.ee0a4a",
"z": "3f96c5b3.72cd02",
"name": "Write 10 on Unit 1 FC5",

@@ -1985,3 +2105,3 @@ "func": "msg.payload = { value: msg.payload, 'fc': 5, 'unitid': 1, 'address': 10 , 'quantity': 1 };\nreturn msg;",

[
"399c6da0.a0749a"
"79cfb326.6f93a4"
]

@@ -1991,5 +2111,5 @@ ]

{
"id": "3438508c.c5e28",
"id": "759e3ebb.1b4b68",
"type": "inject",
"z": "39c7f60e.ee0a4a",
"z": "3f96c5b3.72cd02",
"name": "Write multiple!",

@@ -2002,2 +2122,3 @@ "topic": "",

"once": false,
"onceDelay": "",
"x": 190,

@@ -2007,3 +2128,3 @@ "y": 160,

[
"e6dd89aa.ba334"
"84718058.fd93d"
]

@@ -2013,5 +2134,5 @@ ]

{
"id": "c714d3d.792ceb",
"id": "6d9a0452.a42ffc",
"type": "inject",
"z": "39c7f60e.ee0a4a",
"z": "3f96c5b3.72cd02",
"name": "Write multiple!",

@@ -2024,2 +2145,3 @@ "topic": "",

"once": false,
"onceDelay": "",
"x": 190,

@@ -2029,3 +2151,3 @@ "y": 300,

[
"fdc259f8.05e0e"
"3eefe4d0.f45544"
]

@@ -2035,9 +2157,12 @@ ]

{
"id": "9d658172.28f638",
"id": "bc150c1e.72946",
"type": "debug",
"z": "39c7f60e.ee0a4a",
"z": "3f96c5b3.72cd02",
"name": "",
"active": false,
"console": "false",
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"x": 990,

@@ -2048,9 +2173,12 @@ "y": 280,

{
"id": "2aeb19a3.89a6c6",
"id": "254f54b4.237a9c",
"type": "debug",
"z": "39c7f60e.ee0a4a",
"z": "3f96c5b3.72cd02",
"name": "",
"active": false,
"console": "false",
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"x": 990,

@@ -2061,9 +2189,12 @@ "y": 80,

{
"id": "46f68c45.cf4ed4",
"id": "7887793e.221e5",
"type": "debug",
"z": "39c7f60e.ee0a4a",
"z": "3f96c5b3.72cd02",
"name": "",
"active": false,
"console": "false",
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"x": 990,

@@ -2074,5 +2205,5 @@ "y": 120,

{
"id": "ee69e4d0.8296b",
"id": "e78016f7.901f18",
"type": "comment",
"z": "39c7f60e.ee0a4a",
"z": "3f96c5b3.72cd02",
"name": "Modbus Flex Server",

@@ -2085,5 +2216,5 @@ "info": "These nodes are to write to the Modbus Flex Server.",

{
"id": "86b22e7b.31ca88",
"id": "1057e396.82fb74",
"type": "modbus-write",
"z": "39c7f60e.ee0a4a",
"z": "3f96c5b3.72cd02",
"name": "Write Reset FC5",

@@ -2096,11 +2227,12 @@ "showStatusActivities": false,

"quantity": "1",
"server": "1a6a9eee.5d9ce1",
"x": 360,
"y": 400,
"server": "a9050e37.a6f618",
"emptyMsgOnFail": true,
"x": 760,
"y": 420,
"wires": [
[
"5a499cb1.798574"
"8a33cbd3.d5bdf"
],
[
"d56c7f74.9a9328"
"57244dc.1164d34"
]

@@ -2110,5 +2242,5 @@ ]

{
"id": "20e63f38.7cc888",
"id": "ae0523d0.f086",
"type": "inject",
"z": "39c7f60e.ee0a4a",
"z": "3f96c5b3.72cd02",
"name": "",

@@ -2120,3 +2252,4 @@ "topic": "",

"crontab": "",
"once": false,
"once": true,
"onceDelay": "2",
"x": 171,

@@ -2126,3 +2259,3 @@ "y": 390,

[
"86b22e7b.31ca88"
"1057e396.82fb74"
]

@@ -2132,27 +2265,30 @@ ]

{
"id": "5a499cb1.798574",
"id": "8a33cbd3.d5bdf",
"type": "debug",
"z": "39c7f60e.ee0a4a",
"z": "3f96c5b3.72cd02",
"name": "",
"active": false,
"console": "false",
"complete": "false",
"x": 651,
"y": 390,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"x": 990,
"y": 400,
"wires": []
},
{
"id": "d56c7f74.9a9328",
"id": "57244dc.1164d34",
"type": "modbus-response",
"z": "39c7f60e.ee0a4a",
"z": "3f96c5b3.72cd02",
"name": "",
"registerShowMax": 20,
"x": 671,
"y": 430,
"x": 1030,
"y": 440,
"wires": []
},
{
"id": "d2093406.092c38",
"id": "a4158073.da8558",
"type": "inject",
"z": "39c7f60e.ee0a4a",
"z": "3f96c5b3.72cd02",
"name": "",

@@ -2164,3 +2300,4 @@ "topic": "",

"crontab": "",
"once": false,
"once": true,
"onceDelay": "2",
"x": 171,

@@ -2170,3 +2307,3 @@ "y": 430,

[
"86b22e7b.31ca88"
"1057e396.82fb74"
]

@@ -2176,23 +2313,24 @@ ]

{
"id": "b7d781c2.77c85",
"id": "2bc1708e.a8539",
"type": "comment",
"z": "fd2839f5.ec4bb8",
"z": "c88a71c9.688818",
"name": "Information",
"info": "The Modbus Server and Modbus Flex Server \nworking with all reading and writing nodes.\n\nThese are two different servers \nfrom different libraries.\n\nThe simple examples hold \nthe same functions for both servers.\n",
"x": 820,
"y": 120,
"x": 810,
"y": 200,
"wires": []
},
{
"id": "e0603783.298dc8",
"id": "cfad602f.fa69c8",
"type": "catch",
"z": "8d20aae9.512968",
"z": "5b26a23d.a8a06c",
"name": "",
"scope": null,
"uncaught": false,
"x": 720,
"y": 100,
"y": 80,
"wires": [
[
"862d9ee9.558c68",
"23dd0a66.5ad49e"
"e0901843.1a8d4",
"9bd0a01b.f370a8"
]

@@ -2202,9 +2340,12 @@ ]

{
"id": "862d9ee9.558c68",
"id": "e0901843.1a8d4",
"type": "debug",
"z": "8d20aae9.512968",
"z": "5b26a23d.a8a06c",
"name": "",
"active": true,
"console": "false",
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"x": 910,

@@ -2215,5 +2356,5 @@ "y": 140,

{
"id": "e7da4ee4.a60bc",
"id": "387fc05e.ba7838",
"type": "modbus-queue-info",
"z": "8d20aae9.512968",
"z": "5b26a23d.a8a06c",
"name": "Server Client Queue",

@@ -2227,4 +2368,6 @@ "topic": "",

"highHighLevel": 300,
"server": "dc8c863a.cac5d",
"server": "352955bb.be6e6a",
"errorOnHighLevel": false,
"showStatusActivities": true,
"updateOnAllQueueChanges": false,
"x": 1400,

@@ -2234,3 +2377,3 @@ "y": 80,

[
"d8d2d82a.180758"
"6e288031.0f3bb"
]

@@ -2240,5 +2383,5 @@ ]

{
"id": "eb651561.df51e8",
"id": "c3fc62a4.0522f8",
"type": "function",
"z": "8d20aae9.512968",
"z": "5b26a23d.a8a06c",
"name": "reset on High",

@@ -2252,3 +2395,3 @@ "func": "if(\"high level reached\" === msg.state) {\n msg.resetQueue = true;\n}\nreturn msg;",

[
"e7da4ee4.a60bc"
"387fc05e.ba7838"
]

@@ -2258,5 +2401,5 @@ ]

{
"id": "739e0e7f.30695",
"id": "dd790617.d9a738",
"type": "function",
"z": "8d20aae9.512968",
"z": "5b26a23d.a8a06c",
"name": "reset on HighHigh",

@@ -2270,3 +2413,3 @@ "func": "if(\"high high level reached\" === msg.state) {\n msg.resetQueue = true;\n}\nreturn msg;",

[
"e7da4ee4.a60bc"
"387fc05e.ba7838"
]

@@ -2276,9 +2419,12 @@ ]

{
"id": "d8d2d82a.180758",
"id": "6e288031.0f3bb",
"type": "debug",
"z": "8d20aae9.512968",
"z": "5b26a23d.a8a06c",
"name": "",
"active": false,
"console": "false",
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"x": 1590,

@@ -2289,5 +2435,5 @@ "y": 80,

{
"id": "23dd0a66.5ad49e",
"id": "9bd0a01b.f370a8",
"type": "switch",
"z": "8d20aae9.512968",
"z": "5b26a23d.a8a06c",
"name": "Modbus Server",

@@ -2309,4 +2455,4 @@ "property": "modbusClientName",

[
"eb651561.df51e8",
"739e0e7f.30695"
"c3fc62a4.0522f8",
"dd790617.d9a738"
]

@@ -2316,13 +2462,13 @@ ]

{
"id": "30415b15.b23fcc",
"id": "7c7d3fc.7ad87c",
"type": "catch",
"z": "ac510364.795d8",
"z": "f819cc75.23b27",
"name": "",
"scope": null,
"x": 800,
"x": 780,
"y": 100,
"wires": [
[
"fb822d40.414198",
"65b99b84.1ca8e4"
"5e2abeb6.a4fe7",
"8391d6ea.0f47f8"
]

@@ -2332,5 +2478,5 @@ ]

{
"id": "fb822d40.414198",
"id": "5e2abeb6.a4fe7",
"type": "debug",
"z": "ac510364.795d8",
"z": "f819cc75.23b27",
"name": "",

@@ -2345,5 +2491,5 @@ "active": true,

{
"id": "41cad3bf.7485ac",
"id": "5691f88a.317158",
"type": "modbus-queue-info",
"z": "ac510364.795d8",
"z": "f819cc75.23b27",
"name": "Flex Server Client Queue",

@@ -2357,4 +2503,6 @@ "topic": "",

"highHighLevel": 300,
"server": "1a6a9eee.5d9ce1",
"server": "a9050e37.a6f618",
"errorOnHighLevel": false,
"showStatusActivities": false,
"updateOnAllQueueChanges": false,
"x": 1490,

@@ -2364,3 +2512,3 @@ "y": 120,

[
"9d47f9d5.89012"
"60d284e5.b74a04"
]

@@ -2370,5 +2518,5 @@ ]

{
"id": "281b9601.91270a",
"id": "53ad109f.dbb948",
"type": "function",
"z": "ac510364.795d8",
"z": "f819cc75.23b27",
"name": "reset on High",

@@ -2382,3 +2530,3 @@ "func": "if(\"high level reached\" === msg.state) {\n msg.resetQueue = true;\n}\nreturn msg;",

[
"41cad3bf.7485ac"
"5691f88a.317158"
]

@@ -2388,5 +2536,5 @@ ]

{
"id": "c68c5715.d6c",
"id": "62c07aee.525b04",
"type": "function",
"z": "ac510364.795d8",
"z": "f819cc75.23b27",
"name": "reset on HighHigh",

@@ -2400,3 +2548,3 @@ "func": "if(\"high high level reached\" === msg.state) {\n msg.resetQueue = true;\n}\nreturn msg;",

[
"41cad3bf.7485ac"
"5691f88a.317158"
]

@@ -2406,5 +2554,5 @@ ]

{
"id": "9d47f9d5.89012",
"id": "60d284e5.b74a04",
"type": "debug",
"z": "ac510364.795d8",
"z": "f819cc75.23b27",
"name": "",

@@ -2419,5 +2567,5 @@ "active": false,

{
"id": "65b99b84.1ca8e4",
"id": "8391d6ea.0f47f8",
"type": "switch",
"z": "ac510364.795d8",
"z": "f819cc75.23b27",
"name": "Modbus Flex Server",

@@ -2439,4 +2587,4 @@ "property": "modbusClientName",

[
"c68c5715.d6c",
"281b9601.91270a"
"62c07aee.525b04",
"53ad109f.dbb948"
]

@@ -2446,5 +2594,5 @@ ]

{
"id": "7007d2a6.6cdc44",
"id": "a56de452.aafbd8",
"type": "modbus-flex-server",
"z": "fd2839f5.ec4bb8",
"z": "c88a71c9.688818",
"name": "",

@@ -2467,3 +2615,3 @@ "logEnabled": false,

"funcSetRegister": "function setFlexRegister(addr, value, unitID) { \n\tif (unitID === node.unitId && \n\t\taddr >= node.minAddress && \n\t\taddr <= node.splitAddress * 2) { \n\n\t\tnode.registers.writeUInt16BE(value, addr * node.bufferFactor) \n\t} \n}",
"showErrors": false,
"showErrors": true,
"x": 380,

@@ -2473,15 +2621,48 @@ "y": 180,

[
"1672aa1d.dd347e"
"8ffaec31.e2a02"
],
[
"1672aa1d.dd347e"
"8ffaec31.e2a02"
],
[
"1672aa1d.dd347e"
"8ffaec31.e2a02"
],
[
"1672aa1d.dd347e"
"8ffaec31.e2a02"
],
[
"afb69812.fc4d68"
]
]
},
{
"id": "afb69812.fc4d68",
"type": "debug",
"z": "c88a71c9.688818",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"x": 570,
"y": 220,
"wires": []
},
{
"id": "2534b73c.f4a13",
"type": "debug",
"z": "c88a71c9.688818",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"x": 590,
"y": 120,
"wires": []
}
]

@@ -1,2 +0,2 @@

"use strict";require("source-map-support").install();var de=de||{biancoroyal:{modbus:{io:{core:{}}}}};de.biancoroyal.modbus.io.core.internalDebug=de.biancoroyal.modbus.io.core.internalDebug||require("debug")("contribModbus:io:core"),de.biancoroyal.modbus.io.core.LineByLineReader=de.biancoroyal.modbus.io.core.LineByLineReader||require("line-by-line"),de.biancoroyal.modbus.io.core.core=de.biancoroyal.modbus.io.core.core||require("./modbus-core"),de.biancoroyal.modbus.io.core.nameValuesFromIOFile=function(r,e,a,s,t){var i=[],d=de.biancoroyal.modbus.io.core;return r.ioFile&&r.ioFile.configData&&r.ioFile.configData.forEach(function(e){e.valueAddress&&e.valueAddress.startsWith("%I")&&i.push(d.buildInputAddressMapping("MB-INPUTS",e,Number(r.ioFile.addressOffset),Number(t),r.logIOActivities)),e.valueAddress&&e.valueAddress.startsWith("%Q")&&i.push(d.buildOutputAddressMapping("MB-OUTPUTS",e,Number(r.ioFile.addressOffset),Number(t),r.logIOActivities))}),i=d.insertValues(i,a,r.logIOActivities),d.convertValuesByType(i,a,s,r.logIOActivities)},de.biancoroyal.modbus.io.core.allValueNamesFromIOFile=function(r){var a=[],s=de.biancoroyal.modbus.io.core;return r&&r.configData&&r.configData.forEach(function(e){e.valueAddress&&e.valueAddress.startsWith("%I")&&a.push(s.buildInputAddressMapping("MB-INPUTS",e,Number(r.addressOffset),0)),e.valueAddress&&e.valueAddress.startsWith("%Q")&&a.push(s.buildOutputAddressMapping("MB-OUTPUTS",e,Number(r.addressOffset),0))}),a},de.biancoroyal.modbus.io.core.getDataTypeFromFirstCharType=function(e){switch(e){case"w":return"Word";case"d":return"Double";case"r":return"Real";case"f":return"Float";case"i":return"Integer";case"l":return"Long";case"b":return"Boolean";default:return"Unsigned Integer"}},de.biancoroyal.modbus.io.core.buildInputAddressMapping=function(e,r,a,s,t){var i=de.biancoroyal.modbus.io.core,d=0,u=0,o=0,n=0,l=null,b=r.name.substring(0,1),c=r.valueAddress.substring(2,3),m=r.valueAddress.substring(0,3);switch(b){case"w":case"u":d=Number(r.valueAddress.split(m)[1]),o=1,n=16;break;case"i":d=Number(r.valueAddress.split(m)[1]),n="W"===c?(o=1,16):(o=2,32);break;case"r":case"f":d=Number(r.valueAddress.split(m)[1]),o=2,n=32;break;case"d":d=Number(r.valueAddress.split(m)[1]),o=4,n=64;break;case"l":d=Number(r.valueAddress.split(m)[1]),o=5,n=80;break;case"b":"X"===c&&(l=r.valueAddress.split("%IX")[1].split("."),d=Math.floor(Number(l[0])/2),u=8*Number(l[0])+Number(l[1]),n=o=1);break;default:t&&i.internalDebug("unknown input type "+b),n=0}if(n){var p=d-(Number(a)||0);return{register:e,name:r.name,addressStart:d,addressOffset:o,addressOffsetIO:Number(a)||0,addressStartIO:p,registerAddress:p-Number(s),coilStart:u,bitAddress:l,Bit:l?8*Number(l[0])+Number(l[1]):0,bits:n,dataType:i.getDataTypeFromFirstCharType(b),type:"input"}}return{name:r.name,type:b,mapping:r,error:"variable name does not match input mapping"}},de.biancoroyal.modbus.io.core.buildOutputAddressMapping=function(e,r,a,s,t){var i=de.biancoroyal.modbus.io.core,d=0,u=0,o=0,n=0,l=null,b=r.name.substring(0,1),c=r.valueAddress.substring(2,3),m=r.valueAddress.substring(0,3);switch(b){case"w":case"u":d=Number(r.valueAddress.split(m)[1]),o=1,n=16;break;case"i":d=Number(r.valueAddress.split(m)[1]),n="W"===c?(o=1,16):(o=2,32);break;case"r":case"f":d=Number(r.valueAddress.split(m)[1]),o=2,n=32;break;case"d":d=Number(r.valueAddress.split(m)[1]),o=4,n=64;break;case"l":d=Number(r.valueAddress.split(m)[1]),o=5,n=80;break;case"b":"X"===c&&(l=r.valueAddress.split("%QX")[1].split("."),d=Math.floor(Number(l[0])/2),u=8*Number(l[0])+Number(l[1]),n=o=1);break;default:t&&i.internalDebug("unknown output type "+b),n=0}if(n){var p=d-(Number(a)||0);return{register:e,name:r.name,addressStart:d,addressOffset:o,addressOffsetIO:Number(a)||0,addressStartIO:p,registerAddress:p-Number(s),coilStart:u,bitAddress:l,Bit:l?8*Number(l[0])+Number(l[1]):0,bits:n,dataType:i.getDataTypeFromFirstCharType(b),type:"output"}}return{name:r.name,type:b,mapping:r,error:"variable name does not match output mapping"}},de.biancoroyal.modbus.io.core.insertValues=function(e,r,a){var s=de.biancoroyal.modbus.io.core,t=0;for(t in e){var i=e[t];if(!i||!Object.prototype.hasOwnProperty.call(i,"registerAddress")||i.registerAddress<0)a&&s.internalDebug("Item Not Valid To Insert Value "+JSON.stringify(i));else{if(de.biancoroyal.modbus.io.core.isRegisterSizeWrong(r,i.registerAddress,Number(i.bits))){a&&s.internalDebug("Insert Value Register Reached At Address-Start-IO:"+i.registerAddress+" Bits:"+Number(i.bits));break}switch(Number(i.bits)){case 1:i.value=!!(r[i.registerAddress]&Math.pow(i.bitAddress[1],2));break;case 16:i.value=r[i.registerAddress];break;case 32:i.value=r[i.registerAddress+1]<<16|r[i.registerAddress];break;case 64:i.value=r[i.registerAddress+3]<<48|r[i.registerAddress+2]<<32|r[i.registerAddress+1]<<16|r[i.registerAddress];break;case 80:i.value=r[i.registerAddress+4]<<64|r[i.registerAddress+3]<<48|r[i.registerAddress+2]<<32|r[i.registerAddress+1]<<16|r[i.registerAddress];break;default:i.value=null}}}return e},de.biancoroyal.modbus.io.core.getValueFromBufferByDataType=function(e,r,a,s){var t=de.biancoroyal.modbus.io.core,i=a.length/2;if(r<0||r>a.length)return s&&(t.internalDebug("Wrong Buffer Access Parameter Type:"+e.dataType+" Register-Length: "+i+" Buffer-Length:"+a.length+" Address-Buffer-Offset:"+r),t.internalDebug(JSON.stringify(e))),e;switch(s&&t.internalDebug("Get Value From Buffer By Data Type:"+e.dataType+" Register:"+e.registerAddress+" Bits:"+Number(e.bits)),e.dataType){case"Boolean":e.value=!!(a.readUInt16BE(r)&Math.pow(e.bitAddress[1],2));break;case"Word":switch(e.bits){case"8":e.value=a.readInt8(r);break;default:e.value=a.readInt16BE(r),e.convertedValue=!1}break;case"Integer":switch(e.bits){case"8":e.value=a.readInt8(r);break;case"32":e.value=a.readInt32BE(r);break;case"64":e.value=a.readIntBE(r,8);break;default:e.value=a.readInt16BE(r)}break;case"Real":case"Float":e.value=a.readFloatBE(r,4);break;case"Double":e.value=a.readDoubleBE(r,8);break;case"Long":e.value=a.readDoubleBE(r,10);break;default:switch(e.bits){case"8":e.value=a.readUInt8(r);break;case"32":e.value=a.readUInt32BE(r);break;case"64":e.value=a.readUIntBE(r,8);break;default:e.value=a.readUInt16BE(r),e.convertedValue=!1}}return e},de.biancoroyal.modbus.io.core.convertValuesByType=function(e,r,a,s){var t=de.biancoroyal.modbus.io.core,i=0,d=0;for(d in e){var u=e[d];if(u&&Object.prototype.hasOwnProperty.call(u,"dataType")&&Object.prototype.hasOwnProperty.call(u,"registerAddress")&&!(u.registerAddress<0)){if(de.biancoroyal.modbus.io.core.isRegisterSizeWrong(r,u.registerAddress,Number(u.bits))){s&&t.internalDebug("Insert Value Register Reached At Address-Start-IO:"+u.registerAddress+" Bits:"+Number(u.bits));break}if(!(a.buffer instanceof Buffer)){s&&t.internalDebug("Response Buffer Is Not A Buffer");break}i=2*Number(u.registerAddress);try{u=t.getValueFromBufferByDataType(u,i,a.buffer,s)}catch(e){t.internalDebug(e.message)}}else s&&t.internalDebug("Item Not Valid To Convert "+JSON.stringify(u))}return e},de.biancoroyal.modbus.io.core.filterValueNames=function(e,r,a,s,t){if(!r.length||!r.filter)return r;var i=de.biancoroyal.modbus.io.core,d="input";2!==a&&4!==a||(d="output");var u=s,o=Number(s)+Number(t)-1;return e.logIOActivities&&i.internalDebug("adr:"+s+" quantity:"+t+" startRegister:"+u+" endRegister:"+o+" functionType:"+d),r.filter(function(e){return 0<=e.registerAddress&&e.addressStartIO>=u&&e.addressStartIO<=o&&e.type===d})},de.biancoroyal.modbus.io.core.isRegisterSizeWrong=function(e,r,a){var s=Number(a)||16,t=Number(r),i=t;return 16<s&&(i=t+s/16-1),t<0||e.length<t||i>e.length},de.biancoroyal.modbus.io.core.buildMessageWithIO=function(e,r,a,s){var t=this.core.getOriginalMessage(e.bufferMessageList,s);t.payload=r,t.topic=s.topic,t.responseBuffer=a,t.input=s;var i=Object.assign({},t);if(i.payload=a,i.values=r,delete i.responseBuffer,e.useIOFile&&e.ioFile.lastUpdatedAt){var d=this.nameValuesFromIOFile(e,s,r,a,parseInt(s.payload.address)||0),u=this.filterValueNames(e,d,parseInt(s.payload.fc)||3,parseInt(s.payload.address)||0,parseInt(s.payload.quantity)||1,e.logIOActivities);return e.useIOForPayload?(t.payload=u,t.values=r):(t.payload=r,t.valueNames=u),i.valueNames=u,[t,i]}return[t,i]},module.exports=de.biancoroyal.modbus.io.core;
"use strict";require("source-map-support").install();var de=de||{biancoroyal:{modbus:{io:{core:{}}}}};de.biancoroyal.modbus.io.core.internalDebug=de.biancoroyal.modbus.io.core.internalDebug||require("debug")("contribModbus:io:core"),de.biancoroyal.modbus.io.core.LineByLineReader=de.biancoroyal.modbus.io.core.LineByLineReader||require("line-by-line"),de.biancoroyal.modbus.io.core.core=de.biancoroyal.modbus.io.core.core||require("./modbus-core"),de.biancoroyal.modbus.io.core.nameValuesFromIOFile=function(r,e,a,s,t){var i=[],d=de.biancoroyal.modbus.io.core;return r.ioFile&&r.ioFile.configData&&r.ioFile.configData.forEach(function(e){e.valueAddress&&e.valueAddress.startsWith("%I")&&i.push(d.buildInputAddressMapping("MB-INPUTS",e,Number(r.ioFile.addressOffset),Number(t),r.logIOActivities)),e.valueAddress&&e.valueAddress.startsWith("%Q")&&i.push(d.buildOutputAddressMapping("MB-OUTPUTS",e,Number(r.ioFile.addressOffset),Number(t),r.logIOActivities))}),i=d.insertValues(i,a,r.logIOActivities),d.convertValuesByType(i,a,s,r.logIOActivities)},de.biancoroyal.modbus.io.core.allValueNamesFromIOFile=function(r){var a=[],s=de.biancoroyal.modbus.io.core;return r&&r.configData&&r.configData.forEach(function(e){e.valueAddress&&e.valueAddress.startsWith("%I")&&a.push(s.buildInputAddressMapping("MB-INPUTS",e,Number(r.addressOffset),0)),e.valueAddress&&e.valueAddress.startsWith("%Q")&&a.push(s.buildOutputAddressMapping("MB-OUTPUTS",e,Number(r.addressOffset),0))}),a},de.biancoroyal.modbus.io.core.getDataTypeFromFirstCharType=function(e){switch(e){case"w":return"Word";case"d":return"Double";case"r":return"Real";case"f":return"Float";case"i":return"Integer";case"l":return"Long";case"b":return"Boolean";default:return"Unsigned Integer"}},de.biancoroyal.modbus.io.core.buildInputAddressMapping=function(e,r,a,s,t){var i=de.biancoroyal.modbus.io.core,d=0,u=0,o=0,n=0,l=null,b=r.name.substring(0,1),c=r.valueAddress.substring(2,3),m=r.valueAddress.substring(0,3);switch(b){case"w":case"u":d=Number(r.valueAddress.split(m)[1]),o=1,n=16;break;case"i":d=Number(r.valueAddress.split(m)[1]),n="W"===c?(o=1,16):(o=2,32);break;case"r":case"f":d=Number(r.valueAddress.split(m)[1]),o=2,n=32;break;case"d":d=Number(r.valueAddress.split(m)[1]),o=4,n=64;break;case"l":d=Number(r.valueAddress.split(m)[1]),o=5,n=80;break;case"b":"X"===c&&(l=r.valueAddress.split("%IX")[1].split("."),d=Math.floor(Number(l[0])/2),u=8*Number(l[0])+Number(l[1]),n=o=1);break;default:t&&i.internalDebug("unknown input type "+b),n=0}if(n){var g=d-(Number(a)||0);return{register:e,name:r.name,addressStart:d,addressOffset:o,addressOffsetIO:Number(a)||0,addressStartIO:g,registerAddress:g-Number(s),coilStart:u,bitAddress:l,Bit:l?8*Number(l[0])+Number(l[1]):0,bits:n,dataType:i.getDataTypeFromFirstCharType(b),type:"input"}}return{name:r.name,type:b,mapping:r,error:"variable name does not match input mapping"}},de.biancoroyal.modbus.io.core.buildOutputAddressMapping=function(e,r,a,s,t){var i=de.biancoroyal.modbus.io.core,d=0,u=0,o=0,n=0,l=null,b=r.name.substring(0,1),c=r.valueAddress.substring(2,3),m=r.valueAddress.substring(0,3);switch(b){case"w":case"u":d=Number(r.valueAddress.split(m)[1]),o=1,n=16;break;case"i":d=Number(r.valueAddress.split(m)[1]),n="W"===c?(o=1,16):(o=2,32);break;case"r":case"f":d=Number(r.valueAddress.split(m)[1]),o=2,n=32;break;case"d":d=Number(r.valueAddress.split(m)[1]),o=4,n=64;break;case"l":d=Number(r.valueAddress.split(m)[1]),o=5,n=80;break;case"b":"X"===c&&(l=r.valueAddress.split("%QX")[1].split("."),d=Math.floor(Number(l[0])/2),u=8*Number(l[0])+Number(l[1]),n=o=1);break;default:t&&i.internalDebug("unknown output type "+b),n=0}if(n){var g=d-(Number(a)||0);return{register:e,name:r.name,addressStart:d,addressOffset:o,addressOffsetIO:Number(a)||0,addressStartIO:g,registerAddress:g-Number(s),coilStart:u,bitAddress:l,Bit:l?8*Number(l[0])+Number(l[1]):0,bits:n,dataType:i.getDataTypeFromFirstCharType(b),type:"output"}}return{name:r.name,type:b,mapping:r,error:"variable name does not match output mapping"}},de.biancoroyal.modbus.io.core.insertValues=function(e,r,a){var s=de.biancoroyal.modbus.io.core,t=0;for(t in e){var i=e[t];if(!i||!Object.prototype.hasOwnProperty.call(i,"registerAddress")||i.registerAddress<0)a&&s.internalDebug("Item Not Valid To Insert Value "+JSON.stringify(i));else{if(de.biancoroyal.modbus.io.core.isRegisterSizeWrong(r,i.registerAddress,Number(i.bits))){a&&s.internalDebug("Insert Value Register Reached At Address-Start-IO:"+i.registerAddress+" Bits:"+Number(i.bits));break}switch(Number(i.bits)){case 1:i.value=!!(r[i.registerAddress]&Math.pow(i.bitAddress[1],2));break;case 16:i.value=r[i.registerAddress];break;case 32:i.value=r[i.registerAddress+1]<<16|r[i.registerAddress];break;case 64:i.value=r[i.registerAddress+3]<<48|r[i.registerAddress+2]<<32|r[i.registerAddress+1]<<16|r[i.registerAddress];break;case 80:i.value=r[i.registerAddress+4]<<64|r[i.registerAddress+3]<<48|r[i.registerAddress+2]<<32|r[i.registerAddress+1]<<16|r[i.registerAddress];break;default:i.value=null}}}return e},de.biancoroyal.modbus.io.core.getValueFromBufferByDataType=function(e,r,a,s){var t=de.biancoroyal.modbus.io.core,i=a.length/2;if(r<0||r>a.length)return s&&(t.internalDebug("Wrong Buffer Access Parameter Type:"+e.dataType+" Register-Length: "+i+" Buffer-Length:"+a.length+" Address-Buffer-Offset:"+r),t.internalDebug(JSON.stringify(e))),e;switch(s&&t.internalDebug("Get Value From Buffer By Data Type:"+e.dataType+" Register:"+e.registerAddress+" Bits:"+Number(e.bits)),e.dataType){case"Boolean":e.value=!!(a.readUInt16BE(r)&Math.pow(e.bitAddress[1],2));break;case"Word":switch(e.bits){case"8":e.value=a.readInt8(r);break;default:e.value=a.readInt16BE(r),e.convertedValue=!1}break;case"Integer":switch(e.bits){case"8":e.value=a.readInt8(r);break;case"32":e.value=a.readInt32BE(r);break;case"64":e.value=a.readIntBE(r,8);break;default:e.value=a.readInt16BE(r)}break;case"Real":case"Float":e.value=a.readFloatBE(r,4);break;case"Double":e.value=a.readDoubleBE(r,8);break;case"Long":e.value=a.readDoubleBE(r,10);break;default:switch(e.bits){case"8":e.value=a.readUInt8(r);break;case"32":e.value=a.readUInt32BE(r);break;case"64":e.value=a.readUIntBE(r,8);break;default:e.value=a.readUInt16BE(r),e.convertedValue=!1}}return e},de.biancoroyal.modbus.io.core.convertValuesByType=function(e,r,a,s){var t=de.biancoroyal.modbus.io.core,i=0,d=0;for(d in e){var u=e[d];if(u&&Object.prototype.hasOwnProperty.call(u,"dataType")&&Object.prototype.hasOwnProperty.call(u,"registerAddress")&&!(u.registerAddress<0)){if(de.biancoroyal.modbus.io.core.isRegisterSizeWrong(r,u.registerAddress,Number(u.bits))){s&&t.internalDebug("Insert Value Register Reached At Address-Start-IO:"+u.registerAddress+" Bits:"+Number(u.bits));break}if(!(a.buffer instanceof Buffer)){s&&t.internalDebug("Response Buffer Is Not A Buffer");break}i=2*Number(u.registerAddress);try{u=t.getValueFromBufferByDataType(u,i,a.buffer,s)}catch(e){t.internalDebug(e.message)}}else s&&t.internalDebug("Item Not Valid To Convert "+JSON.stringify(u))}return e},de.biancoroyal.modbus.io.core.filterValueNames=function(e,r,a,s,t){if(!r.length||!r.filter)return r;var i=de.biancoroyal.modbus.io.core,d="input";2!==a&&4!==a||(d="output");var u=s,o=Number(s)+Number(t)-1;return e.logIOActivities&&i.internalDebug("adr:"+s+" quantity:"+t+" startRegister:"+u+" endRegister:"+o+" functionType:"+d),r.filter(function(e){return 0<=e.registerAddress&&e.addressStartIO>=u&&e.addressStartIO<=o&&e.type===d})},de.biancoroyal.modbus.io.core.isRegisterSizeWrong=function(e,r,a){var s=Number(a)||16,t=Number(r),i=t;return 16<s&&(i=t+s/16-1),t<0||e.length<t||i>e.length},de.biancoroyal.modbus.io.core.buildMessageWithIO=function(e,r,a,s){var t=this.core.getOriginalMessage(e.bufferMessageList,s);t.payload=r,t.topic=s.topic,t.responseBuffer=a,t.input=Object.assign({},s);var i=Object.assign({},t);if(i.payload=a,i.values=r,delete i.responseBuffer,e.useIOFile&&e.ioFile.lastUpdatedAt){var d=this.nameValuesFromIOFile(e,s,r,a,parseInt(s.payload.address)||0),u=this.filterValueNames(e,d,parseInt(s.payload.fc)||3,parseInt(s.payload.address)||0,parseInt(s.payload.quantity)||1,e.logIOActivities);return e.useIOForPayload?(t.payload=u,t.values=r):(t.payload=r,t.valueNames=u),i.valueNames=u,[t,i]}return[t,i]},module.exports=de.biancoroyal.modbus.io.core;
//# sourceMappingURL=../maps/core/modbus-io-core.js.map

@@ -1,2 +0,2 @@

"use strict";require("source-map-support").install();var de=de||{biancoroyal:{modbus:{basics:{}}}};de.biancoroyal.modbus.basics.internalDebug=de.biancoroyal.modbus.basics.internalDebug||require("debug")("contribModbus:basics"),de.biancoroyal.modbus.basics.util=de.biancoroyal.modbus.basics.util||require("util"),de.biancoroyal.modbus.basics.statusLog=!1,de.biancoroyal.modbus.basics.get_timeUnit_name=function(e){var s="";switch(e){case"ms":s="msec.";break;case"s":s="sec.";break;case"m":s="min.";break;case"h":s="h."}return s},de.biancoroyal.modbus.basics.calc_rateByUnit=function(e,s){switch(s){case"ms":break;case"s":e=1e3*parseInt(e);break;case"m":e=6e4*parseInt(e);break;case"h":e=36e5*parseInt(e);break;default:e=1e4}return e},de.biancoroyal.modbus.basics.setNodeStatusProperties=function(e,s){var o="yellow",t="ring",a=(e=e||"waiting").value||e;switch(a){case"connecting":o="yellow",t="ring";break;case"error":o="red",t="ring";break;case"initialized":o="yellow",t="dot";break;case"not ready to read":case"not ready to write":o="yellow",t="ring";break;case"connected":o="green",t="ring";break;case"timeout":o="red",t="ring";break;case"active":case"reading":case"writing":case"active reading":case"active writing":s||(a="active"),o="green",t="dot";break;case"disconnected":case"terminated":o="red",t="ring";break;case"stopped":o="red",t="dot";break;case"polling":o="green",t=s?"ring":(a="active","dot");break;default:"waiting"===a&&(o="blue",a="waiting ...")}return{fill:o,shape:t,status:a}},de.biancoroyal.modbus.basics.setNodeStatusByResponseTo=function(e,s,o){var t="red",a="dot";switch(e){case"initialized":t="green",a="ring";break;case"active":t="green",a="dot";break;default:e&&"waiting"!==e||(t="blue",e="waiting ...")}o.status({fill:t,shape:a,text:this.util.inspect(s,!1,null)})},de.biancoroyal.modbus.basics.setNodeStatusResponse=function(e,s){s.status({fill:"green",shape:"dot",text:"active got length: "+e})},de.biancoroyal.modbus.basics.setModbusError=function(e,s,o,t){if(o)switch(o.message){case"Timed out":this.setNodeStatusTo("timeout",e);break;case"FSM Not Ready To Reconnect":this.setNodeStatusTo("not ready to reconnect",e);break;case"Port Not Open":this.setNodeStatusTo("reconnect",e),s.emit("reconnect");break;default:this.internalDebug(o.message),e.showErrors&&this.setNodeStatusTo("error "+o.message,e)}},de.biancoroyal.modbus.basics.setNodeStatusTo=function(e,s){if(s.showStatusActivities&&e!==s.statusText){var o=this.setNodeStatusProperties(e,s.showStatusActivities);s.statusText=e,s.status({fill:o.fill,shape:o.shape,text:o.status})}},de.biancoroyal.modbus.basics.onModbusInit=function(e){this.setNodeStatusTo("initialize",e)},de.biancoroyal.modbus.basics.onModbusConnect=function(e){this.setNodeStatusTo("connected",e)},de.biancoroyal.modbus.basics.onModbusActive=function(e){this.setNodeStatusTo("active",e)},de.biancoroyal.modbus.basics.onModbusError=function(e,s){this.setNodeStatusTo("failure",e),e.showErrors&&e.warn(s)},de.biancoroyal.modbus.basics.onModbusClose=function(e){this.setNodeStatusTo("closed",e)},de.biancoroyal.modbus.basics.onModbusBroken=function(e,s){this.setNodeStatusTo("reconnecting after "+s.reconnectTimeout+" msec.",e)},de.biancoroyal.modbus.basics.initModbusClientEvents=function(s,e){var o=this;e.on("mbinit",function(){o.onModbusInit(s)}),e.on("mbconnected",function(){o.onModbusConnect(s)}),e.on("mbactive",function(){o.onModbusActive(s)}),e.on("mberror",function(e){o.onModbusError(s,e)}),e.on("mbbroken",function(){o.onModbusBroken(s,e)}),e.on("mbclosed",function(){o.onModbusClose(s)})},de.biancoroyal.modbus.basics.invalidPayloadIn=function(e){return!(e&&Object.prototype.hasOwnProperty.call(e,"payload"))},de.biancoroyal.modbus.basics.emptyMsgOnFail=function(e,s,o){e.emptyMsgOnFail&&(o.payload="",s&&s.message&&s.name?o.error=s:o.error=Error(s),o.error.nodeStatus=e.statusText,e.send([o,o]))},module.exports=de.biancoroyal.modbus.basics;
"use strict";require("source-map-support").install();var de=de||{biancoroyal:{modbus:{basics:{}}}};de.biancoroyal.modbus.basics.internalDebug=de.biancoroyal.modbus.basics.internalDebug||require("debug")("contribModbus:basics"),de.biancoroyal.modbus.basics.util=de.biancoroyal.modbus.basics.util||require("util"),de.biancoroyal.modbus.basics.statusLog=!1,de.biancoroyal.modbus.basics.get_timeUnit_name=function(e){var s="";switch(e){case"ms":s="msec.";break;case"s":s="sec.";break;case"m":s="min.";break;case"h":s="h."}return s},de.biancoroyal.modbus.basics.calc_rateByUnit=function(e,s){switch(s){case"ms":break;case"s":e=1e3*parseInt(e);break;case"m":e=6e4*parseInt(e);break;case"h":e=36e5*parseInt(e);break;default:e=1e4}return e},de.biancoroyal.modbus.basics.setNodeStatusProperties=function(e,s){var t="yellow",o="ring",a=(e=e||"waiting").value||e;switch(a){case"connecting":t="yellow",o="ring";break;case"error":t="red",o="ring";break;case"initialized":case"init":t="yellow",o="dot";break;case"not ready to read":case"not ready to write":t="yellow",o="ring";break;case"connected":case"queueing":case"queue":t="green",o="ring";break;case"timeout":t="red",o="ring";break;case"active":case"reading":case"writing":case"active reading":case"active writing":s||(a="active"),t="green",o="dot";break;case"disconnected":case"terminated":t="red",o="ring";break;case"stopped":t="red",o="dot";break;case"polling":t="green",o=s?"ring":(a="active","dot");break;default:"waiting"===a&&(t="blue",a="waiting ...")}return{fill:t,shape:o,status:a}},de.biancoroyal.modbus.basics.setNodeStatusByResponseTo=function(e,s,t){var o="red",a="dot";switch(e){case"initialized":case"queue":o="green",a="ring";break;case"active":o="green",a="dot";break;default:e&&"waiting"!==e||(o="blue",e="waiting ...")}t.status({fill:o,shape:a,text:this.util.inspect(s,!1,null)})},de.biancoroyal.modbus.basics.setNodeStatusResponse=function(e,s){s.status({fill:"green",shape:"dot",text:"active got length: "+e})},de.biancoroyal.modbus.basics.setModbusError=function(e,s,t,o){if(t)switch(t.message){case"Timed out":this.setNodeStatusTo("timeout",e);break;case"FSM Not Ready To Reconnect":this.setNodeStatusTo("not ready to reconnect",e);break;case"Port Not Open":this.setNodeStatusTo("reconnect",e),s.emit("reconnect");break;default:this.internalDebug(t.message),e.showErrors&&this.setNodeStatusTo("error "+t.message,e)}},de.biancoroyal.modbus.basics.setNodeStatusTo=function(e,s){if(s.showStatusActivities)if(e!==s.statusText){var t=this.setNodeStatusProperties(e,s.showStatusActivities);s.statusText=e,s.status({fill:t.fill,shape:t.shape,text:t.status})}else this.setNodeDefaultStatus()},de.biancoroyal.modbus.basics.onModbusInit=function(e){this.setNodeStatusTo("initialize",e)},de.biancoroyal.modbus.basics.onModbusConnect=function(e){this.setNodeStatusTo("connected",e)},de.biancoroyal.modbus.basics.onModbusActive=function(e){this.setNodeStatusTo("active",e)},de.biancoroyal.modbus.basics.onModbusError=function(e,s){this.setNodeStatusTo("failure",e),e.showErrors&&e.warn(s)},de.biancoroyal.modbus.basics.onModbusClose=function(e){this.setNodeStatusTo("closed",e)},de.biancoroyal.modbus.basics.onModbusQueue=function(e){this.setNodeStatusTo("queueing",e)},de.biancoroyal.modbus.basics.onModbusBroken=function(e,s){this.setNodeStatusTo("reconnecting after "+s.reconnectTimeout+" msec.",e)},de.biancoroyal.modbus.basics.setNodeDefaultStatus=function(e){e.status({fill:"green",shape:"ring",text:"active"})},de.biancoroyal.modbus.basics.initModbusClientEvents=function(s,e){var t=this;s.showStatusActivities?(e.on("mbinit",function(){t.onModbusInit(s)}),e.on("mbqueue",function(){t.onModbusQueue(s)}),e.on("mbconnected",function(){t.onModbusConnect(s)}),e.on("mbbroken",function(){t.onModbusBroken(s,e)}),e.on("mbactive",function(){t.onModbusActive(s)}),e.on("mberror",function(e){t.onModbusError(s,e)}),e.on("mbclosed",function(){t.onModbusClose(s)})):this.setNodeDefaultStatus(s)},de.biancoroyal.modbus.basics.invalidPayloadIn=function(e){return!(e&&Object.prototype.hasOwnProperty.call(e,"payload"))},de.biancoroyal.modbus.basics.sendEmptyMsgOnFail=function(e,s,t){e.emptyMsgOnFail&&(t.payload="",s&&s.message&&s.name?t.error=s:t.error=Error(s),t.error.nodeStatus=e.statusText,e.send([t,t]))},module.exports=de.biancoroyal.modbus.basics;
//# sourceMappingURL=maps/modbus-basics.js.map

@@ -1,2 +0,2 @@

"use strict";module.exports=function(c){require("source-map-support").install();var l=require("./modbus-basics"),u=require("./core/modbus-client-core"),d=require("./core/modbus-queue-core");c.nodes.registerType("modbus-client",function(e){c.nodes.createNode(this,e);var t=require("modbus-serial"),n=500,i=2e3,o=" Get More About It By Logging";this.clienttype=e.clienttype,void 0===e.parallelUnitIdsAllowed?this.bufferCommands=!0:this.bufferCommands=e.bufferCommands,this.queueLogEnabled=e.queueLogEnabled,this.stateLogEnabled=e.stateLogEnabled,this.tcpHost=e.tcpHost,this.tcpPort=parseInt(e.tcpPort)||502,this.tcpType=e.tcpType,this.serialPort=e.serialPort,this.serialBaudrate=e.serialBaudrate,this.serialDatabits=e.serialDatabits,this.serialStopbits=e.serialStopbits,this.serialParity=e.serialParity,this.serialType=e.serialType,this.serialConnectionDelay=parseInt(e.serialConnectionDelay)||n,this.unit_id=parseInt(e.unit_id)||1,this.commandDelay=parseInt(e.commandDelay)||1,this.clientTimeout=parseInt(e.clientTimeout)||1e3,this.reconnectTimeout=parseInt(e.reconnectTimeout)||i,this.reconnectOnTimeout=e.reconnectOnTimeout,void 0===e.parallelUnitIdsAllowed?this.parallelUnitIdsAllowed=!0:this.parallelUnitIdsAllowed=e.parallelUnitIdsAllowed;var r=this;function s(e){c.settings.verbose&&r.warn("Client -> "+e+r.serverInfo)}function a(e){c.settings.verbose&&u.internalDebug("Client -> "+e+r.serverInfo)}r.isFirstInitOfConnection=!0,r.closingModbus=!1,r.client=null,r.bufferCommandList=new Map,r.sendingAllowed=new Map,r.unitSendingAllowed=[],r.messageAllowedStates=u.messagesAllowedStates,r.serverInfo="",r.stateMachine=null,r.stateService=null,r.stateMachine=u.createStateMachineService(),r.actualServiceState=r.stateMachine.initialState,r.actualServiceStateBefore=r.actualServiceState,r.stateService=u.startStateService(r.stateMachine),r.reconnectTimeoutId=0,r.serialSendingAllowed=!1,r.setUnitIdFromPayload=function(e){var t=u.getActualUnitId(r,e);u.checkUnitId(t,r.clienttype)||(r.unit_id=1),r.client.setID(t),e.unitId=t},!Number.isNaN(r.unit_id)&&u.checkUnitId(r.unit_id,r.clienttype)||(r.unit_id=1),r.updateServerinfo=function(){"tcp"===r.clienttype?r.serverInfo=" TCP@"+r.tcpHost+":"+r.tcpPort:r.serverInfo=" Serial@"+r.serialPort+":"+r.serialBaudrate+"bit/s",r.serverInfo+=" default Unit-Id: "+r.unit_id},r.queueLog=function(e){r.bufferCommands&&r.queueLogEnabled&&a(e)},r.stateService.subscribe(function(e){var t;if(r.actualServiceStateBefore=r.actualServiceState,r.actualServiceState=e,t=e.value,r.stateLogEnabled&&a(t),e.matches("init")){r.updateServerinfo(),d.initQueue(r),r.reconnectTimeoutId=0;try{r.isFirstInitOfConnection?(r.isFirstInitOfConnection=!1,s("init in 500 ms"),setTimeout(r.connectClient,n)):(s("init in "+r.reconnectTimeout+" ms"),setTimeout(r.connectClient,r.reconnectTimeout))}catch(e){r.error(e,{payload:"client connection error "+o})}r.emit("mbinit")}e.matches("connected")&&(r.serialSendingAllowed=!0,r.emit("mbconnected")),e.matches("activated")&&(r.emit("mbactive"),r.bufferCommands&&!d.checkQueuesAreEmpty(r)&&r.stateService.send("QUEUE")),e.matches("queueing")&&(r.stateService.send("SEND"),setTimeout(function(){d.dequeueCommand(r)},r.commandDelay),r.emit("mbqueue")),e.matches("opened")&&(r.serialSendingAllowed=!0,r.emit("mbopen")),e.matches("closed")&&(r.emit("mbclosed"),r.stateService.send("RECONNECT")),e.matches("stopped")&&(s("stopped state without reconnecting"),r.emit("mbclosed")),e.matches("failed")&&(r.emit("mberror","Modbus Failure On State "+r.actualServiceStateBefore.value+o),r.stateService.send("BREAK")),e.matches("broken")&&(r.emit("mbbroken","Modbus Broken On State "+r.actualServiceStateBefore.value+o),r.reconnectOnTimeout?(r.reconnectTimeout<=0&&(r.reconnectTimeout=i),r.stateService.send("RECONNECT")):r.stateService.send("ACTIVATE")),e.matches("reconnecting")&&(r.serialSendingAllowed=!1,r.emit("mbreconnecting"),r.reconnectTimeout<=0&&(r.reconnectTimeout=i),setTimeout(function(){r.reconnectTimeoutId=0,r.stateService.send("INIT")},r.reconnectTimeout))}),r.connectClient=function(){if(r.client)try{r.client.close(function(){a("connection closed")}),a("connection close sent")}catch(e){a(e.message)}if(r.client=null,r.client=new t,r.clientTimeout||(r.clientTimeout=1e3),r.reconnectTimeout||(r.reconnectTimeout=i),"tcp"===r.clienttype){if(!u.checkUnitId(r.unit_id,r.clienttype))return r.error(new Error("wrong unit-id (0..255)"),{payload:r.unit_id}),void r.stateService.send("FAILURE");switch(r.tcpType){case"C701":a("C701 port UDP bridge"),r.client.connectC701(r.tcpHost,{port:r.tcpPort,autoOpen:!0}).then(r.setTCPConnectionOptions).then(r.setTCPConnected).catch(r.modbusTcpErrorHandling);break;case"TELNET":a("Telnet port"),r.client.connectTelnet(r.tcpHost,{port:r.tcpPort,autoOpen:!0}).then(r.setTCPConnectionOptions).catch(r.modbusTcpErrorHandling);break;case"TPC-RTU-BUFFERED":a("TCP RTU buffered port"),r.client.connectTcpRTUBuffered(r.tcpHost,{port:r.tcpPort,autoOpen:!0}).then(r.setTCPConnectionOptions).catch(r.modbusTcpErrorHandling);break;default:a("TCP port"),r.client.connectTCP(r.tcpHost,{port:r.tcpPort,autoOpen:!0}).then(r.setTCPConnectionOptions).catch(r.modbusTcpErrorHandling)}}else{if(!u.checkUnitId(r.unit_id,r.clienttype))return r.error(new Error("wrong unit-id serial (1..247)"),{payload:r.unit_id}),void r.stateService.send("FAILURE");if(r.serialConnectionDelay||(r.serialConnectionDelay=n),!r.serialPort)return r.error(new Error("wrong serial port"),{payload:r.serialPort}),void r.stateService.send("FAILURE");var e={baudRate:parseInt(r.serialBaudrate),dataBits:parseInt(r.serialDatabits),stopBits:parseInt(r.serialStopbits),parity:r.serialParity,autoOpen:!1};switch(r.serialType){case"ASCII":a("ASCII port serial"),r.client.connectAsciiSerial(r.serialPort,e).then(r.setSerialConnectionOptions).catch(r.modbusSerialErrorHandling);break;case"RTU":a("RTU port serial"),r.client.connectRTU(r.serialPort,e).then(r.setSerialConnectionOptions).catch(r.modbusSerialErrorHandling);break;default:a("RTU buffered port serial"),r.client.connectRTUBuffered(r.serialPort,e).then(r.setSerialConnectionOptions).catch(r.modbusSerialErrorHandling)}}},r.setTCPConnectionOptions=function(){r.client.setID(r.unit_id),r.client.setTimeout(r.clientTimeout),r.stateService.send("CONNECT")},r.setTCPConnected=function(){u.modbusSerialDebug("modbus tcp connected on "+r.tcpHost)},r.setSerialConnectionOptions=function(){r.stateService.send("OPENSERIAL"),setTimeout(r.openSerialClient,parseInt(r.serialConnectionDelay))},r.modbusErrorHandling=function(e){e.message?u.modbusSerialDebug("modbusErrorHandling:"+e.message):u.modbusSerialDebug("modbusErrorHandling:"+JSON.stringify(e)),e.errno&&u.networkErrors.includes(e.errno)&&r.stateService.send("FAILURE")},r.modbusTcpErrorHandling=function(e){r.showErrors&&r.error(e),e.message?u.modbusSerialDebug("modbusTcpErrorHandling:"+e.message):u.modbusSerialDebug("modbusTcpErrorHandling:"+JSON.stringify(e)),e.errno&&u.networkErrors.includes(e.errno)&&r.stateService.send("BREAK")},r.modbusSerialErrorHandling=function(e){r.showErrors&&r.error(e),e.message?u.modbusSerialDebug("modbusSerialErrorHandling:"+e.message):u.modbusSerialDebug("modbusSerialErrorHandling:"+JSON.stringify(e)),r.stateService.send("BREAK")},r.openSerialClient=function(){"opened"===r.actualServiceState.value?(a("time to open Unit "+r.unit_id),u.modbusSerialDebug("modbus connection opened"),r.client.setID(r.unit_id),r.client.setTimeout(parseInt(r.clientTimeout)),r.client._port.on("close",r.onModbusClose),r.stateService.send("CONNECT")):(a("wrong state on connect serial "+r.actualServiceState.value),u.modbusSerialDebug("modbus connection not opened state is %s",r.actualServiceState.value),r.stateService.send("BREAK"))},r.onModbusClose=function(){s("Modbus closed port"),u.modbusSerialDebug("modbus closed port"),r.stateService.send("CLOSE")},r.on("readModbus",function(t,e,n){var i=r.actualServiceState;-1===r.messageAllowedStates.indexOf(i.value)?n(new Error("Client Not Ready To Read At State "+i.value),t):r.bufferCommands?d.pushToQueueByUnitId(r,u.readModbus,t,e,n).then(function(){r.queueLog(JSON.stringify({info:"queued read msg",message:t.payload,state:i.value,queueLength:r.bufferCommandList.get(t.queueUnitId).length}))}).catch(function(e){n(e,t)}).finally(function(){r.stateService.send("QUEUE")}):u.readModbus(r,t,e,n)}),r.on("writeModbus",function(t,e,n){var i=r.actualServiceState;-1===r.messageAllowedStates.indexOf(i.value)?n(new Error("Client Not Ready To Write At State "+i.value),t):r.bufferCommands?d.pushToQueueByUnitId(r,u.writeModbus,t,e,n).then(function(){r.queueLog(JSON.stringify({info:"queued write msg",message:t.payload,state:i.value,queueLength:r.bufferCommandList.get(t.queueUnitId).length}))}).catch(function(e){n(e,t)}).finally(function(){r.stateService.send("QUEUE")}):u.writeModbus(r,t,e,n)}),r.activateSending=function(n){return r.sendingAllowed.set(n.queueUnitId,!0),r.serialSendingAllowed=!0,new Promise(function(e,t){try{r.bufferCommands&&(r.queueLog(JSON.stringify({info:"queue response activate sending",queueLength:r.bufferCommandList.length,sendingAllowed:r.sendingAllowed.get(n.queueUnitId),serialSendingAllowed:r.serialSendingAllowed,queueUnitId:n.queueUnitId})),d.checkQueuesAreEmpty(r)&&r.stateService.send("EMPTY")),e()}catch(e){t(e)}})},a("initialized"),r.setMaxListeners(0),r.on("reconnect",function(){r.stateService.send("CLOSE")}),r.on("dynamicReconnect",function(e,t,n){if(l.invalidPayloadIn(e))throw new Error("Message Or Payload Not Valid");u.internalDebug("Dynamic Reconnect Parameters "+JSON.stringify(e.payload)),u.setNewNodeSettings(r,e)?t(e):n(new Error("Message Or Payload Not Valid"),e),u.internalDebug("Dynamic Reconnect Starts on actual state "+r.actualServiceState.value),r.stateService.send("CLOSE")}),r.on("close",function(t){r.closingModbus=!0,a("stop fsm on close "+r.name),r.stateService.send("STOP"),a("close node "+r.name),r.client?r.client.isOpen?r.client.close(function(e){a(e?"Connection closed with error "+r.name:"Connection closed well "+r.name),t()}):(a("connection was closed "+r.name),t()):(a("Connection closed simple "+r.name),t())}),r.registeredNodeList={},r.registerForModbus=function(e){r.registeredNodeList[e.id]=e,1===Object.keys(r.registeredNodeList).length&&(r.closingModbus=!1,r.stateService.send("NEW"),r.stateService.send("INIT"))},r.closeConnectionWithoutRegisteredNodes=function(e){0===Object.keys(r.registeredNodeList).length?(r.closingModbus=!0,r.client&&"stopped"!==r.actualServiceState.value&&r.client.isOpen?r.client.close(function(){r.stateService.send("STOP"),e()}):(r.stateService.send("STOP"),e())):e()},r.deregisterForModbus=function(e,t){delete r.registeredNodeList[e.id],r.closingModbus?t():r.closeConnectionWithoutRegisteredNodes(t)}}),c.httpAdmin.get("/modbus/serial/ports",c.auth.needsPermission("serial.read"),function(e,t){require("serialport").list().then(function(e){t.json(e)}).catch(function(e){t.json([e.message]),u.internalDebug(e.message)})})};
"use strict";module.exports=function(c){require("source-map-support").install();var l=require("./modbus-basics"),u=require("./core/modbus-client-core"),d=require("./core/modbus-queue-core");c.nodes.registerType("modbus-client",function(e){c.nodes.createNode(this,e);var t=require("modbus-serial"),n=500,i=2e3,o=" Get More About It By Logging";this.clienttype=e.clienttype,void 0===e.parallelUnitIdsAllowed?this.bufferCommands=!0:this.bufferCommands=e.bufferCommands,this.queueLogEnabled=e.queueLogEnabled,this.stateLogEnabled=e.stateLogEnabled,this.tcpHost=e.tcpHost,this.tcpPort=parseInt(e.tcpPort)||502,this.tcpType=e.tcpType,this.serialPort=e.serialPort,this.serialBaudrate=e.serialBaudrate,this.serialDatabits=e.serialDatabits,this.serialStopbits=e.serialStopbits,this.serialParity=e.serialParity,this.serialType=e.serialType,this.serialConnectionDelay=parseInt(e.serialConnectionDelay)||n,this.unit_id=parseInt(e.unit_id)||1,this.commandDelay=parseInt(e.commandDelay)||1,this.clientTimeout=parseInt(e.clientTimeout)||1e3,this.reconnectTimeout=parseInt(e.reconnectTimeout)||i,this.reconnectOnTimeout=e.reconnectOnTimeout,void 0===e.parallelUnitIdsAllowed?this.parallelUnitIdsAllowed=!0:this.parallelUnitIdsAllowed=e.parallelUnitIdsAllowed;var r=this;function s(e){c.settings.verbose&&r.warn("Client -> "+e+r.serverInfo)}function a(e){c.settings.verbose&&u.internalDebug("Client -> "+e+r.serverInfo)}r.isFirstInitOfConnection=!0,r.closingModbus=!1,r.client=null,r.bufferCommandList=new Map,r.sendingAllowed=new Map,r.unitSendingAllowed=[],r.messageAllowedStates=u.messagesAllowedStates,r.serverInfo="",r.stateMachine=null,r.stateService=null,r.stateMachine=u.createStateMachineService(),r.actualServiceState=r.stateMachine.initialState,r.actualServiceStateBefore=r.actualServiceState,r.stateService=u.startStateService(r.stateMachine),r.reconnectTimeoutId=0,r.serialSendingAllowed=!1,r.setUnitIdFromPayload=function(e){var t=u.getActualUnitId(r,e);u.checkUnitId(t,r.clienttype)||(r.unit_id=1),r.client.setID(t),e.unitId=t},!Number.isNaN(r.unit_id)&&u.checkUnitId(r.unit_id,r.clienttype)||(r.unit_id=1),r.updateServerinfo=function(){"tcp"===r.clienttype?r.serverInfo=" TCP@"+r.tcpHost+":"+r.tcpPort:r.serverInfo=" Serial@"+r.serialPort+":"+r.serialBaudrate+"bit/s",r.serverInfo+=" default Unit-Id: "+r.unit_id},r.queueLog=function(e){r.bufferCommands&&r.queueLogEnabled&&a(e)},r.stateService.subscribe(function(e){var t;if(r.actualServiceStateBefore=r.actualServiceState,r.actualServiceState=e,t=e.value,r.stateLogEnabled&&a(t),e.value&&void 0!==r.actualServiceState.value&&r.actualServiceStateBefore.value!==r.actualServiceState.value){if(e.matches("init")){s("fsm init state after "+r.actualServiceStateBefore.value),r.updateServerinfo(),d.initQueue(r),r.reconnectTimeoutId=0;try{r.isFirstInitOfConnection?(r.isFirstInitOfConnection=!1,s("first fsm init in 500 ms"),setTimeout(r.connectClient,n)):(s("fsm init in "+r.reconnectTimeout+" ms"),setTimeout(r.connectClient,r.reconnectTimeout))}catch(e){r.error(e,{payload:"client connection error "+o})}r.emit("mbinit")}e.matches("connected")&&(s("fsm connected after state "+r.actualServiceStateBefore.value+o),r.serialSendingAllowed=!0,r.emit("mbconnected")),e.matches("activated")&&(r.emit("mbactive"),r.bufferCommands&&!d.checkQueuesAreEmpty(r)&&r.stateService.send("QUEUE")),e.matches("queueing")&&(r.stateService.send("SEND"),setTimeout(function(){d.dequeueCommand(r)},r.commandDelay),r.emit("mbqueue")),e.matches("opened")&&(r.serialSendingAllowed=!0,r.emit("mbopen")),e.matches("closed")&&(r.emit("mbclosed"),r.stateService.send("RECONNECT")),e.matches("stopped")&&(s("stopped state without reconnecting"),r.emit("mbclosed")),e.matches("failed")&&(s("fsm failed state after "+r.actualServiceStateBefore.value+o),r.emit("mberror","Modbus Failure On State "+r.actualServiceStateBefore.value+o),r.stateService.send("BREAK")),e.matches("broken")&&(s("fsm broken state after "+r.actualServiceStateBefore.value+o),r.emit("mbbroken","Modbus Broken On State "+r.actualServiceStateBefore.value+o),r.reconnectOnTimeout?(r.reconnectTimeout<=0&&(r.reconnectTimeout=i),r.stateService.send("RECONNECT")):r.stateService.send("ACTIVATE")),e.matches("reconnecting")&&(s("fsm reconnect state after "+r.actualServiceStateBefore.value+o),r.serialSendingAllowed=!1,r.emit("mbreconnecting"),r.reconnectTimeout<=0&&(r.reconnectTimeout=i),setTimeout(function(){r.reconnectTimeoutId=0,r.stateService.send("INIT")},r.reconnectTimeout))}}),r.connectClient=function(){if(r.client)try{r.client.close(function(){a("connection closed")}),a("connection close sent")}catch(e){a(e.message)}if(r.client=null,r.client=new t,r.clientTimeout||(r.clientTimeout=1e3),r.reconnectTimeout||(r.reconnectTimeout=i),"tcp"===r.clienttype){if(!u.checkUnitId(r.unit_id,r.clienttype))return r.error(new Error("wrong unit-id (0..255)"),{payload:r.unit_id}),void r.stateService.send("FAILURE");switch(r.tcpType){case"C701":a("C701 port UDP bridge"),r.client.connectC701(r.tcpHost,{port:r.tcpPort,autoOpen:!0}).then(r.setTCPConnectionOptions).then(r.setTCPConnected).catch(r.modbusTcpErrorHandling);break;case"TELNET":a("Telnet port"),r.client.connectTelnet(r.tcpHost,{port:r.tcpPort,autoOpen:!0}).then(r.setTCPConnectionOptions).catch(r.modbusTcpErrorHandling);break;case"TPC-RTU-BUFFERED":a("TCP RTU buffered port"),r.client.connectTcpRTUBuffered(r.tcpHost,{port:r.tcpPort,autoOpen:!0}).then(r.setTCPConnectionOptions).catch(r.modbusTcpErrorHandling);break;default:a("TCP port"),r.client.connectTCP(r.tcpHost,{port:r.tcpPort,autoOpen:!0}).then(r.setTCPConnectionOptions).catch(r.modbusTcpErrorHandling)}}else{if(!u.checkUnitId(r.unit_id,r.clienttype))return r.error(new Error("wrong unit-id serial (1..247)"),{payload:r.unit_id}),void r.stateService.send("FAILURE");if(r.serialConnectionDelay||(r.serialConnectionDelay=n),!r.serialPort)return r.error(new Error("wrong serial port"),{payload:r.serialPort}),void r.stateService.send("FAILURE");var e={baudRate:parseInt(r.serialBaudrate),dataBits:parseInt(r.serialDatabits),stopBits:parseInt(r.serialStopbits),parity:r.serialParity,autoOpen:!1};switch(r.serialType){case"ASCII":a("ASCII port serial"),r.client.connectAsciiSerial(r.serialPort,e).then(r.setSerialConnectionOptions).catch(r.modbusSerialErrorHandling);break;case"RTU":a("RTU port serial"),r.client.connectRTU(r.serialPort,e).then(r.setSerialConnectionOptions).catch(r.modbusSerialErrorHandling);break;default:a("RTU buffered port serial"),r.client.connectRTUBuffered(r.serialPort,e).then(r.setSerialConnectionOptions).catch(r.modbusSerialErrorHandling)}}},r.setTCPConnectionOptions=function(){r.client.setID(r.unit_id),r.client.setTimeout(r.clientTimeout),r.stateService.send("CONNECT")},r.setTCPConnected=function(){u.modbusSerialDebug("modbus tcp connected on "+r.tcpHost)},r.setSerialConnectionOptions=function(){r.stateService.send("OPENSERIAL"),setTimeout(r.openSerialClient,parseInt(r.serialConnectionDelay))},r.modbusErrorHandling=function(e){e.message?u.modbusSerialDebug("modbusErrorHandling:"+e.message):u.modbusSerialDebug("modbusErrorHandling:"+JSON.stringify(e)),e.errno&&u.networkErrors.includes(e.errno)&&r.stateService.send("FAILURE")},r.modbusTcpErrorHandling=function(e){r.showErrors&&r.error(e),e.message?u.modbusSerialDebug("modbusTcpErrorHandling:"+e.message):u.modbusSerialDebug("modbusTcpErrorHandling:"+JSON.stringify(e)),e.errno&&u.networkErrors.includes(e.errno)&&r.stateService.send("BREAK")},r.modbusSerialErrorHandling=function(e){r.showErrors&&r.error(e),e.message?u.modbusSerialDebug("modbusSerialErrorHandling:"+e.message):u.modbusSerialDebug("modbusSerialErrorHandling:"+JSON.stringify(e)),r.stateService.send("BREAK")},r.openSerialClient=function(){"opened"===r.actualServiceState.value?(a("time to open Unit "+r.unit_id),u.modbusSerialDebug("modbus connection opened"),r.client.setID(r.unit_id),r.client.setTimeout(parseInt(r.clientTimeout)),r.client._port.on("close",r.onModbusClose),r.stateService.send("CONNECT")):(a("wrong state on connect serial "+r.actualServiceState.value),u.modbusSerialDebug("modbus connection not opened state is %s",r.actualServiceState.value),r.stateService.send("BREAK"))},r.onModbusClose=function(){s("Modbus closed port"),u.modbusSerialDebug("modbus closed port"),r.stateService.send("CLOSE")},r.on("readModbus",function(t,e,n){var i=r.actualServiceState;-1===r.messageAllowedStates.indexOf(i.value)?n(new Error("Client Not Ready To Read At State "+i.value),t):r.bufferCommands?d.pushToQueueByUnitId(r,u.readModbus,t,e,n).then(function(){r.queueLog(JSON.stringify({info:"queued read msg",message:t.payload,state:i.value,queueLength:r.bufferCommandList.get(t.queueUnitId).length}))}).catch(function(e){n(e,t)}).finally(function(){r.stateService.send("QUEUE")}):u.readModbus(r,t,e,n)}),r.on("writeModbus",function(t,e,n){var i=r.actualServiceState;-1===r.messageAllowedStates.indexOf(i.value)?n(new Error("Client Not Ready To Write At State "+i.value),t):r.bufferCommands?d.pushToQueueByUnitId(r,u.writeModbus,t,e,n).then(function(){r.queueLog(JSON.stringify({info:"queued write msg",message:t.payload,state:i.value,queueLength:r.bufferCommandList.get(t.queueUnitId).length}))}).catch(function(e){n(e,t)}).finally(function(){r.stateService.send("QUEUE")}):u.writeModbus(r,t,e,n)}),r.activateSending=function(n){return r.sendingAllowed.set(n.queueUnitId,!0),r.serialSendingAllowed=!0,new Promise(function(e,t){try{r.bufferCommands&&(r.queueLog(JSON.stringify({info:"queue response activate sending",queueLength:r.bufferCommandList.length,sendingAllowed:r.sendingAllowed.get(n.queueUnitId),serialSendingAllowed:r.serialSendingAllowed,queueUnitId:n.queueUnitId})),d.checkQueuesAreEmpty(r)&&r.stateService.send("EMPTY")),e()}catch(e){t(e)}})},a("initialized"),r.setMaxListeners(0),r.on("reconnect",function(){r.stateService.send("CLOSE")}),r.on("dynamicReconnect",function(e,t,n){if(l.invalidPayloadIn(e))throw new Error("Message Or Payload Not Valid");u.internalDebug("Dynamic Reconnect Parameters "+JSON.stringify(e.payload)),u.setNewNodeSettings(r,e)?t(e):n(new Error("Message Or Payload Not Valid"),e),u.internalDebug("Dynamic Reconnect Starts on actual state "+r.actualServiceState.value),r.stateService.send("CLOSE")}),r.on("close",function(t){var n=r.name||r.id;r.closingModbus=!0,a("stop fsm on close "+n),r.stateService.send("STOP"),a("close node "+n),r.removeAllListeners(),r.client?r.client.isOpen?r.client.close(function(e){a(e?"Connection closed with error "+n:"Connection closed well "+n),t()}):(a("connection was closed "+n),t()):(a("Connection closed simple "+n),t())}),r.registeredNodeList={},r.registerForModbus=function(e){r.registeredNodeList[e]=e,1===Object.keys(r.registeredNodeList).length&&(r.closingModbus=!1,r.stateService.send("NEW"),r.stateService.send("INIT"))},r.closeConnectionWithoutRegisteredNodes=function(e){0===Object.keys(r.registeredNodeList).length?(r.closingModbus=!0,r.client&&"stopped"!==r.actualServiceState.value&&r.client.isOpen?r.client.close(function(){r.stateService.send("STOP"),e()}):(r.stateService.send("STOP"),e())):e()},r.deregisterForModbus=function(t,n){try{delete r.registeredNodeList[t],r.closingModbus?n():r.closeConnectionWithoutRegisteredNodes(n)}catch(e){s(e.message+" on de-register node "+t),r.error(e),n()}}}),c.httpAdmin.get("/modbus/serial/ports",c.auth.needsPermission("serial.read"),function(e,t){require("serialport").list().then(function(e){t.json(e)}).catch(function(e){t.json([e.message]),u.internalDebug(e.message)})})};
//# sourceMappingURL=maps/modbus-client.js.map

@@ -1,2 +0,2 @@

"use strict";module.exports=function(t){require("source-map-support").install();var s=require("./modbus-basics"),r=require("debug")("contribModbus:flex:connector");t.nodes.registerType("modbus-flex-connector",function(e){t.nodes.createNode(this,e),this.name=e.name,this.maxReconnectsPerMinute=e.maxReconnectsPerMinute||4,this.emptyQueue=e.emptyQueue,this.showStatusActivities=e.showStatusActivities,this.showErrors=e.showErrors,this.connection=null,this.internalDebugLog=r,this.verboseLogging=t.settings.verbose;var o=this;s.setNodeStatusTo("waiting",o);var n=t.nodes.getNode(e.server);n&&(n.registerForModbus(o),s.initModbusClientEvents(o,n),o.onConfigDone=function(e){o.showStatusActivities&&s.setNodeStatusTo("config done",o),e.config_change="emitted",o.send(e)},o.onConfigError=function(e,t){r(e.message),o.showErrors&&o.error(e,t),e&&e.message?t.error=e:t.error=new Error(e),t.error.nodeStatus=o.statusText,o.emptyMsgOnFail&&(t.payload=""),o.send(t)},o.on("input",function(e){if(!s.invalidPayloadIn(e)&&n.client)if(o.showStatusActivities&&s.setNodeStatusTo(n.actualServiceState,o),e.payload.connectorType)r("dynamicReconnect: "+JSON.stringify(e.payload)),e.payload.emptyQueue=o.emptyQueue,n.emit("dynamicReconnect",e,o.onConfigDone,o.onConfigError);else{var t=new Error("Payload Not Valid - Connector Type");o.error(t,e),o.send(e)}}))})};
"use strict";module.exports=function(t){require("source-map-support").install();var n=require("./modbus-basics"),i=require("debug")("contribModbus:flex:connector");t.nodes.registerType("modbus-flex-connector",function(e){t.nodes.createNode(this,e),this.name=e.name,this.maxReconnectsPerMinute=e.maxReconnectsPerMinute||4,this.emptyQueue=e.emptyQueue,this.showStatusActivities=e.showStatusActivities,this.showErrors=e.showErrors,this.connection=null,this.internalDebugLog=i,this.verboseLogging=t.settings.verbose;var o=this;n.setNodeStatusTo("waiting",o);var s=t.nodes.getNode(e.server);s&&(s.registerForModbus(o),n.initModbusClientEvents(o,s),o.onConfigDone=function(e){o.showStatusActivities&&n.setNodeStatusTo("config done",o),e.config_change="emitted",o.send(e)},o.onConfigError=function(e,t){i(e.message),o.showErrors&&o.error(e,t),e&&e.message?t.error=e:t.error=new Error(e),t.error.nodeStatus=o.statusText,o.emptyMsgOnFail&&(t.payload=""),o.send(t)},o.on("input",function(e){if(!n.invalidPayloadIn(e)&&s.client)if(o.showStatusActivities&&n.setNodeStatusTo(s.actualServiceState,o),e.payload.connectorType)i("dynamicReconnect: "+JSON.stringify(e.payload)),e.payload.emptyQueue=o.emptyQueue,s.emit("dynamicReconnect",e,o.onConfigDone,o.onConfigError);else{var t=new Error("Payload Not Valid - Connector Type");o.error(t,e),o.send(e)}}),o.showStatusActivities||n.setNodeDefaultStatus(o))})};
//# sourceMappingURL=maps/modbus-flex-connector.js.map

@@ -1,2 +0,2 @@

"use strict";module.exports=function(s){require("source-map-support").install();var o=require("./modbus-basics"),i=require("./core/modbus-core"),r=require("./core/modbus-io-core"),d=require("debug")("contribModbus:flex:getter");s.nodes.registerType("modbus-flex-getter",function(e){s.nodes.createNode(this,e),this.name=e.name,this.showStatusActivities=e.showStatusActivities,this.showErrors=e.showErrors,this.connection=null,this.useIOFile=e.useIOFile,this.ioFile=s.nodes.getNode(e.ioFile),this.useIOForPayload=e.useIOForPayload,this.logIOActivities=e.logIOActivities,this.emptyMsgOnFail=e.emptyMsgOnFail,this.internalDebugLog=d,this.verboseLogging=s.settings.verbose;var a=this;a.bufferMessageList=new Map,o.setNodeStatusTo("waiting",a);var t=s.nodes.getNode(e.server);t&&(t.registerForModbus(a),o.initModbusClientEvents(a,t),a.onModbusReadDone=function(e,s){a.showStatusActivities&&o.setNodeStatusTo("reading done",a),a.send(r.buildMessageWithIO(a,e.data,e,s))},a.onModbusReadError=function(e,s){d(e.message),a.showErrors&&a.error(e,s),o.emptyMsgOnFail(a,e,s),o.setModbusError(a,t,e,i.getOriginalMessage(a.bufferMessageList,s))},a.prepareMsg=function(e){return"string"==typeof e.payload&&(e.payload=JSON.parse(e.payload)),e.payload.fc=parseInt(e.payload.fc)||3,e.payload.unitid=parseInt(e.payload.unitid),e.payload.address=parseInt(e.payload.address)||0,e.payload.quantity=parseInt(e.payload.quantity)||1,e},a.isValidModbusMsg=function(e){var s=!0;return Number.isInteger(e.payload.fc)&&1<=e.payload.fc&&e.payload.fc<=4||(a.error("FC Not Valid",e),s&=!1),!s||Number.isInteger(e.payload.address)&&0<=e.payload.address&&e.payload.address<=65535||(a.error("Address Not Valid",e),s&=!1),!s||Number.isInteger(e.payload.quantity)&&1<=e.payload.quantity&&e.payload.quantity<=65535||(a.error("Quantity Not Valid",e),s&=!1),s},a.buildNewMessageObject=function(e,s){var a=Object.assign({},s);return a.topic=s.topic||e.id,a.payload={value:s.payload.value||s.value,unitid:s.payload.unitid,fc:s.payload.fc,address:s.payload.address,quantity:s.payload.quantity,messageId:s.messageId,emptyMsgOnFail:e.emptyMsgOnFail},a},a.on("input",function(s){if(!o.invalidPayloadIn(s)&&t.client){try{if(s=a.prepareMsg(s),a.isValidModbusMsg(s)){s.messageId=i.getObjectId(),a.bufferMessageList.set(s.messageId,s);var e=a.buildNewMessageObject(a,s);t.emit("readModbus",e,a.onModbusReadDone,a.onModbusReadError)}}catch(e){d(e.message),a.showErrors&&a.error(e,s),o.emptyMsgOnFail(a,e,s)}a.showStatusActivities&&o.setNodeStatusTo(t.actualServiceState,a)}}),a.on("close",function(e){o.setNodeStatusTo("closed",a),a.bufferMessageList.clear(),t.deregisterForModbus(a,e)}))})};
"use strict";module.exports=function(s){require("source-map-support").install();var i=require("./modbus-basics"),r=require("./core/modbus-core"),t=require("./core/modbus-io-core"),d=require("debug")("contribModbus:flex:getter");s.nodes.registerType("modbus-flex-getter",function(e){s.nodes.createNode(this,e),this.name=e.name,this.showStatusActivities=e.showStatusActivities,this.showErrors=e.showErrors,this.connection=null,this.useIOFile=e.useIOFile,this.ioFile=s.nodes.getNode(e.ioFile),this.useIOForPayload=e.useIOForPayload,this.logIOActivities=e.logIOActivities,this.emptyMsgOnFail=e.emptyMsgOnFail,this.internalDebugLog=d,this.verboseLogging=s.settings.verbose;var a=this;a.bufferMessageList=new Map,i.setNodeStatusTo("waiting",a);var o=s.nodes.getNode(e.server);o&&(o.registerForModbus(a),i.initModbusClientEvents(a,o),a.onModbusReadDone=function(e,s){a.showStatusActivities&&i.setNodeStatusTo("reading done",a),a.send(t.buildMessageWithIO(a,e.data,e,s))},a.onModbusReadError=function(e,s){d(e.message),a.showErrors&&a.error(e,s),i.sendEmptyMsgOnFail(a,e,s),i.setModbusError(a,o,e,r.getOriginalMessage(a.bufferMessageList,s))},a.prepareMsg=function(e){return"string"==typeof e.payload&&(e.payload=JSON.parse(e.payload)),e.payload.fc=parseInt(e.payload.fc)||3,e.payload.unitid=parseInt(e.payload.unitid),e.payload.address=parseInt(e.payload.address)||0,e.payload.quantity=parseInt(e.payload.quantity)||1,e},a.isValidModbusMsg=function(e){var s=!0;return Number.isInteger(e.payload.fc)&&1<=e.payload.fc&&e.payload.fc<=4||(a.error("FC Not Valid",e),s&=!1),!s||Number.isInteger(e.payload.address)&&0<=e.payload.address&&e.payload.address<=65535||(a.error("Address Not Valid",e),s&=!1),!s||Number.isInteger(e.payload.quantity)&&1<=e.payload.quantity&&e.payload.quantity<=65535||(a.error("Quantity Not Valid",e),s&=!1),s},a.buildNewMessageObject=function(e,s){return{topic:s.topic||e.id,payload:{value:s.payload.value||s.value,unitid:s.payload.unitid,fc:s.payload.fc,address:s.payload.address,quantity:s.payload.quantity,messageId:s.messageId,emptyMsgOnFail:e.emptyMsgOnFail}}},a.on("input",function(s){if(!i.invalidPayloadIn(s)&&o.client){var t=Object.assign({},s);try{if(s=a.prepareMsg(t),a.isValidModbusMsg(s)){s.messageId=r.getObjectId(),a.bufferMessageList.set(s.messageId,s);var e=a.buildNewMessageObject(a,s);o.emit("readModbus",e,a.onModbusReadDone,a.onModbusReadError)}}catch(e){d(e.message),a.showErrors&&a.error(e,s),i.sendEmptyMsgOnFail(a,e,t)}a.showStatusActivities&&i.setNodeStatusTo(o.actualServiceState,a)}}),a.on("close",function(e){i.setNodeStatusTo("closed",a),a.bufferMessageList.clear(),o.deregisterForModbus(a.id,e)}),a.showStatusActivities||i.setNodeDefaultStatus(a))})};
//# sourceMappingURL=maps/modbus-flex-getter.js.map

@@ -1,2 +0,2 @@

"use strict";module.exports=function(u){require("source-map-support").install();var d=require("modbus-serial"),c=require("./core/modbus-server-core"),l=require("./modbus-basics"),a=require("debug")("contribModbus:flex:server");try{u.nodes.registerType("modbus-flex-server",function(e){u.nodes.createNode(this,e);var r=require("vm2"),s=r.VM,t=r.VMScript;this.name=e.name,this.logEnabled=e.logEnabled,this.serverAddress=e.serverAddress||"0.0.0.0",this.serverPort=parseInt(e.serverPort),this.responseDelay=parseInt(e.responseDelay),this.delayUnit=e.delayUnit,this.unitId=e.unitId,this.minAddress=e.minAddress,this.splitAddress=e.splitAddress,this.showErrors=e.showErrors,this.funcGetCoil=new t(e.funcGetCoil).compile(),this.funcGetDiscreteInput=new t(e.funcGetDiscreteInput).compile(),this.funcGetInputRegister=new t(e.funcGetInputRegister).compile(),this.funcGetHoldingRegister=new t(e.funcGetHoldingRegister).compile(),this.funcSetCoil=new t(e.funcSetCoil).compile(),this.funcSetRegister=new t(e.funcSetRegister).compile(),this.internalDebugLog=a,this.verboseLogging=u.settings.verbose;var o=this;o.bufferFactor=c.bufferFactor,o.coilsBufferSize=parseInt(e.coilsBufferSize*c.bufferFactor),o.registersBufferSize=parseInt(e.registersBufferSize*c.bufferFactor),o.coils=Buffer.alloc(o.coilsBufferSize,0),o.registers=Buffer.alloc(o.registersBufferSize,0),o.modbusServer=null,l.setNodeStatusTo("initialized",o),o.vector={};var i=new s({sandbox:{node:o}});function n(e){return[{type:"holding",message:e,payload:o.registers.slice(o.splitAddress*c.bufferFactor)},{type:"coils",message:e,payload:o.coils.slice(0,o.splitAddress*c.bufferFactor)},{type:"input",message:e,payload:o.registers.slice(0,o.splitAddress*c.bufferFactor)},{type:"discrete",message:e,payload:o.coils.slice(o.splitAddress*c.bufferFactor)},{payload:"request",type:"message",message:e}]}i.run("node.vector.getCoil = "+e.funcGetCoil),i.run("node.vector.getDiscreteInput = "+e.funcGetDiscreteInput),i.run("node.vector.getInputRegister = "+e.funcGetInputRegister),i.run("node.vector.getHoldingRegister = "+e.funcGetHoldingRegister),i.run("node.vector.setCoil = "+e.funcSetCoil),i.run("node.vector.setRegister = "+e.funcSetRegister),o.startServer=function(){try{if(null===o.modbusServer){try{o.modbusServer=new d.ServerTCP(o.vector,{host:o.serverAddress,port:o.serverPort,debug:o.logEnabled,unitID:o.unitId})}catch(e){o.error(e,{payload:"server net error -> for port 502 on unix, you have to be a super user"})}o.modbusServer.on("socketError",function(e){a(e.message),o.showErrors&&o.warn(e),l.setNodeStatusTo("error",o),o.modbusServer.close(function(){o.startServer()})}),o.modbusServer._server.on("connection",function(e){a("Modbus Flex Server client connection"),e&&a("Modbus Flex Server client to "+JSON.stringify(e.address())+" from "+e.remoteAddress+" "+e.remotePort),l.setNodeStatusTo("active",o)})}}catch(e){a(e.message),o.showErrors&&o.warn(e),l.setNodeStatusTo("error",o)}null!=o.modbusServer?(a("Modbus Flex Server listening on modbus://"+o.serverAddress+":"+o.serverPort),l.setNodeStatusTo("initialized",o)):(a("Modbus Flex Server isn't ready"),l.setNodeStatusTo("error",o))},o.startServer(),o.on("input",function(e){c.isValidMemoryMessage(e)?(c.writeToFlexServerMemory(o,e),1!==e.payload.disableMsgOutput&&o.send(n(e))):(o.showErrors&&o.error("Is Not A Valid Memory Write Message To Server",e),e.payload.disableMsgOutput||o.send(n(e)))}),o.on("close",function(){l.setNodeStatusTo("closed",o),o.modbusServer._server&&o.modbusServer._server.close(),o.modbusServer=null})})}catch(e){a(e.message)}};
"use strict";module.exports=function(u){require("source-map-support").install();var d=require("modbus-serial"),c=require("./core/modbus-server-core"),l=require("./modbus-basics"),a=require("debug")("contribModbus:flex:server");try{u.nodes.registerType("modbus-flex-server",function(e){u.nodes.createNode(this,e);var r=require("vm2"),s=r.VM,t=r.VMScript;this.name=e.name,this.logEnabled=e.logEnabled,this.serverAddress=e.serverAddress||"0.0.0.0",this.serverPort=parseInt(e.serverPort),this.responseDelay=parseInt(e.responseDelay),this.delayUnit=e.delayUnit,this.unitId=e.unitId,this.minAddress=e.minAddress,this.splitAddress=e.splitAddress,this.showErrors=e.showErrors,this.funcGetCoil=new t(e.funcGetCoil).compile(),this.funcGetDiscreteInput=new t(e.funcGetDiscreteInput).compile(),this.funcGetInputRegister=new t(e.funcGetInputRegister).compile(),this.funcGetHoldingRegister=new t(e.funcGetHoldingRegister).compile(),this.funcSetCoil=new t(e.funcSetCoil).compile(),this.funcSetRegister=new t(e.funcSetRegister).compile(),this.internalDebugLog=a,this.verboseLogging=u.settings.verbose;var o=this;o.bufferFactor=c.bufferFactor,o.coilsBufferSize=parseInt(e.coilsBufferSize*c.bufferFactor),o.registersBufferSize=parseInt(e.registersBufferSize*c.bufferFactor),o.coils=Buffer.alloc(o.coilsBufferSize,0),o.registers=Buffer.alloc(o.registersBufferSize,0),o.modbusServer=null,l.setNodeStatusTo("initialized",o),o.vector={};var i=new s({sandbox:{node:o}});function n(e){return[{type:"holding",message:e,payload:o.registers.slice(o.splitAddress*c.bufferFactor)},{type:"coils",message:e,payload:o.coils.slice(0,o.splitAddress*c.bufferFactor)},{type:"input",message:e,payload:o.registers.slice(0,o.splitAddress*c.bufferFactor)},{type:"discrete",message:e,payload:o.coils.slice(o.splitAddress*c.bufferFactor)},{payload:"request",type:"message",message:e}]}i.run("node.vector.getCoil = "+e.funcGetCoil),i.run("node.vector.getDiscreteInput = "+e.funcGetDiscreteInput),i.run("node.vector.getInputRegister = "+e.funcGetInputRegister),i.run("node.vector.getHoldingRegister = "+e.funcGetHoldingRegister),i.run("node.vector.setCoil = "+e.funcSetCoil),i.run("node.vector.setRegister = "+e.funcSetRegister),o.startServer=function(){try{if(null===o.modbusServer){try{o.modbusServer=new d.ServerTCP(o.vector,{host:o.serverAddress,port:o.serverPort,debug:o.logEnabled,unitID:o.unitId})}catch(e){o.error(e,{payload:"server net error -> for port 502 on unix, you have to be a super user"})}o.modbusServer.on("socketError",function(e){a(e.message),o.showErrors&&o.warn(e),l.setNodeStatusTo("error",o),o.modbusServer.close(function(){o.startServer()})}),o.modbusServer._server.on("connection",function(e){a("Modbus Flex Server client connection"),e&&a("Modbus Flex Server client to "+JSON.stringify(e.address())+" from "+e.remoteAddress+" "+e.remotePort),l.setNodeStatusTo("active",o)})}o.showStatusActivities||l.setNodeDefaultStatus(o)}catch(e){a(e.message),o.showErrors&&o.warn(e),l.setNodeStatusTo("error",o)}null!=o.modbusServer?(a("Modbus Flex Server listening on modbus://"+o.serverAddress+":"+o.serverPort),l.setNodeStatusTo("initialized",o)):(a("Modbus Flex Server isn't ready"),l.setNodeStatusTo("error",o))},o.startServer(),o.on("input",function(e){c.isValidMemoryMessage(e)?(c.writeToFlexServerMemory(o,e),1!==e.payload.disableMsgOutput&&o.send(n(e))):(o.showErrors&&o.error("Is Not A Valid Memory Write Message To Server",e),e.payload.disableMsgOutput||o.send(n(e)))}),o.on("close",function(){l.setNodeStatusTo("closed",o),o.modbusServer._server&&o.modbusServer._server.close(),o.modbusServer=null})})}catch(e){a(e.message)}};
//# sourceMappingURL=maps/modbus-flex-server.js.map

@@ -1,2 +0,2 @@

"use strict";module.exports=function(a){require("source-map-support").install();var o=require("./modbus-basics"),r=require("./core/modbus-core"),i=require("debug")("contribModbus:flex:write");a.nodes.registerType("modbus-flex-write",function(e){a.nodes.createNode(this,e),this.name=e.name,this.showStatusActivities=e.showStatusActivities,this.showErrors=e.showErrors,this.emptyMsgOnFail=e.emptyMsgOnFail,this.internalDebugLog=i,this.verboseLogging=a.settings.verbose;var s=this;s.bufferMessageList=new Map,o.setNodeStatusTo("waiting",s);var t=a.nodes.getNode(e.server);t&&(t.registerForModbus(s),o.initModbusClientEvents(s,t),s.onModbusWriteDone=function(e,a){s.showStatusActivities&&o.setNodeStatusTo("writing done",s),s.send(r.buildMessage(s.bufferMessageList,a.payload,e,a))},s.onModbusWriteError=function(e,a){i(e.message),s.showErrors&&s.error(e,a),o.emptyMsgOnFail(s,e,a),o.setModbusError(s,t,e,r.getOriginalMessage(s.bufferMessageList,a))},s.prepareMsg=function(e){return"string"==typeof e.payload&&(e.payload=JSON.parse(e.payload)),e.payload.fc=parseInt(e.payload.fc),e.payload.unitid=parseInt(e.payload.unitid),e.payload.address=parseInt(e.payload.address),e.payload.quantity=parseInt(e.payload.quantity),e},s.isValidModbusMsg=function(e){var a=!0;return Number.isInteger(e.payload.fc)&&(5===e.payload.fc||6===e.payload.fc||15===e.payload.fc||16===e.payload.fc)||(s.error("FC Not Valid",e),a&=!1),!a||Number.isInteger(e.payload.address)&&0<=e.payload.address&&e.payload.address<=65535||(s.error("Address Not Valid",e),a&=!1),!a||Number.isInteger(e.payload.quantity)&&1<=e.payload.quantity&&e.payload.quantity<=65535||(s.error("Quantity Not Valid",e),a&=!1),a},s.setMsgPayloadFromHTTPRequests=function(e){return Object.prototype.hasOwnProperty.call(e.payload,"value")&&"string"==typeof e.payload.value&&("true"===e.payload.value||"false"===e.payload.value?e.payload.value="true"===e.payload.value:-1<e.payload.value.indexOf(",")&&(e.payload.value=JSON.parse(e.payload.value))),e},s.buildNewMessageObject=function(e,a){var s=Object.assign({},a);return s.topic=a.topic||e.id,s.payload={value:a.payload.value||a.value,unitid:a.payload.unitid,fc:a.payload.fc,address:a.payload.address,quantity:a.payload.quantity,messageId:a.messageId},s},s.on("input",function(a){if(!o.invalidPayloadIn(a)&&t.client){try{if(a=s.prepareMsg(a),s.isValidModbusMsg(a)){(a=s.setMsgPayloadFromHTTPRequests(a)).messageId=r.getObjectId(),s.bufferMessageList.set(a.messageId,a);var e=s.buildNewMessageObject(s,a);t.emit("writeModbus",e,s.onModbusWriteDone,s.onModbusWriteError)}}catch(e){i(e.message),s.showErrors&&s.error(e,a),o.emptyMsgOnFail(s,e,a)}s.showStatusActivities&&o.setNodeStatusTo(t.actualServiceState,s)}}),s.on("close",function(e){o.setNodeStatusTo("closed",s),s.bufferMessageList.clear(),t.deregisterForModbus(s,e)}))})};
"use strict";module.exports=function(a){require("source-map-support").install();var r=require("./modbus-basics"),i=require("./core/modbus-core"),d=require("debug")("contribModbus:flex:write");a.nodes.registerType("modbus-flex-write",function(e){a.nodes.createNode(this,e),this.name=e.name,this.showStatusActivities=e.showStatusActivities,this.showErrors=e.showErrors,this.emptyMsgOnFail=e.emptyMsgOnFail,this.internalDebugLog=d,this.verboseLogging=a.settings.verbose;var t=this;t.bufferMessageList=new Map,r.setNodeStatusTo("waiting",t);var o=a.nodes.getNode(e.server);o&&(o.registerForModbus(t),r.initModbusClientEvents(t,o),t.onModbusWriteDone=function(e,a){t.showStatusActivities&&r.setNodeStatusTo("writing done",t),t.send(i.buildMessage(t.bufferMessageList,a.payload,e,a))},t.onModbusWriteError=function(e,a){d(e.message),t.showErrors&&t.error(e,a),r.sendEmptyMsgOnFail(t,e,a),r.setModbusError(t,o,e,i.getOriginalMessage(t.bufferMessageList,a))},t.prepareMsg=function(e){return"string"==typeof e.payload&&(e.payload=JSON.parse(e.payload)),e.payload.fc=parseInt(e.payload.fc),e.payload.unitid=parseInt(e.payload.unitid),e.payload.address=parseInt(e.payload.address),e.payload.quantity=parseInt(e.payload.quantity),e},t.isValidModbusMsg=function(e){var a=!0;return Number.isInteger(e.payload.fc)&&(5===e.payload.fc||6===e.payload.fc||15===e.payload.fc||16===e.payload.fc)||(t.error("FC Not Valid",e),a&=!1),!a||Number.isInteger(e.payload.address)&&0<=e.payload.address&&e.payload.address<=65535||(t.error("Address Not Valid",e),a&=!1),!a||Number.isInteger(e.payload.quantity)&&1<=e.payload.quantity&&e.payload.quantity<=65535||(t.error("Quantity Not Valid",e),a&=!1),a},t.setMsgPayloadFromHTTPRequests=function(e){return Object.prototype.hasOwnProperty.call(e.payload,"value")&&"string"==typeof e.payload.value&&("true"===e.payload.value||"false"===e.payload.value?e.payload.value="true"===e.payload.value:-1<e.payload.value.indexOf(",")&&(e.payload.value=JSON.parse(e.payload.value))),e},t.buildNewMessageObject=function(e,a){return{topic:a.topic||e.id,payload:{value:a.payload.value||a.value,unitid:a.payload.unitid,fc:a.payload.fc,address:a.payload.address,quantity:a.payload.quantity,messageId:a.messageId}}},t.on("input",function(a){if(!r.invalidPayloadIn(a)&&o.client){var s=Object.assign({},a);try{if(a=t.prepareMsg(s),t.isValidModbusMsg(a)){(a=t.setMsgPayloadFromHTTPRequests(a)).messageId=i.getObjectId(),t.bufferMessageList.set(a.messageId,a);var e=t.buildNewMessageObject(t,a);o.emit("writeModbus",e,t.onModbusWriteDone,t.onModbusWriteError)}}catch(e){d(e.message),t.showErrors&&t.error(e,a),r.sendEmptyMsgOnFail(t,e,s)}t.showStatusActivities&&r.setNodeStatusTo(o.actualServiceState,t)}}),t.on("close",function(e){r.setNodeStatusTo("closed",t),t.bufferMessageList.clear(),o.deregisterForModbus(t.id,e)}),t.showStatusActivities||r.setNodeDefaultStatus(t))})};
//# sourceMappingURL=maps/modbus-flex-write.js.map

@@ -1,2 +0,2 @@

"use strict";module.exports=function(s){require("source-map-support").install();var o=require("./modbus-basics"),a=require("./core/modbus-core"),r=require("./core/modbus-io-core"),u=require("debug")("contribModbus:getter");s.nodes.registerType("modbus-getter",function(e){s.nodes.createNode(this,e),this.name=e.name,this.unitid=e.unitid,this.dataType=e.dataType,this.adr=e.adr,this.quantity=e.quantity,this.showStatusActivities=e.showStatusActivities,this.showErrors=e.showErrors,this.msgThruput=e.msgThruput,this.connection=null,this.useIOFile=e.useIOFile,this.ioFile=s.nodes.getNode(e.ioFile),this.useIOForPayload=e.useIOForPayload,this.logIOActivities=e.logIOActivities,this.emptyMsgOnFail=e.emptyMsgOnFail,this.internalDebugLog=u,this.verboseLogging=s.settings.verbose;var t=this;t.bufferMessageList=new Map,o.setNodeStatusTo("waiting",t);var i=s.nodes.getNode(e.server);i&&(i.registerForModbus(t),o.initModbusClientEvents(t,i),t.onModbusCommandDone=function(e,s){t.showStatusActivities&&o.setNodeStatusTo("reading done",t),t.send(r.buildMessageWithIO(t,e.data,e,s))},t.onModbusCommandError=function(e,s){u(e.message),t.showErrors&&t.error(e,s),o.emptyMsgOnFail(t,e,s),o.setModbusError(t,i,e,a.getOriginalMessage(t.bufferMessageList,s))},t.buildNewMessageObject=function(e,s){var t=Object.assign({},s);return t.topic=s.topic||e.id,t.payload={value:s.payload.value||s.payload,unitid:e.unitid,fc:a.functionCodeModbusRead(e.dataType),address:e.adr,quantity:e.quantity,messageId:s.messageId},t},t.on("input",function(e){o.invalidPayloadIn(e)||i.client&&(e.messageId=a.getObjectId(),t.bufferMessageList.set(e.messageId,e),e=t.buildNewMessageObject(t,e),i.emit("readModbus",e,t.onModbusCommandDone,t.onModbusCommandError),t.showStatusActivities&&o.setNodeStatusTo(i.actualServiceState,t))}),t.on("close",function(e){o.setNodeStatusTo("closed",t),t.bufferMessageList.clear(),i.deregisterForModbus(t,e)}))})};
"use strict";module.exports=function(s){require("source-map-support").install();var o=require("./modbus-basics"),a=require("./core/modbus-core"),r=require("./core/modbus-io-core"),u=require("debug")("contribModbus:getter");s.nodes.registerType("modbus-getter",function(e){s.nodes.createNode(this,e),this.name=e.name,this.unitid=e.unitid,this.dataType=e.dataType,this.adr=e.adr,this.quantity=e.quantity,this.showStatusActivities=e.showStatusActivities,this.showErrors=e.showErrors,this.msgThruput=e.msgThruput,this.connection=null,this.useIOFile=e.useIOFile,this.ioFile=s.nodes.getNode(e.ioFile),this.useIOForPayload=e.useIOForPayload,this.logIOActivities=e.logIOActivities,this.emptyMsgOnFail=e.emptyMsgOnFail,this.internalDebugLog=u,this.verboseLogging=s.settings.verbose;var t=this;t.bufferMessageList=new Map,o.setNodeStatusTo("waiting",t);var i=s.nodes.getNode(e.server);i&&(i.registerForModbus(t),o.initModbusClientEvents(t,i),t.onModbusCommandDone=function(e,s){t.showStatusActivities&&o.setNodeStatusTo("reading done",t),t.send(r.buildMessageWithIO(t,e.data,e,s))},t.onModbusCommandError=function(e,s){u(e.message),t.showErrors&&t.error(e,s),o.sendEmptyMsgOnFail(t,e,s),o.setModbusError(t,i,e,a.getOriginalMessage(t.bufferMessageList,s))},t.buildNewMessageObject=function(e,s){return{topic:s.topic||e.id,payload:{value:s.payload.value||s.payload,unitid:e.unitid,fc:a.functionCodeModbusRead(e.dataType),address:e.adr,quantity:e.quantity,messageId:s.messageId}}},t.on("input",function(e){if(!o.invalidPayloadIn(e)&&i.client){var s=Object.assign({},e);try{e.messageId=a.getObjectId(),t.bufferMessageList.set(e.messageId,e),e=t.buildNewMessageObject(t,e),i.emit("readModbus",e,t.onModbusCommandDone,t.onModbusCommandError),t.showStatusActivities&&o.setNodeStatusTo(i.actualServiceState,t)}catch(e){o.sendEmptyMsgOnFail(t,e,s)}}}),t.on("close",function(e){o.setNodeStatusTo("closed",t),t.bufferMessageList.clear(),i.deregisterForModbus(t.id,e)}),t.showStatusActivities||o.setNodeDefaultStatus(t))})};
//# sourceMappingURL=maps/modbus-getter.js.map

@@ -1,2 +0,2 @@

"use strict";module.exports=function(u){require("source-map-support").install();var n=require("./modbus-basics"),o=require("./core/modbus-queue-core"),h=require("debug")("contribModbus:queue");u.nodes.registerType("modbus-queue-info",function(e){u.nodes.createNode(this,e),this.name=e.name,this.topic=e.topic,this.unitid=parseInt(e.unitid),this.lowLowLevel=parseInt(e.lowLowLevel),this.lowLevel=parseInt(e.lowLevel),this.highLevel=parseInt(e.highLevel),this.highHighLevel=parseInt(e.highHighLevel),this.errorOnHighLevel=e.errorOnHighLevel,this.queueReadIntervalTime=e.queueReadIntervalTime||1e3,this.showStatusActivities=e.showStatusActivities,this.updateOnAllQueueChanges=e.updateOnAllQueueChanges,this.internalDebugLog=h;var i=this;i.queueReadInterval=null,i.updateStatusRrunning=!1,n.setNodeStatusTo("waiting",i);var a=u.nodes.getNode(e.server);a&&(a.registerForModbus(i),n.initModbusClientEvents(i,a),i.resetStates=function(){i.lowLowLevelReached=!0,i.lowLevelReached=!1,i.highLevelReached=!1,i.highHighLevelReached=!1},i.resetStates(),i.checkLowLevelReached=function(e,t,i){if(!e.lowLevelReached&&t>e.lowLowLevel&&t<e.lowLevel){e.lowLevelReached=!0;var u={payload:Date.now(),topic:e.topic,state:"low level reached",unitid:i,modbusClientName:a.name,items:t};e.send(u)}},i.checkHighLevelReached=function(e,t,i){if(!e.highLevelReached&&t>e.lowLevel&&t>e.highLevel){e.highLevelReached=!0;var u={payload:Date.now(),topic:e.topic,state:"high level reached",unitid:i,modbusClientName:a.name,highLevel:e.highLevel,items:t};e.errorOnHighLevel?e.error(new Error("Queue High Level Reached"),u):e.warn(u),e.send(u)}},i.checkHighHighLevelReached=function(e,t,i){if(!e.highHighLevelReached&&t>e.highLevel&&t>e.highHighLevel){e.highHighLevelReached=!0;var u={payload:Date.now(),topic:e.topic,state:"high high level reached",unitid:i,modbusClientName:a.name,highLevel:e.highLevel,highHighLevel:e.highHighLevel,items:t};e.error(new Error("Queue High High Level Reached"),u),e.send(u)}},i.getStatusSituationFillColor=function(){var e="blue";return i.lowLevelReached&&(e="green"),i.highLevelReached&&(e=i.errorOnHighLevel?"red":"yellow"),i.highHighLevelReached&&(e="red"),e},i.readFromQueue=function(){if(!i.updateStatusRrunning){i.updateStatusRrunning=!0;var e=i.unitid||1;if(a.bufferCommands){(e<1||255<e)&&(e=1);var t=a.bufferCommandList.get(e).length;(!t||!i.lowLowLevelReached&&t<i.lowLowLevel)&&i.resetStates(),i.checkLowLevelReached(i,t,e),i.checkHighLevelReached(i,t,e),i.checkHighHighLevelReached(i,t,e),i.showStatusActivities&&i.status({fill:i.getStatusSituationFillColor(),shape:"ring",text:"active unit "+e+" queue items: "+t})}else i.showStatusActivities&&n.setNodeStatusTo("active unit "+e+" without queue",i);i.updateStatusRrunning=!1}},a.on("mbinit",i.readFromQueue),a.on("mbconnected",i.readFromQueue),a.on("mberror",i.readFromQueue),i.updateOnAllQueueChanges&&a.on("mbactive",i.readFromQueue),a.on("mbclosed",i.readFromQueue),i.queueReadInterval=setInterval(i.readFromQueue,i.queueReadIntervalTime),i.on("input",function(e){if(e.queueEnabled=a.bufferCommands,Number.isInteger(i.unitid)?(e.queue=a.bufferCommandList.get(i.unitid),e.unitid=i.unitid):e.queues=a.bufferCommandList,e.queueOptions={date:Date.now(),state:"queue request",modbusClientName:a.name,lowlowLevel:i.lowlowLevel,lowLevel:i.lowLevel,highLevel:i.highLevel,highHighLevel:i.highHighLevel},e&&e.resetQueue&&a.bufferCommands){if(o.initQueue(a),u.settings.verbose){var t="Init Queue By External Node";a.warn(t),h(t)}i.resetStates(),i.showStatusActivities&&i.status({fill:"blue",shape:"ring",text:"active empty unit queue"}),e.queueOptions.state="queue reset done"}i.send(e)}),i.on("close",function(e){n.setNodeStatusTo("closed",i),i.queueReadInterval&&clearInterval(i.queueReadInterval),i.queueReadInterval=null,a.deregisterForModbus(i,e)}))})};
"use strict";module.exports=function(u){require("source-map-support").install();var o=require("./modbus-basics"),h=require("./core/modbus-queue-core"),n=require("debug")("contribModbus:queue");u.nodes.registerType("modbus-queue-info",function(e){u.nodes.createNode(this,e),this.name=e.name,this.topic=e.topic,this.unitid=parseInt(e.unitid),this.lowLowLevel=parseInt(e.lowLowLevel),this.lowLevel=parseInt(e.lowLevel),this.highLevel=parseInt(e.highLevel),this.highHighLevel=parseInt(e.highHighLevel),this.errorOnHighLevel=e.errorOnHighLevel,this.queueReadIntervalTime=e.queueReadIntervalTime||1e3,this.showStatusActivities=e.showStatusActivities,this.updateOnAllQueueChanges=e.updateOnAllQueueChanges,this.internalDebugLog=n;var i=this;i.queueReadInterval=null,i.updateStatusRrunning=!1,o.setNodeStatusTo("waiting",i);var a=u.nodes.getNode(e.server);a&&(a.registerForModbus(i),i.resetStates=function(){i.lowLowLevelReached=!0,i.lowLevelReached=!1,i.highLevelReached=!1,i.highHighLevelReached=!1},i.resetStates(),i.checkLowLevelReached=function(e,t,i){if(!e.lowLevelReached&&t>e.lowLowLevel&&t<e.lowLevel){e.lowLevelReached=!0;var u={payload:Date.now(),topic:e.topic,state:"low level reached",unitid:i,modbusClientName:a.name,items:t};e.send(u)}},i.checkHighLevelReached=function(e,t,i){if(!e.highLevelReached&&t>e.lowLevel&&t>e.highLevel){e.highLevelReached=!0;var u={payload:Date.now(),topic:e.topic,state:"high level reached",unitid:i,modbusClientName:a.name,highLevel:e.highLevel,items:t};e.errorOnHighLevel?e.error(new Error("Queue High Level Reached"),u):e.warn(u),e.send(u)}},i.checkHighHighLevelReached=function(e,t,i){if(!e.highHighLevelReached&&t>e.highLevel&&t>e.highHighLevel){e.highHighLevelReached=!0;var u={payload:Date.now(),topic:e.topic,state:"high high level reached",unitid:i,modbusClientName:a.name,highLevel:e.highLevel,highHighLevel:e.highHighLevel,items:t};e.error(new Error("Queue High High Level Reached"),u),e.send(u)}},i.getStatusSituationFillColor=function(){var e="blue";return i.lowLevelReached&&(e="green"),i.highLevelReached&&(e=i.errorOnHighLevel?"red":"yellow"),i.highHighLevelReached&&(e="red"),e},i.readFromQueue=function(){if(!i.updateStatusRrunning){i.updateStatusRrunning=!0;var e=i.unitid||1;if(a.bufferCommands){(e<1||255<e)&&(e=1);var t=a.bufferCommandList.get(e).length;(!t||!i.lowLowLevelReached&&t<i.lowLowLevel)&&i.resetStates(),i.checkLowLevelReached(i,t,e),i.checkHighLevelReached(i,t,e),i.checkHighHighLevelReached(i,t,e),i.showStatusActivities&&i.status({fill:i.getStatusSituationFillColor(),shape:"ring",text:"active unit "+e+" queue items: "+t})}else i.showStatusActivities&&o.setNodeStatusTo("active unit "+e+" without queue",i);i.updateStatusRrunning=!1}},a.on("mbinit",i.readFromQueue),a.on("mbconnected",i.readFromQueue),i.updateOnAllQueueChanges&&(a.on("mbactive",i.readFromQueue),a.on("mbqueue",i.readFromQueue)),a.on("mberror",i.readFromQueue),a.on("mbclosed",i.readFromQueue),i.queueReadInterval=setInterval(i.readFromQueue,i.queueReadIntervalTime),i.on("input",function(e){if(e.queueEnabled=a.bufferCommands,Number.isInteger(i.unitid)?(e.queue=a.bufferCommandList.get(i.unitid),e.unitid=i.unitid):e.queues=a.bufferCommandList,e.queueOptions={date:Date.now(),state:"queue request",modbusClientName:a.name,lowlowLevel:i.lowlowLevel,lowLevel:i.lowLevel,highLevel:i.highLevel,highHighLevel:i.highHighLevel},e&&e.resetQueue&&a.bufferCommands){if(h.initQueue(a),u.settings.verbose){var t="Init Queue By External Node";a.warn(t),n(t)}i.resetStates(),i.showStatusActivities&&i.status({fill:"blue",shape:"ring",text:"active empty unit queue"}),e.queueOptions.state="queue reset done"}i.send(e)}),i.on("close",function(e){o.setNodeStatusTo("closed",i),i.queueReadInterval&&clearInterval(i.queueReadInterval),i.queueReadInterval=null,a.deregisterForModbus(i.id,e)}),i.showStatusActivities||o.setNodeDefaultStatus(i))})};
//# sourceMappingURL=maps/modbus-queue-info.js.map

@@ -1,2 +0,2 @@

"use strict";module.exports=function(r){require("source-map-support").install();var u=require("./modbus-basics"),d=require("./core/modbus-core"),l=require("./core/modbus-io-core"),c=require("debug")("contribModbus:read");r.nodes.registerType("modbus-read",function(e){r.nodes.createNode(this,e),this.name=e.name,this.topic=e.topic,this.unitid=e.unitid,this.dataType=e.dataType,this.adr=e.adr,this.quantity=e.quantity||1,this.rate=e.rate,this.rateUnit=e.rateUnit,this.delayOnStart=e.delayOnStart,this.startDelayTime=parseInt(e.startDelayTime)||10,this.showStatusActivities=e.showStatusActivities,this.showErrors=e.showErrors,this.connection=null,this.useIOFile=e.useIOFile,this.ioFile=r.nodes.getNode(e.ioFile),this.useIOForPayload=e.useIOForPayload,this.logIOActivities=e.logIOActivities,this.internalDebugLog=c,this.verboseLogging=r.settings.verbose;var a=this,t=null,o=null,n=!1;a.INPUT_TIMEOUT_MILLISECONDS=1e3,a.statusText="waiting",u.setNodeStatusTo(a.statusText,a);var s=r.nodes.getNode(e.server);function i(e){if("polling"!==e||!n){var t=u.setNodeStatusProperties(e,a.showStatusActivities),o=a.statusText;if(-1!==e.search("active")||"polling"===e){var s=t.status+(" ( "+a.rate+" "+u.get_timeUnit_name(a.rateUnit))+" ) ";n=!1,s!==o&&a.status({fill:t.fill,shape:t.shape,text:s})}else{var i=t.status;i!==o&&a.status({fill:t.fill,shape:t.shape,text:i})}}}s&&(s.registerForModbus(a),u.initModbusClientEvents(a,s),a.onModbusInit=function(){u.setNodeStatusTo("initialize",a)},a.onModbusConnect=function(){a.delayOnStart?t=(t&&clearTimeout(t),setTimeout(a.startIntervalReading,a.INPUT_TIMEOUT_MILLISECONDS*a.startDelayTime)):(t&&clearTimeout(t),a.startIntervalReading()),i("connected")},a.startIntervalReading=function(){o=o||setInterval(a.modbusPollingRead,u.calc_rateByUnit(a.rate,a.rateUnit))},a.onModbusActive=function(){i("active")},a.onModbusError=function(e){u.setNodeStatusTo("failure",a),s.reconnectOnTimeout&&(o&&clearInterval(o),o=null),a.showErrors&&a.warn(e)},a.onModbusClose=function(){u.setNodeStatusTo("closed",a),o&&clearInterval(o),o=null},a.onModbusBroken=function(){s.reconnectOnTimeout&&(u.setNodeStatusTo("reconnecting after "+s.reconnectTimeout+" msec.",a),o&&clearInterval(o),o=null)},s.on("mbinit",a.onModbusInit),s.on("mbconnected",a.onModbusConnect),s.on("mbactive",a.onModbusActive),s.on("mbqueue",a.onModbusActive),s.on("mberror",a.onModbusError),s.on("mbclosed",a.onModbusClose),a.modbusPollingRead=function(){if(s.client){var e={topic:a.topic||"polling",from:a.name,payload:{unitid:a.unitid,fc:d.functionCodeModbusRead(a.dataType),address:a.adr,quantity:a.quantity,messageId:d.getObjectId()}};a.showStatusActivities&&i("polling"),s.emit("readModbus",e,a.onModbusReadDone,a.onModbusReadError)}else i("waiting")},a.onModbusReadDone=function(e,t){a.showStatusActivities&&i("reading done"),function(e,t,o){if(a.useIOFile&&a.ioFile.lastUpdatedAt){a.logIOActivities&&l.internalDebug("node.adr:"+a.adr+" node.quantity:"+a.quantity);var s=l.nameValuesFromIOFile(a,o,e,t,a.adr),i=l.filterValueNames(a,s,d.functionCodeModbusRead(a.dataType),a.adr,a.quantity),n={topic:o.topic,responseBuffer:t,input:o};a.useIOForPayload?(n.payload=i,n.values=e):(n.payload=e,n.valueNames=i),a.send([n,{payload:t,values:e,input:o,valueNames:i}])}else a.send([{payload:e,responseBuffer:t,input:o},{payload:t,values:e,input:o}])}(e.data,e,t)},a.onModbusReadError=function(e,t){c(e.message),a.showErrors&&a.error(e,t),u.setModbusError(a,s,e,t)},a.on("close",function(e){o&&clearInterval(o),o=null,u.setNodeStatusTo("closed",a),s.deregisterForModbus(a,e)}))}),r.httpAdmin.post("/modbus/read/inject/:id",r.auth.needsPermission("modbus.inject.write"),function(e,t){var o=r.nodes.getNode(e.params.id);if(o)try{o.modbusPollingRead(),t.sendStatus(200)}catch(e){t.sendStatus(500),o.error(r._("modbusinject.failed",{error:e.toString()}))}else t.sendStatus(404)})};
"use strict";module.exports=function(r){require("source-map-support").install();var d=require("./modbus-basics"),u=require("./core/modbus-core"),l=require("./core/modbus-io-core"),c=require("debug")("contribModbus:read");r.nodes.registerType("modbus-read",function(e){r.nodes.createNode(this,e),this.name=e.name,this.topic=e.topic,this.unitid=e.unitid,this.dataType=e.dataType,this.adr=e.adr,this.quantity=e.quantity||1,this.rate=e.rate,this.rateUnit=e.rateUnit,this.delayOnStart=e.delayOnStart,this.startDelayTime=parseInt(e.startDelayTime)||10,this.showStatusActivities=e.showStatusActivities,this.showErrors=e.showErrors,this.connection=null,this.useIOFile=e.useIOFile,this.ioFile=r.nodes.getNode(e.ioFile),this.useIOForPayload=e.useIOForPayload,this.logIOActivities=e.logIOActivities,this.internalDebugLog=c,this.verboseLogging=r.settings.verbose;var a=this,t=null,o=null,s=!1;a.modbusReadNodeInit=!0,a.INPUT_TIMEOUT_MILLISECONDS=1e3,a.statusText="waiting",n(a.statusText);var i=r.nodes.getNode(e.server);function n(e){if("polling"!==e||!s){var t=d.setNodeStatusProperties(e,a.showStatusActivities),o=a.statusText;if(-1!==e.search("active")||"polling"===e){var i=t.status+(" ( "+a.rate+" "+d.get_timeUnit_name(a.rateUnit))+" ) ";s=!1,i!==o&&a.status({fill:t.fill,shape:t.shape,text:i})}else{var n=t.status;n!==o&&a.status({fill:t.fill,shape:t.shape,text:n})}}}i&&(i.registerForModbus(a),a.onModbusInit=function(){n("initialized")},a.initializeReadingTimer=function(){a.modbusReadNodeInit=!1,a.delayOnStart?(t&&clearTimeout(t),t=setTimeout(a.startIntervalReading,a.INPUT_TIMEOUT_MILLISECONDS*a.startDelayTime)):(t&&clearTimeout(t),a.startIntervalReading())},a.onModbusConnect=function(){a.initializeReadingTimer(),n("connected")},a.startIntervalReading=function(){a.resetIntervalToRead(),o=o||setInterval(a.modbusPollingRead,d.calc_rateByUnit(a.rate,a.rateUnit))},a.onModbusActive=function(){a.modbusReadNodeInit&&a.initializeReadingTimer(),n("active")},a.onModbusQueue=function(){n("queue")},a.onModbusError=function(e){n("failure"),i.reconnectOnTimeout&&a.resetIntervalToRead(),a.showErrors&&a.warn(e)},a.onModbusClose=function(){n("closed"),a.resetIntervalToRead()},a.resetIntervalToRead=function(){o&&clearInterval(o),o=null},a.onModbusBroken=function(){n("broken"),i.reconnectOnTimeout&&(n("reconnecting after "+i.reconnectTimeout+" msec."),a.resetIntervalToRead())},a.showStatusActivities&&(i.on("mbinit",a.onModbusInit),i.on("mbqueue",a.onModbusQueue)),i.on("mbconnected",a.onModbusConnect),i.on("mbactive",a.onModbusActive),i.on("mberror",a.onModbusError),i.on("mbclosed",a.onModbusClose),i.on("mbbroken",a.onModbusBroken),a.modbusPollingRead=function(){if(i.client){var e={topic:a.topic||"polling",from:a.name,payload:{unitid:a.unitid,fc:u.functionCodeModbusRead(a.dataType),address:a.adr,quantity:a.quantity,messageId:u.getObjectId()}};a.showStatusActivities&&n("polling"),i.emit("readModbus",e,a.onModbusReadDone,a.onModbusReadError)}else n("waiting")},a.onModbusReadDone=function(e,t){a.showStatusActivities&&n("reading done"),function(e,t,o){if(a.useIOFile&&a.ioFile.lastUpdatedAt){a.logIOActivities&&l.internalDebug("node.adr:"+a.adr+" node.quantity:"+a.quantity);var i=l.nameValuesFromIOFile(a,o,e,t,a.adr),n=l.filterValueNames(a,i,u.functionCodeModbusRead(a.dataType),a.adr,a.quantity),s={topic:o.topic,responseBuffer:t,input:o};a.useIOForPayload?(s.payload=n,s.values=e):(s.payload=e,s.valueNames=n),a.send([s,{payload:t,values:e,input:o,valueNames:n}])}else a.send([{payload:e,responseBuffer:t,input:o},{payload:t,values:e,input:o}])}(e.data,e,t)},a.onModbusReadError=function(e,t){c(e.message),a.showErrors&&a.error(e,t),d.setModbusError(a,i,e,t)},a.on("close",function(e){a.resetIntervalToRead(),n("closed"),i.deregisterForModbus(a.id,e)}))}),r.httpAdmin.post("/modbus/read/inject/:id",r.auth.needsPermission("modbus.inject.write"),function(e,t){var o=r.nodes.getNode(e.params.id);if(o)try{o.modbusPollingRead(),t.sendStatus(200)}catch(e){t.sendStatus(500),o.error(r._("modbusinject.failed",{error:e.toString()}))}else t.sendStatus(404)})};
//# sourceMappingURL=maps/modbus-read.js.map

@@ -1,2 +0,2 @@

"use strict";module.exports=function(t){require("source-map-support").install();var i=require("jsmodbus"),n=require("net"),a=require("./core/modbus-server-core"),u=require("./modbus-basics"),l=require("debug")("contribModbus:server");try{t.nodes.registerType("modbus-server",function(e){t.nodes.createNode(this,e),this.name=e.name,this.logEnabled=e.logEnabled,this.hostname=e.hostname||"0.0.0.0",this.serverPort=parseInt(e.serverPort),this.responseDelay=parseInt(e.responseDelay)||1,this.delayUnit=e.delayUnit,this.coilsBufferSize=parseInt(8*e.coilsBufferSize),this.holdingBufferSize=parseInt(8*e.holdingBufferSize),this.inputBufferSize=parseInt(8*e.inputBufferSize),this.discreteBufferSize=parseInt(8*e.discreteBufferSize),this.showErrors=e.showErrors,this.internalDebugLog=l,this.verboseLogging=t.settings.verbose;var r=this;r.netServer=null,r.modbusServer=null,u.setNodeStatusTo("initialized",r);var s="warn";t.settings.verbose&&(s="debug");try{r.netServer=new n.Server,r.modbusServer=new i.server.TCP(r.netServer,{logLabel:"ModbusServer",logLevel:s,logEnabled:r.logEnabled,responseDelay:u.calc_rateByUnit(r.responseDelay,r.delayUnit),coils:Buffer.alloc(r.coilsBufferSize,0),holding:Buffer.alloc(r.holdingBufferSize,0),input:Buffer.alloc(r.inputBufferSize,0),discrete:Buffer.alloc(r.discreteBufferSize,0)}),r.modbusServer.on("connection",function(e){l("Modbus Server client connection"),e&&e.socket&&l("Modbus Server client to "+JSON.stringify(e.socket.address())+" from "+e.socket.remoteAddress+" "+e.socket.remotePort),u.setNodeStatusTo("active",r)}),r.netServer.listen(r.serverPort,r.hostname,function(){l("Modbus Server listening on modbus://"+r.hostname+":"+r.serverPort),u.setNodeStatusTo("initialized",r)})}catch(e){l(e.message),r.showErrors&&r.warn(e),u.setNodeStatusTo("error",r)}function o(e){return[{type:"holding",message:e,payload:r.modbusServer.holding},{type:"coils",message:e,payload:r.modbusServer.coils},{type:"input",message:e,payload:r.modbusServer.input},{type:"discrete",message:e,payload:r.modbusServer.discrete},{payload:"request",type:"message",message:e}]}r.on("input",function(e){a.isValidMemoryMessage(e)?a.writeToServerMemory(r,e):r.showErrors&&r.error("Is Not A Valid Memory Write Message To Server",e),e.payload.disableMsgOutput||r.send(o(e))}),r.on("close",function(e){u.setNodeStatusTo("closed",r),r.netServer&&r.netServer.close(function(){l("Modbus Server closed"),e()}),r.modbusServer=null})})}catch(e){l(e.message)}};
"use strict";module.exports=function(o){require("source-map-support").install();var i=require("jsmodbus"),n=require("net"),a=require("./core/modbus-server-core"),u=require("./modbus-basics"),l=require("debug")("contribModbus:server");try{o.nodes.registerType("modbus-server",function(e){o.nodes.createNode(this,e),this.name=e.name,this.logEnabled=e.logEnabled,this.hostname=e.hostname||"0.0.0.0",this.serverPort=parseInt(e.serverPort),this.responseDelay=parseInt(e.responseDelay)||1,this.delayUnit=e.delayUnit,this.coilsBufferSize=parseInt(8*e.coilsBufferSize),this.holdingBufferSize=parseInt(8*e.holdingBufferSize),this.inputBufferSize=parseInt(8*e.inputBufferSize),this.discreteBufferSize=parseInt(8*e.discreteBufferSize),this.showErrors=e.showErrors,this.internalDebugLog=l,this.verboseLogging=o.settings.verbose;var r=this;r.netServer=null,r.modbusServer=null,u.setNodeStatusTo("initialized",r);var s="warn";o.settings.verbose&&(s="debug");try{r.netServer=new n.Server,r.modbusServer=new i.server.TCP(r.netServer,{logLabel:"ModbusServer",logLevel:s,logEnabled:r.logEnabled,responseDelay:u.calc_rateByUnit(r.responseDelay,r.delayUnit),coils:Buffer.alloc(r.coilsBufferSize,0),holding:Buffer.alloc(r.holdingBufferSize,0),input:Buffer.alloc(r.inputBufferSize,0),discrete:Buffer.alloc(r.discreteBufferSize,0)}),r.modbusServer.on("connection",function(e){l("Modbus Server client connection"),e&&e.socket&&l("Modbus Server client to "+JSON.stringify(e.socket.address())+" from "+e.socket.remoteAddress+" "+e.socket.remotePort),u.setNodeStatusTo("active",r)}),r.netServer.listen(r.serverPort,r.hostname,function(){l("Modbus Server listening on modbus://"+r.hostname+":"+r.serverPort),u.setNodeStatusTo("initialized",r)}),r.showStatusActivities||u.setNodeDefaultStatus(r)}catch(e){l(e.message),r.showErrors&&r.warn(e),u.setNodeStatusTo("error",r)}function t(e){return[{type:"holding",message:e,payload:r.modbusServer.holding},{type:"coils",message:e,payload:r.modbusServer.coils},{type:"input",message:e,payload:r.modbusServer.input},{type:"discrete",message:e,payload:r.modbusServer.discrete},{payload:"request",type:"message",message:e}]}r.on("input",function(e){a.isValidMemoryMessage(e)?a.writeToServerMemory(r,e):r.showErrors&&r.error("Is Not A Valid Memory Write Message To Server",e),e.payload.disableMsgOutput||r.send(t(e))}),r.on("close",function(e){u.setNodeStatusTo("closed",r),r.netServer&&r.netServer.close(function(){l("Modbus Server closed"),e()}),r.modbusServer=null})})}catch(e){l(e.message)}};
//# sourceMappingURL=maps/modbus-server.js.map

@@ -1,2 +0,2 @@

"use strict";module.exports=function(s){require("source-map-support").install();var o=require("./modbus-basics"),i=require("./core/modbus-core"),r=require("debug")("contribModbus:write");s.nodes.registerType("modbus-write",function(e){s.nodes.createNode(this,e),this.name=e.name,this.showStatusActivities=e.showStatusActivities,this.showErrors=e.showErrors,this.unitid=e.unitid,this.dataType=e.dataType,this.adr=Number(e.adr),this.quantity=e.quantity,this.internalDebugLog=r,this.verboseLogging=s.settings.verbose;var t=this;t.bufferMessageList=new Map,o.setNodeStatusTo("waiting",t);var a=s.nodes.getNode(e.server);a&&(a.registerForModbus(t),o.initModbusClientEvents(t,a),t.onModbusWriteDone=function(e,s){t.showStatusActivities&&o.setNodeStatusTo("write done",t),t.send(i.buildMessage(t.bufferMessageList,s.payload,e,s))},t.onModbusWriteError=function(e,s){r(e.message),t.showErrors&&t.error(e,s),o.setModbusError(t,a,e,i.getOriginalMessage(t.bufferMessageList,s))},t.on("input",function(e){o.invalidPayloadIn(e)||a.client&&(Object.prototype.hasOwnProperty.call(e.payload,"value")&&"string"==typeof e.payload.value&&("true"===e.payload.value||"false"===e.payload.value?e.payload.value="true"===e.payload.value:-1<e.payload.value.indexOf(",")&&(e.payload.value=JSON.parse(e.payload.value))),e.messageId=i.getObjectId(),t.bufferMessageList.set(e.messageId,e),e={payload:{value:e.payload.value||e.payload,unitid:t.unitid,fc:i.functionCodeModbusWrite(t.dataType),address:t.adr,quantity:t.quantity,messageId:e.messageId},_msgid:e._msgid},a.emit("writeModbus",e,t.onModbusWriteDone,t.onModbusWriteError),t.showStatusActivities&&o.setNodeStatusTo(a.actualServiceState,t))}),t.on("close",function(e){o.setNodeStatusTo("closed",t),t.bufferMessageList.clear(),a.deregisterForModbus(t,e)}))})};
"use strict";module.exports=function(t){require("source-map-support").install();var i=require("./modbus-basics"),o=require("./core/modbus-core"),r=require("debug")("contribModbus:write");t.nodes.registerType("modbus-write",function(e){t.nodes.createNode(this,e),this.name=e.name,this.showStatusActivities=e.showStatusActivities,this.showErrors=e.showErrors,this.unitid=e.unitid,this.dataType=e.dataType,this.adr=Number(e.adr),this.quantity=e.quantity,this.emptyMsgOnFail=e.emptyMsgOnFail,this.internalDebugLog=r,this.verboseLogging=t.settings.verbose;var s=this;s.bufferMessageList=new Map,i.setNodeStatusTo("waiting",s);var a=t.nodes.getNode(e.server);a&&(a.registerForModbus(s),i.initModbusClientEvents(s,a),s.onModbusWriteDone=function(e,t){s.showStatusActivities&&i.setNodeStatusTo("write done",s),s.send(o.buildMessage(s.bufferMessageList,t.payload,e,t))},s.onModbusWriteError=function(e,t){r(e.message),s.showErrors&&s.error(e,t),i.sendEmptyMsgOnFail(s,e,t),i.setModbusError(s,a,e,o.getOriginalMessage(s.bufferMessageList,t))},s.setMsgPayloadFromHTTPRequests=function(e){return Object.prototype.hasOwnProperty.call(e.payload,"value")&&"string"==typeof e.payload.value&&("true"===e.payload.value||"false"===e.payload.value?e.payload.value="true"===e.payload.value:-1<e.payload.value.indexOf(",")&&(e.payload.value=JSON.parse(e.payload.value))),e},s.buildNewMessageObject=function(e,t){return{topic:t.topic||e.id,payload:{value:t.payload.value||t.payload,unitid:e.unitid,fc:o.functionCodeModbusWrite(e.dataType),address:e.adr,quantity:e.quantity,messageId:t.messageId}}},s.on("input",function(e){var t=Object.assign({},e);if(!i.invalidPayloadIn(e)&&a.client)try{(e=s.setMsgPayloadFromHTTPRequests(t)).messageId=o.getObjectId(),s.bufferMessageList.set(e.messageId,e),e=s.buildNewMessageObject(s,e),a.emit("writeModbus",e,s.onModbusWriteDone,s.onModbusWriteError),s.showStatusActivities&&i.setNodeStatusTo(a.actualServiceState,s)}catch(e){i.sendEmptyMsgOnFail(s,e,t)}}),s.on("close",function(e){i.setNodeStatusTo("closed",s),s.bufferMessageList.clear(),a.deregisterForModbus(s.id,e)}),s.showStatusActivities||i.setNodeDefaultStatus(s))})};
//# sourceMappingURL=maps/modbus-write.js.map
{
"name": "node-red-contrib-modbus",
"version": "5.8.0",
"version": "5.9.0",
"private": false,

@@ -69,3 +69,3 @@ "description": "The all in one Modbus TCP and Serial contribution package for Node-RED.",

"build": "standard --fix && gulp",
"prepublishOnly": "standard --fix && npm run build && npm test && mocha test --recursive --timeout 5000 --reporter dot && istanbul cover _mocha -- --recursive --timeout 5000",
"prepublishOnly": "standard --fix && npm run build && npm run rewrite-changelog && npm test && mocha test --recursive --timeout 5000 --reporter dot && istanbul cover _mocha -- --recursive --timeout 5000",
"ci-publish": "ci-publish",

@@ -72,0 +72,0 @@ "release": "standard-version -a",

@@ -13,2 +13,3 @@ ![Platform Node-RED](http://b.repl.ca/v1/Platform-Node--RED-red.png)

[![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/biancode/node-red-contrib-modbus.svg)](http://isitmaintained.com/project/biancode/node-red-contrib-modbus "Average time to resolve an issue")
[![Gitpod Ready-to-Code](https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/BiancoRoyal/node-red-contrib-modbus)

@@ -15,0 +16,0 @@ # node-red-contrib-modbus

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc