[
{
"id": "11875115745664cc",
"type": "modbus-read",
"z": "680e319aa9bedf34",
"name": "Anfrage an MX300 starting von 3000 ob er bereit ist mir Daten auszuliefern? ",
"topic": "",
"showStatusActivities": true,
"logIOActivities": false,
"showErrors": true,
"unitid": "",
"dataType": "HoldingRegister",
"adr": "3000",
"quantity": "4",
"rate": "5",
"rateUnit": "s",
"delayOnStart": false,
"startDelayTime": "10",
"server": "7c812aed.2d3a44",
"useIOFile": false,
"ioFile": "",
"useIOForPayload": false,
"emptyMsgOnFail": false,
"x": 1070,
"y": 120,
"wires": [
[
"23dbb76084f22132"
],
[
"5ac55c882a59266b"
]
]
},
{
"id": "a73615138199b2bc",
"type": "modbus-write",
"z": "680e319aa9bedf34",
"name": "Anfrage an MX300 ",
"showStatusActivities": true,
"showErrors": true,
"unitid": "",
"dataType": "MHoldingRegisters",
"adr": "3065",
"quantity": "4",
"server": "7c812aed.2d3a44",
"emptyMsgOnFail": true,
"keepMsgProperties": true,
"x": 1650,
"y": 140,
"wires": [
[
"b8f5b0cdc84b3588"
],
[
"4eb24154348a6b15"
]
]
},
{
"id": "b8f5b0cdc84b3588",
"type": "debug",
"z": "680e319aa9bedf34",
"name": "Modbus Response",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 1890,
"y": 100,
"wires":
},
{
"id": "5ac55c882a59266b",
"type": "function",
"z": "680e319aa9bedf34",
"name": "",
"func": "// Enter the values you want to write to the registers as a string\nvar valuesString = "002A 13D8 82CD 0100";\n\n// Convert the string to an array of bytes\nvar valuesArray = valuesString.split(' ').map(function(hex) {\n return parseInt(hex, 16);\n});\n\n// Set the message payload to the values array\nmsg.payload = valuesArray;\n\n// Return the message object\nreturn msg;\n",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": ,
"x": 1460,
"y": 140,
"wires": [
[
"a73615138199b2bc"
]
]
},
{
"id": "4eb24154348a6b15",
"type": "modbus-response",
"z": "680e319aa9bedf34",
"name": "",
"registerShowMax": 20,
"x": 1890,
"y": 160,
"wires":
},
{
"id": "23dbb76084f22132",
"type": "debug",
"z": "680e319aa9bedf34",
"name": "",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 1450,
"y": 20,
"wires":
},
{
"id": "25738b27f2cc95a4",
"type": "modbus-read",
"z": "680e319aa9bedf34",
"name": "",
"topic": "",
"showStatusActivities": false,
"logIOActivities": false,
"showErrors": false,
"unitid": "",
"dataType": "HoldingRegister",
"adr": "3254",
"quantity": "63",
"rate": "12",
"rateUnit": "s",
"delayOnStart": true,
"startDelayTime": "12",
"server": "7c812aed.2d3a44",
"useIOFile": false,
"ioFile": "",
"useIOForPayload": false,
"emptyMsgOnFail": false,
"x": 1090,
"y": 240,
"wires": [
[
"df814fc93a261dcb"
],
]
},
{
"id": "df814fc93a261dcb",
"type": "debug",
"z": "680e319aa9bedf34",
"name": "",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 1450,
"y": 280,
"wires":
},
{
"id": "b0db4fe645e53467",
"type": "modbus-read",
"z": "680e319aa9bedf34",
"name": "",
"topic": "",
"showStatusActivities": false,
"logIOActivities": false,
"showErrors": false,
"unitid": "",
"dataType": "HoldingRegister",
"adr": "3000",
"quantity": "1",
"rate": "14",
"rateUnit": "s",
"delayOnStart": true,
"startDelayTime": "13",
"server": "7c812aed.2d3a44",
"useIOFile": false,
"ioFile": "",
"useIOForPayload": false,
"emptyMsgOnFail": false,
"x": 1010,
"y": 400,
"wires": [
[
"64ea6aed9f88b96d"
],
[
"62dcd46952e5a9c0"
]
]
},
{
"id": "64ea6aed9f88b96d",
"type": "debug",
"z": "680e319aa9bedf34",
"name": "",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 1220,
"y": 360,
"wires":
},
{
"id": "62dcd46952e5a9c0",
"type": "function",
"z": "680e319aa9bedf34",
"name": "",
"func": "// Enter the values you want to write to the registers as a string\nvar valuesString = "0000 0000 0000 0000";\n\n// Convert the string to an array of bytes\nvar valuesArray = valuesString.split(' ').map(function(hex) {\n return parseInt(hex, 16);\n});\n\n// Set the message payload to the values array\nmsg.payload = valuesArray;\n\n// Return the message object\nreturn msg;\n",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": ,
"x": 1220,
"y": 440,
"wires": [
[
"b7d0e79c5682cebc"
]
]
},
{
"id": "b7d0e79c5682cebc",
"type": "modbus-write",
"z": "680e319aa9bedf34",
"name": "",
"showStatusActivities": false,
"showErrors": false,
"unitid": "",
"dataType": "MHoldingRegisters",
"adr": "3065",
"quantity": "4",
"server": "7c812aed.2d3a44",
"emptyMsgOnFail": false,
"keepMsgProperties": false,
"x": 1440,
"y": 440,
"wires": [
[
"af00dfdf4ccb25bc"
],
[
"c1fa7bb888f8bfda"
]
]
},
{
"id": "c1fa7bb888f8bfda",
"type": "modbus-response",
"z": "680e319aa9bedf34",
"name": "",
"registerShowMax": 20,
"x": 1690,
"y": 440,
"wires":
},
{
"id": "af00dfdf4ccb25bc",
"type": "debug",
"z": "680e319aa9bedf34",
"name": "",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 1670,
"y": 400,
"wires":
},
{
"id": "30e3b4efe1e95291",
"type": "modbus-read",
"z": "680e319aa9bedf34",
"name": "",
"topic": "",
"showStatusActivities": false,
"logIOActivities": false,
"showErrors": false,
"unitid": "",
"dataType": "HoldingRegister",
"adr": "3000",
"quantity": "1",
"rate": "16",
"rateUnit": "s",
"delayOnStart": false,
"startDelayTime": "",
"server": "7c812aed.2d3a44",
"useIOFile": false,
"ioFile": "",
"useIOForPayload": false,
"emptyMsgOnFail": false,
"x": 1330,
"y": 540,
"wires": [
[
"199fa9322fb381df"
],
]
},
{
"id": "199fa9322fb381df",
"type": "debug",
"z": "680e319aa9bedf34",
"name": "",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 1530,
"y": 540,
"wires":
},
{
"id": "579338d1ef80e6fd",
"type": "modbus-read",
"z": "680e319aa9bedf34",
"name": "",
"topic": "",
"showStatusActivities": false,
"logIOActivities": false,
"showErrors": false,
"unitid": "",
"dataType": "HoldingRegister",
"adr": "3001",
"quantity": "1",
"rate": "18",
"rateUnit": "s",
"delayOnStart": false,
"startDelayTime": "",
"server": "7c812aed.2d3a44",
"useIOFile": false,
"ioFile": "",
"useIOForPayload": false,
"emptyMsgOnFail": false,
"x": 1510,
"y": 620,
"wires": [
[
"6a9d4dc1e492f456"
],
]
},
{
"id": "6a9d4dc1e492f456",
"type": "debug",
"z": "680e319aa9bedf34",
"name": "",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 1730,
"y": 620,
"wires":
},
{
"id": "1d2cf1a8178a36a7",
"type": "modbus-read",
"z": "680e319aa9bedf34",
"name": "",
"topic": "",
"showStatusActivities": false,
"logIOActivities": false,
"showErrors": false,
"unitid": "",
"dataType": "HoldingRegister",
"adr": "3254",
"quantity": "63",
"rate": "20",
"rateUnit": "s",
"delayOnStart": false,
"startDelayTime": "",
"server": "7c812aed.2d3a44",
"useIOFile": false,
"ioFile": "",
"useIOForPayload": false,
"emptyMsgOnFail": false,
"x": 1140,
"y": 760,
"wires": [
[
"232d849a67052a46"
],
[
"5bf58bce144dda80"
]
]
},
{
"id": "232d849a67052a46",
"type": "debug",
"z": "680e319aa9bedf34",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 1350,
"y": 700,
"wires":
},
{
"id": "c3b8244f9006fb18",
"type": "comment",
"z": "680e319aa9bedf34",
"name": "Command 0- Read Unique Identifier",
"info": "",
"x": 1600,
"y": 700,
"wires":
},
{
"id": "5bf58bce144dda80",
"type": "function",
"z": "680e319aa9bedf34",
"name": "Extract Device ID",
"func": "var payload = msg.payload;\n\nfunction extractDeviceID(payload) {\n // Extract the hexadecimal values D8, 82, and CD\n const hexValues = payload.slice(8, 11);\n\n // Convert the hexadecimal values to a single string\n const hexString = hexValues.map(value => value.toString(16).padStart(2, '0')).join('');\n\n // Convert the hexadecimal string to decimal\n const deviceID = parseInt(hexString, 16);\n\n return deviceID;\n}\n\nvar deviceID = extractDeviceID(payload);\n\nmsg.payload = deviceID;\n\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": ,
"x": 1370,
"y": 760,
"wires": [
[
"9c43147feddc3ce7"
]
]
},
{
"id": "9c43147feddc3ce7",
"type": "ui_text",
"z": "680e319aa9bedf34",
"group": "4db92a27794b5b69",
"order": 1,
"width": "3",
"height": "1",
"name": "Device ID",
"label": "Device ID",
"format": "{{msg.payload}}",
"layout": "row-spread",
"x": 1580,
"y": 760,
"wires":
},
{
"id": "7c812aed.2d3a44",
"type": "modbus-client",
"z": "680e319aa9bedf34",
"name": "iot2050 advanced configuration",
"clienttype": "serial",
"bufferCommands": true,
"stateLogEnabled": true,
"queueLogEnabled": true,
"tcpHost": "127.0.0.1",
"tcpPort": "502",
"tcpType": "DEFAULT",
"serialPort": "/dev/ttyUSB0",
"serialType": "RTU-BUFFERD",
"serialBaudrate": "19200",
"serialDatabits": "8",
"serialStopbits": "1",
"serialParity": "even",
"serialConnectionDelay": "100",
"unit_id": "1",
"commandDelay": "1",
"clientTimeout": "1000",
"reconnectOnTimeout": true,
"reconnectTimeout": "1000",
"parallelUnitIdsAllowed": true
},
{
"id": "4db92a27794b5b69",
"type": "ui_group",
"name": "Default",
"tab": "6137db660c8932e6",
"order": 1,
"disp": true,
"width": "6",
"collapse": false
},
{
"id": "6137db660c8932e6",
"type": "ui_tab",
"name": "Home",
"icon": "dashboard",
"order": 1
}
]