I'm getting a bunch of numbers via Modbus TCP and am looking to rebroadcast those numbers via a node-red Modbus server, as below. However, I keep getting "Is Not A Valid Memory Write Message To Server"
in the debug log on inputting these numbers. Related to this issue. Also for some reason the payload buffer is 48, despite only having 6 each of coils, holdings, inputs and discretes (24 total?)
[
{
"id": "5d59c82badda5237",
"type": "modbus-server",
"z": "37f1be47da815ae1",
"name": "",
"logEnabled": true,
"hostname": "0.0.0.0",
"serverPort": 10502,
"responseDelay": 100,
"delayUnit": "ms",
"coilsBufferSize": "6",
"holdingBufferSize": "6",
"inputBufferSize": "6",
"discreteBufferSize": "6",
"showErrors": true,
"x": 1520,
"y": 1240,
"wires": [
[
"d04855631aecc823"
],
[],
[],
[],
[]
]
},
{
"id": "f5457920917eb0f0",
"type": "switch",
"z": "37f1be47da815ae1",
"name": "",
"property": "topic",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "gboiler_running_condition",
"vt": "str"
},
{
"t": "eq",
"v": "gsilo_level_0_1000",
"vt": "str"
},
{
"t": "eq",
"v": "gmax_stoker_speed",
"vt": "str"
},
{
"t": "eq",
"v": "gpid_stoker_output",
"vt": "str"
}
],
"checkall": "true",
"repair": false,
"outputs": 4,
"x": 990,
"y": 1040,
"wires": [
[
"c396898e828dee2a"
],
[
"4cefa7be49623107"
],
[
"8512686ef7c21c3e"
],
[
"62340306b6eaf6f0"
]
]
},
{
"id": "b3fc5514304b5242",
"type": "comment",
"z": "37f1be47da815ae1",
"name": "Boiler Heat Meter kW & mWh [req. Serial RS485]",
"info": "",
"x": 200,
"y": 960,
"wires": []
},
{
"id": "290109b199a881e3",
"type": "inject",
"z": "37f1be47da815ae1",
"name": "Get Silo Level",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "5",
"crontab": "",
"once": true,
"onceDelay": "1",
"topic": "gsilo_level_0_1000",
"payload": "",
"payloadType": "date",
"x": 140,
"y": 1020,
"wires": [
[
"889f040436167658"
]
]
},
{
"id": "889f040436167658",
"type": "link out",
"z": "37f1be47da815ae1",
"name": "Sensors out",
"mode": "link",
"links": [
"37db5198429b7396"
],
"x": 405,
"y": 1040,
"wires": []
},
{
"id": "99eb4635c1919a85",
"type": "link in",
"z": "37f1be47da815ae1",
"name": "Processor in",
"links": [
"da25e4e66d04561c"
],
"x": 705,
"y": 1040,
"wires": [
[
"134c7774ebcf3011"
]
]
},
{
"id": "134c7774ebcf3011",
"type": "modbus-flex-getter",
"z": "37f1be47da815ae1",
"name": "Boiler_getter",
"showStatusActivities": false,
"showErrors": false,
"showWarnings": true,
"logIOActivities": false,
"server": "d8b07ddb.c44d4",
"useIOFile": false,
"ioFile": "",
"useIOForPayload": false,
"emptyMsgOnFail": false,
"keepMsgProperties": false,
"delayOnStart": false,
"startDelayTime": "",
"x": 830,
"y": 1040,
"wires": [
[
"f5457920917eb0f0"
],
[]
]
},
{
"id": "4486d6e85a7d3e1b",
"type": "comment",
"z": "37f1be47da815ae1",
"name": "<-- I/O through lvc_labels -->",
"info": "",
"x": 560,
"y": 1040,
"wires": []
},
{
"id": "85ebfdbffa8d984b",
"type": "debug",
"z": "37f1be47da815ae1",
"name": "debug 10",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 1480,
"y": 980,
"wires": []
},
{
"id": "a28bbddf98fa5939",
"type": "inject",
"z": "37f1be47da815ae1",
"name": "Shutdown/Fireout",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "5",
"crontab": "",
"once": true,
"onceDelay": "1",
"topic": "gboiler_running_condition",
"payload": "",
"payloadType": "date",
"x": 150,
"y": 900,
"wires": [
[
"889f040436167658"
]
]
},
{
"id": "4f9540eaeb13509a",
"type": "inject",
"z": "37f1be47da815ae1",
"name": "Stoker at maximum speed",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "5",
"crontab": "",
"once": true,
"onceDelay": "1",
"topic": "gmax_stoker_speed",
"payload": "",
"payloadType": "date",
"x": 160,
"y": 1140,
"wires": [
[
"889f040436167658"
]
]
},
{
"id": "ad73abc4d0bad61d",
"type": "inject",
"z": "37f1be47da815ae1",
"name": "Averaged stoker speed",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "5",
"crontab": "",
"once": true,
"onceDelay": "1",
"topic": "gpid_stoker_output",
"payload": "",
"payloadType": "date",
"x": 150,
"y": 1220,
"wires": [
[
"889f040436167658"
]
]
},
{
"id": "c396898e828dee2a",
"type": "function",
"z": "37f1be47da815ae1",
"name": "Shutdown/Fireout scale",
"func": "msg.payload = msg.payload[0]/1;\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 1210,
"y": 980,
"wires": [
[
"85ebfdbffa8d984b",
"5d59c82badda5237"
]
]
},
{
"id": "4cefa7be49623107",
"type": "function",
"z": "37f1be47da815ae1",
"name": "Silo Level scale",
"func": "msg.payload = msg.payload/10.0;\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 1180,
"y": 1020,
"wires": [
[
"8916057c5b4e9270",
"5d59c82badda5237"
]
]
},
{
"id": "8512686ef7c21c3e",
"type": "function",
"z": "37f1be47da815ae1",
"name": "Maximum stoker speed scale",
"func": "msg.payload = msg.payload/1;\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 1220,
"y": 1060,
"wires": [
[
"ed36434616147015",
"5d59c82badda5237"
]
]
},
{
"id": "62340306b6eaf6f0",
"type": "function",
"z": "37f1be47da815ae1",
"name": "Averaged stoker speed scale",
"func": "msg.payload = msg.payload/1;\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 1220,
"y": 1100,
"wires": [
[
"248c46681d071246",
"5d59c82badda5237"
]
]
},
{
"id": "c5a0fdf6b8bb9850",
"type": "comment",
"z": "37f1be47da815ae1",
"name": "[Unavailable] Stoker at minimum speed",
"info": "",
"x": 170,
"y": 1080,
"wires": []
},
{
"id": "8916057c5b4e9270",
"type": "debug",
"z": "37f1be47da815ae1",
"name": "debug 11",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 1480,
"y": 1020,
"wires": []
},
{
"id": "ed36434616147015",
"type": "debug",
"z": "37f1be47da815ae1",
"name": "debug 12",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 1480,
"y": 1060,
"wires": []
},
{
"id": "248c46681d071246",
"type": "debug",
"z": "37f1be47da815ae1",
"name": "debug 13",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 1480,
"y": 1100,
"wires": []
},
{
"id": "d04855631aecc823",
"type": "debug",
"z": "37f1be47da815ae1",
"name": "Server output",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 1760,
"y": 780,
"wires": []
},
{
"id": "d8b07ddb.c44d4",
"type": "modbus-client",
"name": "Boiler_PLC",
"clienttype": "tcp",
"bufferCommands": true,
"stateLogEnabled": false,
"queueLogEnabled": false,
"failureLogEnabled": false,
"tcpHost": "192.168.127.2",
"tcpPort": "502",
"tcpType": "DEFAULT",
"serialPort": "/dev/ttyUSB",
"serialType": "RTU-BUFFERD",
"serialBaudrate": "9600",
"serialDatabits": "8",
"serialStopbits": "1",
"serialParity": "none",
"serialConnectionDelay": "100",
"serialAsciiResponseStartDelimiter": "",
"unit_id": "1",
"commandDelay": "1",
"clientTimeout": "1000",
"reconnectOnTimeout": true,
"reconnectTimeout": "2000",
"parallelUnitIdsAllowed": true
}
]
Debug log output:
Is Not A Valid Memory Write Message To Server
alternating with
{"type":"holding","message":{"topic":"gsilo_level_0_1000","messageId":"644ac6d20671dce7f47d76ac","payload":70.2,"queueLengthByUnitId":{"unitId":255,"queueLength":2},"queueUnitId":255,"unitId":255,"modbusRequest":{"unitid":255,"fc":3,"address":105,"quantity":1,"emptyMsgOnFail":false,"keepMsgProperties":false,"messageId":"644ac6d20671dce7f47d76ac"},"responseBuffer":{"data":[702],"buffer":[2,190]},"_msgid":"649dc0709a39ce6f"},"payload":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"_msgid":"5d77a44cfc59b6dd"}