Hello everyone
i have a problem integrated 2 unit power meter Schneider iEM3255 with node-red.
node-red can only read 1 device power meter.
i have a trial with wiring parrarel not sloved.
Has anyone here experienced the same thing? if so, how do you communicate between node-red and many slave ID modbus RTUs?
Welcome to forum @Ibnu
What node are you using to communicate with the devices? Probably node-red-contrib-something
There are multiple modbus nodes. Is it node-red-contrib-modbus or one of the others?
Yes it'is node-red-contrib-modbus "modbus read"
I try add delay time but not solved
Node-Red only read 1 device Slave ID
Device 1 slave ID 1
Device 2 slave ID 10
Select the two modbus nodes and export them here (Ctrl+E) and paste the flow here. When pasting use the </>
button at the top of the forum entry window.
[
{
"id": "161156e41157308c",
"type": "tab",
"label": "Flow 1",
"disabled": false,
"info": "",
"env": []
},
{
"id": "212a073c4ea87f4f",
"type": "modbus-read",
"z": "161156e41157308c",
"d": true,
"name": "EM3255_Pipe_Line_A",
"topic": "Avg Voltage (Single Phase)",
"showStatusActivities": false,
"logIOActivities": false,
"showErrors": false,
"unitid": "1",
"dataType": "HoldingRegister",
"adr": "3027",
"quantity": "2",
"rate": "4",
"rateUnit": "s",
"delayOnStart": false,
"startDelayTime": "1",
"server": "1b9e46852f0b832b",
"useIOFile": false,
"ioFile": "",
"useIOForPayload": false,
"emptyMsgOnFail": false,
"x": 160,
"y": 240,
"wires": [
[
"2e574f173d7517b5"
],
[]
]
},
{
"id": "ef7a2fd32b34c36f",
"type": "comment",
"z": "161156e41157308c",
"name": "Pipe Line A (Avg Voltage) single phase",
"info": "",
"x": 190,
"y": 180,
"wires": []
},
{
"id": "d1de58b843c23d6b",
"type": "ui_gauge",
"z": "161156e41157308c",
"name": "",
"group": "0b9a7866b342a438",
"order": 1,
"width": 6,
"height": 5,
"gtype": "gage",
"title": "AVG Voltage Phase-N",
"label": "V",
"format": "{{value}}",
"min": 0,
"max": "450",
"colors": [
"#00b500",
"#e6e600",
"#ca3838"
],
"seg1": "",
"seg2": "",
"className": "",
"x": 680,
"y": 240,
"wires": []
},
{
"id": "2e574f173d7517b5",
"type": "function",
"z": "161156e41157308c",
"name": "int to float",
"func": "/* Converts from an number, string, buffer or array representing an IEEE-754 value\n to a javascript float.\n The following may be given in msg.payload:\n A string representing a number, which may be hex or binary\n examples, \"1735\" \"0x02045789\" 0b01000000010010010000111111011011\n An integer value\n A two element array or buffer of 16 bit values, less significant byte first.\n A four element array or buffer of 8 bit values, most significant byte first.\n Source: https://flows.nodered.org/flow/359ead34237b7ab6ec0465ee85a34b62\n */\n // first make a number from the given payload if necessary\n let intValue;\n if (typeof msg.payload === \"number\") \n{\n intValue = msg.payload;\n } else if (typeof msg.payload === \"string\") {\n intValue = Number(msg.payload);\n } else if (msg.payload.length == 2) {\n // two int array or buffer\n intValue = (msg.payload[0] << 16) + msg.payload[1];\n } else if (msg.payload.length == 4) {\n // four byte array or buffer\n intValue = (((((msg.payload[0] << 8) + msg.payload[1]) << 8) + msg.payload[2]) <<\n 8) + msg.payload[3];\n } else {\n node.warn(\"Unrecognised payload type or length\");\n } \n msg.payload = Int2Float32(intValue);\n msg.payload = msg.payload.toFixed(1);\n return msg;\n function Int2Float32(bytes) {\n var sign = (bytes & 0x80000000) ? -1 : 1;\n var exponent = ((bytes >> 23) & 0xFF) - 127;\n var significand = (bytes & ~(-1 << 23));\n if (exponent == 128)\n return sign * ((significand) ? Number.NaN : Number.POSITIVE_INFINITY);\n if (exponent == -127) {\n if (significand === 0) return sign * 0.0;\n exponent = -126;\n significand /= (1 << 22);\n } else significand = (significand | (1 << 23)) / (1 << 23);\n return sign * significand * Math.pow(2, exponent);\n }",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 420,
"y": 240,
"wires": [
[
"d1de58b843c23d6b",
"c1e27af7855e0664",
"abb706727c9fc49c",
"d9ac29a133345ea1"
]
]
},
{
"id": "c1e27af7855e0664",
"type": "debug",
"z": "161156e41157308c",
"name": "",
"active": true,
"tosidebar": true,
"console": true,
"tostatus": true,
"complete": "payload",
"targetType": "msg",
"statusVal": "payload",
"statusType": "auto",
"x": 660,
"y": 140,
"wires": []
},
{
"id": "abb706727c9fc49c",
"type": "ui_text",
"z": "161156e41157308c",
"group": "0691c57e3688a701",
"order": 1,
"width": 6,
"height": 1,
"name": "",
"label": "Voltage Average Phase-N",
"format": "{{msg.payload}}V",
"layout": "row-spread",
"className": "",
"x": 690,
"y": 300,
"wires": []
},
{
"id": "d9ac29a133345ea1",
"type": "ui_chart",
"z": "161156e41157308c",
"name": "",
"group": "51c1c643236ddf56",
"order": 1,
"width": 7,
"height": 5,
"label": "Grafik Avg Voltage Phase-N",
"chartType": "line",
"legend": "false",
"xformat": "HH:mm:ss",
"interpolate": "linear",
"nodata": "",
"dot": false,
"ymin": "0",
"ymax": "450",
"removeOlder": 1,
"removeOlderPoints": "",
"removeOlderUnit": "3600",
"cutout": 0,
"useOneColor": false,
"useUTC": false,
"colors": [
"#1f77b4",
"#aec7e8",
"#ff7f0e",
"#2ca02c",
"#98df8a",
"#d93030",
"#ff9896",
"#9467bd",
"#c5b0d5"
],
"outputs": 1,
"useDifferentColor": false,
"className": "",
"x": 700,
"y": 360,
"wires": [
[]
]
},
{
"id": "7fc769ac402cd712",
"type": "modbus-read",
"z": "161156e41157308c",
"d": true,
"name": "EM3255_Pipe_Line_B",
"topic": "Avg Voltage (Single Phase)",
"showStatusActivities": false,
"logIOActivities": false,
"showErrors": false,
"unitid": "10",
"dataType": "HoldingRegister",
"adr": "3027",
"quantity": "2",
"rate": "4",
"rateUnit": "s",
"delayOnStart": false,
"startDelayTime": "2",
"server": "255c14ab516089b5",
"useIOFile": false,
"ioFile": "",
"useIOForPayload": false,
"emptyMsgOnFail": false,
"x": 1000,
"y": 240,
"wires": [
[
"45c8b97784b9077b"
],
[]
]
},
{
"id": "68e7d1eb2e46eb3a",
"type": "comment",
"z": "161156e41157308c",
"name": "Pipe Line B(Avg Voltage) single phase",
"info": "",
"x": 1030,
"y": 180,
"wires": []
},
{
"id": "0e1f01e1f6e59c2a",
"type": "ui_gauge",
"z": "161156e41157308c",
"name": "",
"group": "b4c553cf349b9998",
"order": 1,
"width": 6,
"height": 5,
"gtype": "gage",
"title": "AVG Voltage Phase-N",
"label": "V",
"format": "{{value}}",
"min": 0,
"max": "450",
"colors": [
"#00b500",
"#e6e600",
"#ca3838"
],
"seg1": "",
"seg2": "",
"className": "",
"x": 1520,
"y": 240,
"wires": []
},
{
"id": "45c8b97784b9077b",
"type": "function",
"z": "161156e41157308c",
"name": "int to float",
"func": "/* Converts from an number, string, buffer or array representing an IEEE-754 value\n to a javascript float.\n The following may be given in msg.payload:\n A string representing a number, which may be hex or binary\n examples, \"1735\" \"0x02045789\" 0b01000000010010010000111111011011\n An integer value\n A two element array or buffer of 16 bit values, less significant byte first.\n A four element array or buffer of 8 bit values, most significant byte first.\n Source: https://flows.nodered.org/flow/359ead34237b7ab6ec0465ee85a34b62\n */\n // first make a number from the given payload if necessary\n let intValue;\n if (typeof msg.payload === \"number\") \n{\n intValue = msg.payload;\n } else if (typeof msg.payload === \"string\") {\n intValue = Number(msg.payload);\n } else if (msg.payload.length == 2) {\n // two int array or buffer\n intValue = (msg.payload[0] << 16) + msg.payload[1];\n } else if (msg.payload.length == 4) {\n // four byte array or buffer\n intValue = (((((msg.payload[0] << 8) + msg.payload[1]) << 8) + msg.payload[2]) <<\n 8) + msg.payload[3];\n } else {\n node.warn(\"Unrecognised payload type or length\");\n } \n msg.payload = Int2Float32(intValue);\n msg.payload = msg.payload.toFixed(1);\n return msg;\n function Int2Float32(bytes) {\n var sign = (bytes & 0x80000000) ? -1 : 1;\n var exponent = ((bytes >> 23) & 0xFF) - 127;\n var significand = (bytes & ~(-1 << 23));\n if (exponent == 128)\n return sign * ((significand) ? Number.NaN : Number.POSITIVE_INFINITY);\n if (exponent == -127) {\n if (significand === 0) return sign * 0.0;\n exponent = -126;\n significand /= (1 << 22);\n } else significand = (significand | (1 << 23)) / (1 << 23);\n return sign * significand * Math.pow(2, exponent);\n }",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 1260,
"y": 240,
"wires": [
[
"0e1f01e1f6e59c2a",
"0e2724d03b6cc6a7",
"22f930d2b84a0dec",
"3f05da2509d88ef8"
]
]
},
{
"id": "0e2724d03b6cc6a7",
"type": "debug",
"z": "161156e41157308c",
"name": "",
"active": false,
"tosidebar": true,
"console": true,
"tostatus": true,
"complete": "payload",
"targetType": "msg",
"statusVal": "payload",
"statusType": "auto",
"x": 1500,
"y": 140,
"wires": []
},
{
"id": "22f930d2b84a0dec",
"type": "ui_text",
"z": "161156e41157308c",
"group": "bc0105fd16829d98",
"order": 1,
"width": 6,
"height": 1,
"name": "",
"label": "Voltage Average Phase-N",
"format": "{{msg.payload}}V",
"layout": "row-spread",
"className": "",
"x": 1530,
"y": 300,
"wires": []
},
{
"id": "3f05da2509d88ef8",
"type": "ui_chart",
"z": "161156e41157308c",
"name": "",
"group": "db7c4fac4d4ec86a",
"order": 1,
"width": 7,
"height": 6,
"label": "Grafik Avg Voltage Phase-N",
"chartType": "line",
"legend": "false",
"xformat": "HH:mm:ss",
"interpolate": "linear",
"nodata": "",
"dot": false,
"ymin": "0",
"ymax": "450",
"removeOlder": 1,
"removeOlderPoints": "",
"removeOlderUnit": "3600",
"cutout": 0,
"useOneColor": false,
"useUTC": false,
"colors": [
"#1f77b4",
"#aec7e8",
"#ff7f0e",
"#2ca02c",
"#98df8a",
"#d93030",
"#ff9896",
"#9467bd",
"#c5b0d5"
],
"outputs": 1,
"useDifferentColor": false,
"className": "",
"x": 1540,
"y": 360,
"wires": [
[]
]
},
{
"id": "1b9e46852f0b832b",
"type": "modbus-client",
"name": "panel Line A",
"clienttype": "serial",
"bufferCommands": true,
"stateLogEnabled": false,
"queueLogEnabled": false,
"tcpHost": "127.0.0.1",
"tcpPort": "502",
"tcpType": "DEFAULT",
"serialPort": "COM3",
"serialType": "RTU-BUFFERD",
"serialBaudrate": "9600",
"serialDatabits": "8",
"serialStopbits": "1",
"serialParity": "even",
"serialConnectionDelay": "100",
"serialAsciiResponseStartDelimiter": "0x3A",
"unit_id": "1",
"commandDelay": "1",
"clientTimeout": "1000",
"reconnectOnTimeout": true,
"reconnectTimeout": "2000",
"parallelUnitIdsAllowed": false
},
{
"id": "0b9a7866b342a438",
"type": "ui_group",
"name": "Pipe Line A - Gauge ",
"tab": "df1815b2eb054693",
"order": 2,
"disp": true,
"width": "6",
"collapse": true,
"className": ""
},
{
"id": "0691c57e3688a701",
"type": "ui_group",
"name": "Pipe Line A - Summery ",
"tab": "df1815b2eb054693",
"order": 1,
"disp": true,
"width": "6",
"collapse": true,
"className": ""
},
{
"id": "51c1c643236ddf56",
"type": "ui_group",
"name": "Pipe Line A - Grafik ",
"tab": "df1815b2eb054693",
"order": 3,
"disp": true,
"width": 21,
"collapse": true,
"className": ""
},
{
"id": "255c14ab516089b5",
"type": "modbus-client",
"name": "Panel Line B",
"clienttype": "serial",
"bufferCommands": true,
"stateLogEnabled": true,
"queueLogEnabled": false,
"tcpHost": "127.0.0.1",
"tcpPort": "502",
"tcpType": "DEFAULT",
"serialPort": "COM3",
"serialType": "RTU",
"serialBaudrate": "9600",
"serialDatabits": "8",
"serialStopbits": "1",
"serialParity": "even",
"serialConnectionDelay": "2000",
"serialAsciiResponseStartDelimiter": "0x3A",
"unit_id": "10",
"commandDelay": "1",
"clientTimeout": "2000",
"reconnectOnTimeout": true,
"reconnectTimeout": "2000",
"parallelUnitIdsAllowed": true
},
{
"id": "b4c553cf349b9998",
"type": "ui_group",
"name": "Line B - Gauge ",
"tab": "13288f18d8e4455a",
"order": 2,
"disp": true,
"width": "6",
"collapse": true,
"className": ""
},
{
"id": "bc0105fd16829d98",
"type": "ui_group",
"name": "Pipe Line B - Summery ",
"tab": "13288f18d8e4455a",
"order": 1,
"disp": true,
"width": "6",
"collapse": true,
"className": ""
},
{
"id": "db7c4fac4d4ec86a",
"type": "ui_group",
"name": "Pipe Line B - Grafik ",
"tab": "13288f18d8e4455a",
"order": 3,
"disp": true,
"width": 21,
"collapse": true,
"className": ""
},
{
"id": "df1815b2eb054693",
"type": "ui_tab",
"name": "PGAS Solution - Manufaktur Pipa PE Kwh Online (Pipe Line A)",
"icon": "dashboard",
"disabled": false,
"hidden": false
},
{
"id": "13288f18d8e4455a",
"type": "ui_tab",
"name": "PGAS Solution - Manufaktur Pipa PE Kwh Online (Line B)",
"icon": "dashboard",
"disabled": false,
"hidden": false
}
]
oke i sent the clipboard
I asked for just the modbus nodes, not the whole flow, but I managed to see the problem. You have configured two server nodes (Panel line A and Panel line B) both trying to connect to the same serial port. You should have just one (make sure you delete the other one in the Menu > Configuration Nodes). Use the unit id in the read node to specify the device.
oke, but i try problem.
Device 1 Slave ID 1
Device 2 Slave ID 10
Modbus read Unit ID 1 (device 1) Server Pipe line A (unitID 10)
Modbus read Unit ID 10 (device 2) Server Pipe line A (unitID 10)
If you specify a unit id in the read node then the id in the server node is not used.
Is it working now?
I suggest calling the server node COM3 or something like that.
oke thanks you this is work now, i have control and data Power meter. but now problem is maksimum 8 node only.
whereas I need more nodes to display
I don't understand what you mean.
now I can communicate from node-red to 2 devices.
but currently only able to display 8 addresses. whereas I need more than 8 addresses
What do you mean by "address"
[Edit] and what is stopping you having more than eight of them?
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.