BiancoRoyal / node-red-contrib-modbus

maintained by PLUS for Node-RED - https://plus4nodered.com
https://www.npmjs.com/package/node-red-contrib-modbus
BSD 3-Clause "New" or "Revised" License
303 stars 110 forks source link

Flex Getter not changing unitid #496

Open terrymlyntelelectronics opened 1 month ago

terrymlyntelelectronics commented 1 month ago

Which node-red-contrib-modbus version are you using?

"node-red-contrib-modbus": "~5.42.0"

What happened?

using Flex Getter on com6 (USB /RS485 converter) to read from 2 devices (each with their own USB/RS485 converter) and slave nodes ( Using 2 separate functions to pre-load flex-getter with a different unitid. After deployment, whichever unit id is injected first (say unitid : 11) works as expected. The second does not work. Re-deploy and change the order (say unitid : 12) and this one now works.

Server

Other/External server

How can this be reproduced?

[ { "id": "43d026fe599216ef", "type": "tab", "label": "Flow 1", "disabled": false, "info": "", "env": [] }, { "id": "9d18b5769a8d9d3b", "type": "debug", "z": "43d026fe599216ef", "name": "debug", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "payload", "targetType": "msg", "statusVal": "", "statusType": "auto", "x": 1210, "y": 220, "wires": [] }, { "id": "4dd66e87ac7b26c3", "type": "inject", "z": "43d026fe599216ef", "name": "get UID 11", "props": [ { "p": "payload" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "true", "payloadType": "bool", "x": 640, "y": 160, "wires": [ [ "cfb3c829684bb429" ] ] }, { "id": "cfb3c829684bb429", "type": "function", "z": "43d026fe599216ef", "name": "function 1", "func": "msg.payload = \n { \n 'fc': 3,\n 'unitid': 11,\n 'address': 40021 ,\n 'quantity': 8\n } \n\nreturn msg ", "outputs": 1, "timeout": 0, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 820, "y": 160, "wires": [ [ "74b8c73d803ef256" ] ] }, { "id": "27d7262c91dc6211", "type": "inject", "z": "43d026fe599216ef", "name": "get UID 12", "props": [ { "p": "payload" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "true", "payloadType": "bool", "x": 640, "y": 220, "wires": [ [ "b4d63888b141b0be" ] ] }, { "id": "b4d63888b141b0be", "type": "function", "z": "43d026fe599216ef", "name": "function 2", "func": "msg.payload = \n { \n 'fc': 3,\n 'unitid': 12,\n 'address': 40021 ,\n 'quantity': 8\n } \n\nreturn msg ", "outputs": 1, "timeout": 0, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 820, "y": 220, "wires": [ [ "74b8c73d803ef256" ] ] }, { "id": "74b8c73d803ef256", "type": "modbus-flex-getter", "z": "43d026fe599216ef", "name": "", "showStatusActivities": true, "showErrors": true, "showWarnings": true, "logIOActivities": false, "server": "f0a7a1e7d035848a", "useIOFile": false, "ioFile": "", "useIOForPayload": false, "emptyMsgOnFail": true, "keepMsgProperties": true, "delayOnStart": false, "startDelayTime": "", "x": 1010, "y": 220, "wires": [ [ "9d18b5769a8d9d3b" ], [] ] }, { "id": "49acd0511ba991fe", "type": "ui-slider", "z": "43d026fe599216ef", "group": "ea87df715266cefc", "name": "Sim Mod #1 Cell Voltage", "label": "Power Module #1 Output Voltage", "tooltip": "", "order": 4, "width": 0, "height": 0, "passthru": true, "outs": "end", "topic": "PowerModule#1_Output_Voltage", "topicType": "str", "thumbLabel": "always", "showTicks": "always", "min": 0, "max": "50", "step": ".01", "className": "", "iconPrepend": "", "iconAppend": "", "color": "", "colorTrack": "", "colorThumb": "", "x": 160, "y": 640, "wires": [ [ "44ae2d7e754ec8a8" ] ] }, { "id": "f32827040693d0eb", "type": "ui-slider", "z": "43d026fe599216ef", "group": "ea87df715266cefc", "name": "Sim Mod #1 Cell Current", "label": "Power Module #1 Output Current", "tooltip": "", "order": 3, "width": 0, "height": 0, "passthru": false, "outs": "end", "topic": "PowerModule#1_Output_Current", "topicType": "str", "thumbLabel": "always", "showTicks": "always", "min": 0, "max": "50", "step": ".01", "className": "", "iconPrepend": "", "iconAppend": "", "color": "", "colorTrack": "", "colorThumb": "", "x": 160, "y": 680, "wires": [ [ "09c4889737de481e" ] ] }, { "id": "ad1f4e17f0203f8b", "type": "ui-slider", "z": "43d026fe599216ef", "group": "ea87df715266cefc", "name": "Sim Mod #1 Supply Voltage", "label": "Power Module #1 Input Voltage", "tooltip": "", "order": 1, "width": 0, "height": 0, "passthru": false, "outs": "end", "topic": "PowerModule#1_Input_Voltage", "topicType": "str", "thumbLabel": "always", "showTicks": "always", "min": 0, "max": "35", "step": ".01", "className": "", "iconPrepend": "", "iconAppend": "", "color": "", "colorTrack": "", "colorThumb": "", "x": 170, "y": 560, "wires": [ [ "bab2c3c66b6e7bdc" ] ] }, { "id": "467a667edc304e4a", "type": "comment", "z": "43d026fe599216ef", "name": "Mod #1 Volts and Current", "info": "", "x": 170, "y": 500, "wires": [] }, { "id": "51fc5a47b74e52e7", "type": "ui-slider", "z": "43d026fe599216ef", "group": "ea87df715266cefc", "name": "Sim Mod #1 FET #1 Temp", "label": "Power Module #1 Temp FET #1", "tooltip": "", "order": 8, "width": 0, "height": 0, "passthru": false, "outs": "end", "topic": "PowerModule#1_TempFET#1", "topicType": "str", "thumbLabel": "always", "showTicks": "always", "min": "-20", "max": "125", "step": "1", "className": "", "iconPrepend": "", "iconAppend": "", "color": "", "colorTrack": "", "colorThumb": "", "x": 170, "y": 840, "wires": [ [ "42d39ed974320185" ] ] }, { "id": "701563d7ac7fe72a", "type": "ui-slider", "z": "43d026fe599216ef", "group": "ea87df715266cefc", "name": "Sim Mod #1 FET #2 Temp", "label": "Power Module #1 Temp FET #2", "tooltip": "", "order": 5, "width": 0, "height": 0, "passthru": false, "outs": "end", "topic": "PowerModule#1_TempFET#2", "topicType": "str", "thumbLabel": "always", "showTicks": "always", "min": "-20", "max": "125", "step": "1", "className": "", "iconPrepend": "", "iconAppend": "", "color": "", "colorTrack": "", "colorThumb": "", "x": 170, "y": 880, "wires": [ [ "7b04b084d3c96fba" ] ] }, { "id": "8f29eaa28d8a6d14", "type": "ui-slider", "z": "43d026fe599216ef", "group": "ea87df715266cefc", "name": "Sim Mod #1 FET #3 Temp", "label": "Power Module #1 Temp FET #3", "tooltip": "", "order": 6, "width": 0, "height": 0, "passthru": false, "outs": "end", "topic": "PowerModule#1_TempFET#3", "topicType": "str", "thumbLabel": "always", "showTicks": "always", "min": "-20", "max": "125", "step": "1", "className": "", "iconPrepend": "", "iconAppend": "", "color": "", "colorTrack": "", "colorThumb": "", "x": 170, "y": 920, "wires": [ [ "e5bc929f92114957" ] ] }, { "id": "542db331f941609c", "type": "ui-slider", "z": "43d026fe599216ef", "group": "ea87df715266cefc", "name": "Sim Mod #1 FET #4 Temp", "label": "Power Module #1 Temp FET #4", "tooltip": "", "order": 7, "width": 0, "height": 0, "passthru": false, "outs": "end", "topic": "PowerModule#1_TempFET#4", "topicType": "str", "thumbLabel": "always", "showTicks": "always", "min": "-20", "max": "125", "step": "1", "className": "", "iconPrepend": "", "iconAppend": "", "color": "", "colorTrack": "", "colorThumb": "", "x": 170, "y": 960, "wires": [ [ "cf0b5e3c4df44a41" ] ] }, { "id": "9d53ea4eb70a71b5", "type": "comment", "z": "43d026fe599216ef", "name": "Mod #1 Temperatures", "info": "", "x": 150, "y": 780, "wires": [] }, { "id": "78b13d47338995ef", "type": "comment", "z": "43d026fe599216ef", "name": "Load Slave Registers", "info": "", "x": 1610, "y": 760, "wires": [] }, { "id": "68904e5ccfe9520a", "type": "Modbus-RTU-Slave", "z": "43d026fe599216ef", "name": "RTU Slave, Com8, UID11", "slaveId": "11", "serialPort": "com8", "baudRate": "9600", "dataBits": "8", "stopBits": "1", "parity": "none", "logEnabled": true, "showErrors": true, "x": 1610, "y": 840, "wires": [ [ "f7fafeb90df66810" ] ] }, { "id": "dbf2628a6ca89d14", "type": "function", "z": "43d026fe599216ef", "name": "Load registers starting address 40021", "func": "var myArray = msg.payload\n\nmsg.payload = {\n register: 40021,\n data: myArray\n}\nreturn msg", "outputs": 1, "timeout": 0, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 1310, "y": 840, "wires": [ [ "68904e5ccfe9520a" ] ] }, { "id": "6df6dc2accf55732", "type": "ui-slider", "z": "43d026fe599216ef", "group": "ea87df715266cefc", "name": "Sim Mod #1 Supply Current", "label": "Power Module #1 Input Current", "tooltip": "", "order": 2, "width": 0, "height": 0, "passthru": false, "outs": "end", "topic": "PowerModule#1_Input_Current", "topicType": "str", "thumbLabel": "always", "showTicks": "always", "min": 0, "max": "100", "step": ".01", "className": "", "iconPrepend": "", "iconAppend": "", "color": "", "colorTrack": "", "colorThumb": "", "x": 170, "y": 600, "wires": [ [ "7f6426d1afaa6aee" ] ] }, { "id": "42d39ed974320185", "type": "function", "z": "43d026fe599216ef", "name": "Add_Offset", "func": "var original = msg.payload;\nvar withOffset = (original + 50)\nmsg.topic = \"Mod1_FET1\";\nmsg.payload = (withOffset);\n\nreturn msg;\n", "outputs": 1, "timeout": 0, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 530, "y": 840, "wires": [ [ "ade51eacb0e1588a" ] ] }, { "id": "7b04b084d3c96fba", "type": "function", "z": "43d026fe599216ef", "name": "Add_Offset", "func": "var original = msg.payload;\nvar withOffset = (original + 50)\nmsg.topic = \"Mod1_FET2\";\nmsg.payload = (withOffset);\n\nreturn msg;\n", "outputs": 1, "timeout": 0, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 530, "y": 880, "wires": [ [ "b887963092f0c744" ] ] }, { "id": "e5bc929f92114957", "type": "function", "z": "43d026fe599216ef", "name": "Add_Offset", "func": "var original = msg.payload;\nvar withOffset = (original + 50)\nmsg.topic = \"Mod1_FET3\";\nmsg.payload = (withOffset);\n\nreturn msg;\n", "outputs": 1, "timeout": 0, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 530, "y": 920, "wires": [ [ "38ed2f1016525a5a" ] ] }, { "id": "cf0b5e3c4df44a41", "type": "function", "z": "43d026fe599216ef", "name": "Add_Offset", "func": "var original = msg.payload;\nvar withOffset = (original + 50)\nmsg.topic = \"Mod1_FET4\";\nmsg.payload = (withOffset);\n\nreturn msg;\n", "outputs": 1, "timeout": 0, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 530, "y": 960, "wires": [ [ "b704c96c222a6d19" ] ] }, { "id": "f4e036249f258bc4", "type": "comment", "z": "43d026fe599216ef", "name": "Offset for Negatives", "info": "", "x": 530, "y": 780, "wires": [] }, { "id": "826b25f8234c1808", "type": "comment", "z": "43d026fe599216ef", "name": "Only pass integers ", "info": "", "x": 730, "y": 500, "wires": [] }, { "id": "250c6a7e1942372a", "type": "inject", "z": "43d026fe599216ef", "name": "48", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": true, "onceDelay": 0.1, "topic": "PowerModule#1_Supply_Voltage", "payload": "48", "payloadType": "num", "x": 370, "y": 580, "wires": [ [ "bab2c3c66b6e7bdc" ] ] }, { "id": "392ab24c30e4bf4f", "type": "inject", "z": "43d026fe599216ef", "name": "30.99", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": true, "onceDelay": "0.2", "topic": "PowerModule#1_Supply_Current", "payload": "30.99", "payloadType": "num", "x": 370, "y": 620, "wires": [ [ "7f6426d1afaa6aee" ] ] }, { "id": "7a4cbd2bb4452714", "type": "inject", "z": "43d026fe599216ef", "name": "44.10", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": true, "onceDelay": "0.3", "topic": "PowerModule#1_Cell_Voltage", "payload": "44.10", "payloadType": "num", "x": 370, "y": 660, "wires": [ [ "44ae2d7e754ec8a8" ] ] }, { "id": "98a436467bf52f57", "type": "inject", "z": "43d026fe599216ef", "name": "22.33", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": true, "onceDelay": "0.4", "topic": "PowerModule#1_Cell_Current", "payload": "22.33", "payloadType": "num", "x": 370, "y": 700, "wires": [ [ "09c4889737de481e" ] ] }, { "id": "4ba2c6b3b29545de", "type": "join", "z": "43d026fe599216ef", "name": "", "mode": "custom", "build": "object", "property": "payload", "propertyType": "msg", "key": "topic", "joiner": "", "joinerType": "str", "useparts": true, "accumulate": true, "timeout": "", "count": "8", "reduceRight": false, "reduceExp": "", "reduceInit": "", "reduceInitType": "", "reduceFixup": "", "x": 950, "y": 760, "wires": [ [ "680bb30c8848839c" ] ] }, { "id": "3cccd248e6dd7f02", "type": "change", "z": "43d026fe599216ef", "name": "set payload value", "rules": [ { "t": "set", "p": "payload", "pt": "msg", "to": "req.params.value", "tot": "msg" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 770, "y": 760, "wires": [ [ "4ba2c6b3b29545de" ] ] }, { "id": "680bb30c8848839c", "type": "function", "z": "43d026fe599216ef", "name": "Delete_Topic", "func": "delete msg.topic\nreturn msg;", "outputs": 1, "timeout": 0, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 1110, "y": 760, "wires": [ [ "9682938a1af4b43b" ] ] }, { "id": "9682938a1af4b43b", "type": "split", "z": "43d026fe599216ef", "name": "", "splt": "\n", "spltType": "str", "arraySplt": 1, "arraySpltType": "len", "stream": false, "addname": "", "property": "payload", "x": 1250, "y": 760, "wires": [ [ "c243eb655e07aad8" ] ] }, { "id": "c243eb655e07aad8", "type": "join", "z": "43d026fe599216ef", "name": "", "mode": "custom", "build": "array", "property": "payload", "propertyType": "msg", "key": "topic", "joiner": "\n", "joinerType": "str", "useparts": true, "accumulate": false, "timeout": "", "count": "", "reduceRight": false, "reduceExp": "", "reduceInit": "", "reduceInitType": "", "reduceFixup": "", "x": 1370, "y": 760, "wires": [ [ "dbf2628a6ca89d14" ] ] }, { "id": "ade51eacb0e1588a", "type": "range", "z": "43d026fe599216ef", "minin": "0", "maxin": "125", "minout": "0", "maxout": "12500", "action": "scale", "round": true, "property": "payload", "name": "Scale & Round", "x": 720, "y": 840, "wires": [ [ "3cccd248e6dd7f02" ] ] }, { "id": "b887963092f0c744", "type": "range", "z": "43d026fe599216ef", "minin": "0", "maxin": "125", "minout": "0", "maxout": "12500", "action": "scale", "round": true, "property": "payload", "name": "Scale & Round", "x": 720, "y": 880, "wires": [ [ "3cccd248e6dd7f02" ] ] }, { "id": "38ed2f1016525a5a", "type": "range", "z": "43d026fe599216ef", "minin": "0", "maxin": "125", "minout": "0", "maxout": "12500", "action": "scale", "round": true, "property": "payload", "name": "Scale & Round", "x": 720, "y": 920, "wires": [ [ "3cccd248e6dd7f02" ] ] }, { "id": "b704c96c222a6d19", "type": "range", "z": "43d026fe599216ef", "minin": "0", "maxin": "125", "minout": "0", "maxout": "12500", "action": "scale", "round": true, "property": "payload", "name": "Scale & Round", "x": 720, "y": 960, "wires": [ [ "3cccd248e6dd7f02" ] ] }, { "id": "bab2c3c66b6e7bdc", "type": "range", "z": "43d026fe599216ef", "minin": "0", "maxin": "35", "minout": "0", "maxout": "3500", "action": "scale", "round": true, "property": "payload", "name": "Scale & Round", "x": 720, "y": 560, "wires": [ [ "3cccd248e6dd7f02" ] ] }, { "id": "44ae2d7e754ec8a8", "type": "range", "z": "43d026fe599216ef", "minin": "0", "maxin": "50", "minout": "0", "maxout": "5000", "action": "scale", "round": true, "property": "payload", "name": "Scale & Round", "x": 720, "y": 640, "wires": [ [ "3cccd248e6dd7f02" ] ] }, { "id": "7f6426d1afaa6aee", "type": "range", "z": "43d026fe599216ef", "minin": "0", "maxin": "100", "minout": "0", "maxout": "10000", "action": "scale", "round": true, "property": "payload", "name": "Scale & Round", "x": 720, "y": 600, "wires": [ [ "3cccd248e6dd7f02" ] ] }, { "id": "09c4889737de481e", "type": "range", "z": "43d026fe599216ef", "minin": "0", "maxin": "50", "minout": "0", "maxout": "5000", "action": "scale", "round": true, "property": "payload", "name": "Scale & Round", "x": 720, "y": 680, "wires": [ [ "3cccd248e6dd7f02" ] ] }, { "id": "952dd45df51bfe04", "type": "inject", "z": "43d026fe599216ef", "name": "75.99", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": true, "onceDelay": "0.5", "topic": "PowerModule#1_TempFET#1", "payload": "75.99", "payloadType": "num", "x": 370, "y": 860, "wires": [ [ "42d39ed974320185" ] ] }, { "id": "9dbd589e2d2c5fde", "type": "inject", "z": "43d026fe599216ef", "name": "35.50", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": true, "onceDelay": "0.6", "topic": "PowerModule#1_TempFET#2", "payload": "35.50", "payloadType": "num", "x": 370, "y": 900, "wires": [ [ "7b04b084d3c96fba" ] ] }, { "id": "747cdd75c897ce4b", "type": "inject", "z": "43d026fe599216ef", "name": "65.22", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": true, "onceDelay": "0.7", "topic": "PowerModule#1_TempFET#3", "payload": "65.22", "payloadType": "num", "x": 370, "y": 940, "wires": [ [ "e5bc929f92114957" ] ] }, { "id": "be7f2617465c4b34", "type": "inject", "z": "43d026fe599216ef", "name": "22.22", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": true, "onceDelay": "0.8", "topic": "PowerModule#1_TempFET#4", "payload": "22.22", "payloadType": "num", "x": 370, "y": 980, "wires": [ [ "cf0b5e3c4df44a41" ] ] }, { "id": "f7fafeb90df66810", "type": "debug", "z": "43d026fe599216ef", "name": "debug 29", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "statusVal": "", "statusType": "auto", "x": 1620, "y": 900, "wires": [] }, { "id": "0371179a8b489f90", "type": "comment", "z": "43d026fe599216ef", "name": "Local Stimulus", "info": "", "x": 370, "y": 500, "wires": [] }, { "id": "a389f9cb1b901b10", "type": "comment", "z": "43d026fe599216ef", "name": "Local Stimulus", "info": "", "x": 350, "y": 780, "wires": [] }, { "id": "4ec1de047c2e7710", "type": "comment", "z": "43d026fe599216ef", "name": "Slave as unitid11", "info": "", "x": 920, "y": 440, "wires": [] }, { "id": "b2f642fdbac10bb6", "type": "ui-slider", "z": "43d026fe599216ef", "group": "8ce179f302667dc2", "name": "Sim Mod #2 Output Voltage", "label": "Power Module #1 Output Voltage", "tooltip": "", "order": 3, "width": 0, "height": 0, "passthru": true, "outs": "end", "topic": "PowerModule#1_Output_Voltage", "topicType": "str", "thumbLabel": "always", "showTicks": "always", "min": 0, "max": "50", "step": ".01", "className": "", "iconPrepend": "", "iconAppend": "", "color": "", "colorTrack": "", "colorThumb": "", "x": 170, "y": 1320, "wires": [ [ "0c6b3ae2d05555a2" ] ] }, { "id": "be094b879ebe3067", "type": "ui-slider", "z": "43d026fe599216ef", "group": "8ce179f302667dc2", "name": "Sim Mod #2 Output Current", "label": "Power Module #1 Output Current", "tooltip": "", "order": 4, "width": 0, "height": 0, "passthru": false, "outs": "end", "topic": "PowerModule#1_Output_Current", "topicType": "str", "thumbLabel": "always", "showTicks": "always", "min": 0, "max": "50", "step": ".01", "className": "", "iconPrepend": "", "iconAppend": "", "color": "", "colorTrack": "", "colorThumb": "", "x": 170, "y": 1360, "wires": [ [ "4f2e0bd829bd318e" ] ] }, { "id": "17237d33db6cc2fb", "type": "ui-slider", "z": "43d026fe599216ef", "group": "8ce179f302667dc2", "name": "Sim Mod #2 Input Voltage", "label": "Power Module #1 Input Voltage", "tooltip": "", "order": 1, "width": 0, "height": 0, "passthru": false, "outs": "end", "topic": "PowerModule#1_Input_Voltage", "topicType": "str", "thumbLabel": "always", "showTicks": "always", "min": 0, "max": "35", "step": ".01", "className": "", "iconPrepend": "", "iconAppend": "", "color": "", "colorTrack": "", "colorThumb": "", "x": 170, "y": 1240, "wires": [ [ "99730a609fde1116" ] ] }, { "id": "b3252cce291f3899", "type": "comment", "z": "43d026fe599216ef", "name": "Mod #1 Volts and Current", "info": "", "x": 170, "y": 1180, "wires": [] }, { "id": "927f636f505902cb", "type": "ui-slider", "z": "43d026fe599216ef", "group": "8ce179f302667dc2", "name": "Sim Mod #2 FET #1 Temp", "label": "Power Module #1 Temp FET #1", "tooltip": "", "order": 5, "width": 0, "height": 0, "passthru": false, "outs": "end", "topic": "PowerModule#1_TempFET#1", "topicType": "str", "thumbLabel": "always", "showTicks": "always", "min": "-20", "max": "125", "step": "1", "className": "", "iconPrepend": "", "iconAppend": "", "color": "", "colorTrack": "", "colorThumb": "", "x": 170, "y": 1520, "wires": [ [ "a961d7a0f32f115b" ] ] }, { "id": "35fdf9891d263ad7", "type": "ui-slider", "z": "43d026fe599216ef", "group": "8ce179f302667dc2", "name": "Sim Mod #2 FET #2 Temp", "label": "Power Module #1 Temp FET #2", "tooltip": "", "order": 6, "width": 0, "height": 0, "passthru": false, "outs": "end", "topic": "PowerModule#1_TempFET#2", "topicType": "str", "thumbLabel": "always", "showTicks": "always", "min": "-20", "max": "125", "step": "1", "className": "", "iconPrepend": "", "iconAppend": "", "color": "", "colorTrack": "", "colorThumb": "", "x": 170, "y": 1560, "wires": [ [ "4821f6e24527e033" ] ] }, { "id": "ae634a10f19fc44f", "type": "ui-slider", "z": "43d026fe599216ef", "group": "8ce179f302667dc2", "name": "Sim Mod #2 FET #3 Temp", "label": "Power Module #1 Temp FET #3", "tooltip": "", "order": 7, "width": 0, "height": 0, "passthru": false, "outs": "end", "topic": "PowerModule#1_TempFET#3", "topicType": "str", "thumbLabel": "always", "showTicks": "always", "min": "-20", "max": "125", "step": "1", "className": "", "iconPrepend": "", "iconAppend": "", "color": "", "colorTrack": "", "colorThumb": "", "x": 170, "y": 1600, "wires": [ [ "aab49f8f3b421774" ] ] }, { "id": "0a042191781b4ad4", "type": "ui-slider", "z": "43d026fe599216ef", "group": "8ce179f302667dc2", "name": "Sim Mod #2 FET #4 Temp", "label": "Power Module #1 Temp FET #4", "tooltip": "", "order": 8, "width": 0, "height": 0, "passthru": false, "outs": "end", "topic": "PowerModule#1_TempFET#4", "topicType": "str", "thumbLabel": "always", "showTicks": "always", "min": "-20", "max": "125", "step": "1", "className": "", "iconPrepend": "", "iconAppend": "", "color": "", "colorTrack": "", "colorThumb": "", "x": 170, "y": 1640, "wires": [ [ "c5cc240e838c4b9f" ] ] }, { "id": "e4fa7fef7b2ae403", "type": "comment", "z": "43d026fe599216ef", "name": "Mod #1 Temperatures", "info": "", "x": 150, "y": 1460, "wires": [] }, { "id": "1cff8cb6e548a14b", "type": "comment", "z": "43d026fe599216ef", "name": "Load Slave Registers", "info": "", "x": 1610, "y": 1440, "wires": [] }, { "id": "b0077f8d09e484f5", "type": "Modbus-RTU-Slave", "z": "43d026fe599216ef", "name": "RTU Slave, Com9, UID12", "slaveId": "12", "serialPort": "com9", "baudRate": "9600", "dataBits": "8", "stopBits": "1", "parity": "none", "logEnabled": true, "showErrors": true, "x": 1610, "y": 1520, "wires": [ [ "70918f39f8814dbe" ] ] }, { "id": "3563c9a39fd65ac1", "type": "function", "z": "43d026fe599216ef", "name": "Load registers starting address 40021", "func": "var myArray = msg.payload\n\nmsg.payload = {\n register: 40021,\n data: myArray\n}\nreturn msg", "outputs": 1, "timeout": 0, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 1310, "y": 1520, "wires": [ [ "b0077f8d09e484f5" ] ] }, { "id": "6d51b1c8e7047bce", "type": "ui-slider", "z": "43d026fe599216ef", "group": "8ce179f302667dc2", "name": "Sim Mod #2 Input Current", "label": "Power Module #1 Input Current", "tooltip": "", "order": 2, "width": 0, "height": 0, "passthru": false, "outs": "end", "topic": "PowerModule#1_Input_Current", "topicType": "str", "thumbLabel": "always", "showTicks": "always", "min": 0, "max": "100", "step": ".01", "className": "", "iconPrepend": "", "iconAppend": "", "color": "", "colorTrack": "", "colorThumb": "", "x": 170, "y": 1280, "wires": [ [ "ba4e0abc041e2708" ] ] }, { "id": "a961d7a0f32f115b", "type": "function", "z": "43d026fe599216ef", "name": "Add_Offset", "func": "var original = msg.payload;\nvar withOffset = (original + 50)\nmsg.topic = \"Mod1_FET1\";\nmsg.payload = (withOffset);\n\nreturn msg;\n", "outputs": 1, "timeout": 0, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 530, "y": 1520, "wires": [ [ "bcc1fb46b794e37e" ] ] }, { "id": "4821f6e24527e033", "type": "function", "z": "43d026fe599216ef", "name": "Add_Offset", "func": "var original = msg.payload;\nvar withOffset = (original + 50)\nmsg.topic = \"Mod1_FET2\";\nmsg.payload = (withOffset);\n\nreturn msg;\n", "outputs": 1, "timeout": 0, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 530, "y": 1560, "wires": [ [ "6858279678bfe038" ] ] }, { "id": "aab49f8f3b421774", "type": "function", "z": "43d026fe599216ef", "name": "Add_Offset", "func": "var original = msg.payload;\nvar withOffset = (original + 50)\nmsg.topic = \"Mod1_FET3\";\nmsg.payload = (withOffset);\n\nreturn msg;\n", "outputs": 1, "timeout": 0, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 530, "y": 1600, "wires": [ [ "1a802bd972815a43" ] ] }, { "id": "c5cc240e838c4b9f", "type": "function", "z": "43d026fe599216ef", "name": "Add_Offset", "func": "var original = msg.payload;\nvar withOffset = (original + 50)\nmsg.topic = \"Mod1_FET4\";\nmsg.payload = (withOffset);\n\nreturn msg;\n", "outputs": 1, "timeout": 0, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 530, "y": 1640, "wires": [ [ "5c0b0024791c0a40" ] ] }, { "id": "aa613b518454d672", "type": "comment", "z": "43d026fe599216ef", "name": "Offset for Negatives", "info": "", "x": 530, "y": 1460, "wires": [] }, { "id": "9a2f95cebdaceb5e", "type": "comment", "z": "43d026fe599216ef", "name": "Only pass integers ", "info": "", "x": 730, "y": 1180, "wires": [] }, { "id": "e5f03a311583fced", "type": "inject", "z": "43d026fe599216ef", "name": "24.5", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": true, "onceDelay": 0.1, "topic": "PowerModule#2_Input_Voltage", "payload": "24.5", "payloadType": "num", "x": 370, "y": 1260, "wires": [ [ "99730a609fde1116" ] ] }, { "id": "26eee9501dd07c3d", "type": "inject", "z": "43d026fe599216ef", "name": "30.99", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": true, "onceDelay": "0.2", "topic": "PowerModule#2_Input_Current", "payload": "30.99", "payloadType": "num", "x": 370, "y": 1300, "wires": [ [ "ba4e0abc041e2708" ] ] }, { "id": "7411dff92c37918d", "type": "inject", "z": "43d026fe599216ef", "name": "44.10", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": true, "onceDelay": "0.3", "topic": "PowerModule#2_Output_Voltage", "payload": "44.10", "payloadType": "num", "x": 370, "y": 1340, "wires": [ [ "0c6b3ae2d05555a2" ] ] }, { "id": "9d2e660d051bca94", "type": "inject", "z": "43d026fe599216ef", "name": "22.33", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": true, "onceDelay": "0.4", "topic": "PowerModule#2_Output_Current", "payload": "22.33", "payloadType": "num", "x": 370, "y": 1380, "wires": [ [ "4f2e0bd829bd318e" ] ] }, { "id": "c6c0b2643fa1e767", "type": "join", "z": "43d026fe599216ef", "name": "", "mode": "custom", "build": "object", "property": "payload", "propertyType": "msg", "key": "topic", "joiner": "", "joinerType": "str", "useparts": true, "accumulate": true, "timeout": "", "count": "8", "reduceRight": false, "reduceExp": "", "reduceInit": "", "reduceInitType": "", "reduceFixup": "", "x": 950, "y": 1440, "wires": [ [ "07df87904408dfa5" ] ] }, { "id": "fd4f25336b50bfa0", "type": "change", "z": "43d026fe599216ef", "name": "set payload value", "rules": [ { "t": "set", "p": "payload", "pt": "msg", "to": "req.params.value", "tot": "msg" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 770, "y": 1440, "wires": [ [ "c6c0b2643fa1e767" ] ] }, { "id": "07df87904408dfa5", "type": "function", "z": "43d026fe599216ef", "name": "Delete_Topic", "func": "delete msg.topic\nreturn msg;", "outputs": 1, "timeout": 0, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 1110, "y": 1440, "wires": [ [ "1d3c6e6b677c3590" ] ] }, { "id": "1d3c6e6b677c3590", "type": "split", "z": "43d026fe599216ef", "name": "", "splt": "\n", "spltType": "str", "arraySplt": 1, "arraySpltType": "len", "stream": false, "addname": "", "property": "payload", "x": 1250, "y": 1440, "wires": [ [ "af3441cb155c299b" ] ] }, { "id": "af3441cb155c299b", "type": "join", "z": "43d026fe599216ef", "name": "", "mode": "custom", "build": "array", "property": "payload", "propertyType": "msg", "key": "topic", "joiner": "\n", "joinerType": "str", "useparts": true, "accumulate": false, "timeout": "", "count": "", "reduceRight": false, "reduceExp": "", "reduceInit": "", "reduceInitType": "", "reduceFixup": "", "x": 1370, "y": 1440, "wires": [ [ "3563c9a39fd65ac1" ] ] }, { "id": "bcc1fb46b794e37e", "type": "range", "z": "43d026fe599216ef", "minin": "0", "maxin": "125", "minout": "0", "maxout": "12500", "action": "scale", "round": true, "property": "payload", "name": "Scale & Round", "x": 720, "y": 1520, "wires": [ [ "fd4f25336b50bfa0" ] ] }, { "id": "6858279678bfe038", "type": "range", "z": "43d026fe599216ef", "minin": "0", "maxin": "125", "minout": "0", "maxout": "12500", "action": "scale", "round": true, "property": "payload", "name": "Scale & Round", "x": 720, "y": 1560, "wires": [ [ "fd4f25336b50bfa0" ] ] }, { "id": "1a802bd972815a43", "type": "range", "z": "43d026fe599216ef", "minin": "0", "maxin": "125", "minout": "0", "maxout": "12500", "action": "scale", "round": true, "property": "payload", "name": "Scale & Round", "x": 720, "y": 1600, "wires": [ [ "fd4f25336b50bfa0" ] ] }, { "id": "5c0b0024791c0a40", "type": "range", "z": "43d026fe599216ef", "minin": "0", "maxin": "125", "minout": "0", "maxout": "12500", "action": "scale", "round": true, "property": "payload", "name": "Scale & Round", "x": 720, "y": 1640, "wires": [ [ "fd4f25336b50bfa0" ] ] }, { "id": "99730a609fde1116", "type": "range", "z": "43d026fe599216ef", "minin": "0", "maxin": "35", "minout": "0", "maxout": "3500", "action": "scale", "round": true, "property": "payload", "name": "Scale & Round", "x": 720, "y": 1240, "wires": [ [ "fd4f25336b50bfa0" ] ] }, { "id": "0c6b3ae2d05555a2", "type": "range", "z": "43d026fe599216ef", "minin": "0", "maxin": "50", "minout": "0", "maxout": "5000", "action": "scale", "round": true, "property": "payload", "name": "Scale & Round", "x": 720, "y": 1320, "wires": [ [ "fd4f25336b50bfa0" ] ] }, { "id": "ba4e0abc041e2708", "type": "range", "z": "43d026fe599216ef", "minin": "0", "maxin": "100", "minout": "0", "maxout": "10000", "action": "scale", "round": true, "property": "payload", "name": "Scale & Round", "x": 720, "y": 1280, "wires": [ [ "fd4f25336b50bfa0" ] ] }, { "id": "4f2e0bd829bd318e", "type": "range", "z": "43d026fe599216ef", "minin": "0", "maxin": "50", "minout": "0", "maxout": "5000", "action": "scale", "round": true, "property": "payload", "name": "Scale & Round", "x": 720, "y": 1360, "wires": [ [ "fd4f25336b50bfa0" ] ] }, { "id": "8b7911a2c0b7af02", "type": "inject", "z": "43d026fe599216ef", "name": "75.99", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": true, "onceDelay": "0.5", "topic": "PowerModule#2_TempFET#1", "payload": "75.99", "payloadType": "num", "x": 370, "y": 1540, "wires": [ [ "a961d7a0f32f115b" ] ] }, { "id": "d2a0079037ebe69e", "type": "inject", "z": "43d026fe599216ef", "name": "35.50", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": true, "onceDelay": "0.6", "topic": "PowerModule#2_TempFET#2", "payload": "35.50", "payloadType": "num", "x": 370, "y": 1580, "wires": [ [ "4821f6e24527e033" ] ] }, { "id": "c6a3f372c5ffc5dc", "type": "inject", "z": "43d026fe599216ef", "name": "65.22", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": true, "onceDelay": "0.7", "topic": "PowerModule#2_TempFET#3", "payload": "65.22", "payloadType": "num", "x": 370, "y": 1620, "wires": [ [ "aab49f8f3b421774" ] ] }, { "id": "c685b86074779fba", "type": "inject", "z": "43d026fe599216ef", "name": "22.22", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": true, "onceDelay": "0.8", "topic": "PowerModule#2_TempFET#4", "payload": "22.22", "payloadType": "num", "x": 370, "y": 1660, "wires": [ [ "c5cc240e838c4b9f" ] ] }, { "id": "719bc097de2814f1", "type": "inject", "z": "43d026fe599216ef", "name": "Inject New Label", "props": [ { "p": "ui_update.label", "v": "zzzzzzzzzzzzzzz", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "x": 160, "y": 1120, "wires": [ [ "17237d33db6cc2fb" ] ] }, { "id": "70918f39f8814dbe", "type": "debug", "z": "43d026fe599216ef", "name": "debug 30", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "statusVal": "", "statusType": "auto", "x": 1620, "y": 1580, "wires": [] }, { "id": "7e4ee32f61e13598", "type": "comment", "z": "43d026fe599216ef", "name": "Local Stimulus", "info": "", "x": 370, "y": 1180, "wires": [] }, { "id": "c8455cfd4b909225", "type": "comment", "z": "43d026fe599216ef", "name": "Local Stimulus", "info": "", "x": 350, "y": 1460, "wires": [] }, { "id": "e6f57a8c78178369", "type": "comment", "z": "43d026fe599216ef", "name": "Slave as unitid12", "info": "", "x": 880, "y": 1100, "wires": [] }, { "id": "f0a7a1e7d035848a", "type": "modbus-client", "name": "Com6", "clienttype": "serial", "bufferCommands": true, "stateLogEnabled": false, "queueLogEnabled": false, "failureLogEnabled": true, "tcpHost": "127.0.0.1", "tcpPort": "502", "tcpType": "DEFAULT", "serialPort": "COM6", "serialType": "RTU-BUFFERD", "serialBaudrate": "9600", "serialDatabits": "8", "serialStopbits": "1", "serialParity": "none", "serialConnectionDelay": "100", "serialAsciiResponseStartDelimiter": "0x3A", "unit_id": "55", "commandDelay": "1", "clientTimeout": "1000", "reconnectOnTimeout": true, "reconnectTimeout": "2000", "parallelUnitIdsAllowed": true, "showErrors": false, "showWarnings": true, "showLogs": true }, { "id": "ea87df715266cefc", "type": "ui-group", "name": "SIM Power Module #1", "page": "ad12eadfd8aa8045", "width": "6", "height": "1", "order": 1, "showTitle": true, "className": "", "visible": "true", "disabled": "false" }, { "id": "8ce179f302667dc2", "type": "ui-group", "name": "SIM Power Module #2", "page": "ad12eadfd8aa8045", "width": "6", "height": "1", "order": 2, "showTitle": true, "className": "", "visible": "true", "disabled": "false" }, { "id": "ad12eadfd8aa8045", "type": "ui-page", "name": "SIM_POWER", "ui": "0bfa592a22643f08", "path": "/page4", "icon": "home", "layout": "grid", "theme": "6d2d4a498a92c9c0", "order": 2, "className": "", "visible": "true", "disabled": "false" }, { "id": "0bfa592a22643f08", "type": "ui-base", "name": "My Dashboard", "path": "/dashboard", "includeClientData": true, "acceptsClientConfig": [ "ui-notification", "ui-control" ], "showPathInSidebar": true, "showPageTitle": true, "navigationStyle": "fixed", "titleBarStyle": "default" }, { "id": "6d2d4a498a92c9c0", "type": "ui-theme", "name": "Default Theme", "colors": { "surface": "#ffffff", "primary": "#0094ce", "bgPage": "#eeeeee", "groupBg": "#ffffff", "groupOutline": "#cccccc" }, "sizes": { "pagePadding": "12px", "groupGap": "12px", "groupBorderRadius": "4px", "widgetGap": "12px" } } ]

What did you expect to happen?

I expected that the Flex-Getter would be able to accept a new unitid programmatically

Other Information

Node-red version v4.0.2 Node.js version v20.16.0

grewek commented 1 week ago

Hello @terrymlyntelelectronics,

could you post your exported flow again but in a code tag? In the current state i get some errors when i try to import it in Node-Red

Thank you!