A lot of contrib and input nodes create very extensive messages, where in fact only one property might be needed for the given flow.
I made it a habit to remove all properties I do not need but unfortunately this (AFAIK) always requires a function node. I'd wish that the change node has an option like "keep only"
Can you give some examples of that? For the problem with the dashboard all you need is a Change node Moving the property of interest into the payload. No function node required.
Consider such a message object:
Object
{
"topic": "f0131f16.70b96",
"messageId": "634fb6191aff1bcb2abb8f2f",
"payload": [
0,
0,
927,
0
],
"queueLengthByUnitId": {
"unitId": 8,
"queueLength": 0
},
"queueUnitId": 8,
"unitId": 8,
"modbusRequest": {
"name": "PHMeter",
"unitid": 8,
"fc": 3,
"address": 5,
"quantity": 4,
"emptyMsgOnFail": false,
"keepMsgProperties": false,
"messageId": "634fb6191aff1bcb2abb8f2f"
},
"responseBuffer": {
"data": [
0,
0,
927,
0
],
"buffer": [
0,
0,
0,
0,
3,
159,
0,
0
]
},
"_msgid": "1646851e47ad2658",
"_event": "node:4c1510585faa8cb7",
"originalPayload": [
0,
0,
927,
0
],
"specification": {
"options": {
"byteSwap": [],
"resultType": "value",
"singleResult": true,
"msgProperty": "value",
"setTopic": true
},
"items": [
{
"type": "int16be",
"name": "Temperature",
"offset": 0,
"length": 1,
"offsetbit": 0,
"scale": "/10",
"mask": "",
"id": 0,
"scaler": {
"operator": "/",
"operand": 10
},
"value": 0
},
{
"type": "int16be",
"name": "PH",
"offset": 4,
"length": 1,
"offsetbit": 0,
"scale": "/100",
"mask": "",
"id": 1,
"scaler": {
"operator": "/",
"operand": 100
},
"value": 9.27
}
]
},
"values": [
0,
9.27
],
"objectResults": {
"Temperature": {
"type": "int16be",
"name": "Temperature",
"offset": 0,
"length": 1,
"offsetbit": 0,
"scale": "/10",
"mask": "",
"id": 0,
"scaler": {
"operator": "/",
"operand": 10
},
"value": 0
},
"PH": {
"type": "int16be",
"name": "PH",
"offset": 4,
"length": 1,
"offsetbit": 0,
"scale": "/100",
"mask": "",
"id": 1,
"scaler": {
"operator": "/",
"operand": 100
},
"value": 9.27
}
},
"keyvalues": {
"Temperature": 0,
"PH": 9.27
},
"arrayResults": [
{
"type": "int16be",
"name": "Temperature",
"offset": 0,
"length": 1,
"offsetbit": 0,
"scale": "/10",
"mask": "",
"id": 0,
"scaler": {
"operator": "/",
"operand": 10
},
"value": 0
},
{
"type": "int16be",
"name": "PH",
"offset": 4,
"length": 1,
"offsetbit": 0,
"scale": "/100",
"mask": "",
"id": 1,
"scaler": {
"operator": "/",
"operand": 100
},
"value": 9.27
}
],
"buffer": [
0,
0,
0,
0,
3,
159,
0,
0
],
"value": [
0,
9.27
]
}
Of course I can just change the intended value to be msg.payload but I will still be dragging around all other properties throughout the entire flow.
My habit is to move the intended value to payload and get rid of the rest. Makes debugging and understanding a flow much easier in my opinion. If it also has an impact on performance in the end, I can't tell.
There is zero overhead in dragging the other properties around except where the flow is forked (multiple wires connected to one output). That is because the message is passed by reference, so effectively it just a pointer that is passed along the wires.
I agree that the example you show does have a lot of additional properties, but I think it is unusual in this. Even so, unless you are generating messages like this hundreds of times a second it is unlikely to have a measurable effect on performance.
If you were (presumably spending large resources) installing NR into high availability critical infrastructure surely you would be rolling your own Dashboard?
Yeah, yeah, don't call me Shirley.
so you mean it is difficult, do not you?
so your advice to me not doing this project by node red choosing another scada software, isĀ“t it?
Perhaps using uibuilder
no i wanted to say that a scada system is really expensive.
You can work many many month with Node RED to generate the same costs.
software costs vs personnel costs
In acceptance of your speech, I assume that you will complete the project in your working hours.
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.