Unsure how to deal with a JOIN node that doesnt receive all its data

Can anyone think of a way I can deal with this? Every 5 seconds, i am taking an integer from KepserverEX using OPCUA. This value comes from a machine in a factory but when any one machine is turned off the whole thing fails. Nothing is sent through the JOIN node.
I think a way of dealing with this would be to set a time delay and read the values from the OPCUA node. Then have a function node that somehow looks at the values and inserts a 0 if nothing is received from that particular machine. I have no idea how do do that though.

[
    {
        "id": "ef0ed424a004a410",
        "type": "inject",
        "z": "ea7010c55ceba8e3",
        "name": "1 Min Timer",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "5",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "1",
        "payload": "",
        "payloadType": "date",
        "x": 310,
        "y": 260,
        "wires": [
            [
                "ebc495b1ad475a53",
                "e96f3624fd9b39c7",
                "37137f37348b62b1"
            ]
        ]
    },
    {
        "id": "882e1eb4745b401f",
        "type": "OpcUa-Client",
        "z": "ea7010c55ceba8e3",
        "endpoint": "7290d8b0.f713d8",
        "action": "read",
        "deadbandvalue": "",
        "time": "10",
        "timeUnit": "s",
        "localfile": "",
        "localkeyfile": "",
        "folderName4PKI": "",
        "maxChunkCount": "",
        "maxMessageSize": "",
        "receiveBufferSize": "",
        "sendBufferSize": "",
        "name": "Test server (subscribe items)",
        "x": 860,
        "y": 200,
        "wires": [
            [
                "e45a38d6fe39b386"
            ]
        ]
    },
    {
        "id": "e45a38d6fe39b386",
        "type": "join",
        "z": "ea7010c55ceba8e3",
        "name": "Join",
        "mode": "custom",
        "build": "object",
        "property": "payload",
        "propertyType": "msg",
        "key": "topic",
        "joiner": "\\n",
        "joinerType": "str",
        "accumulate": false,
        "timeout": "",
        "count": "3",
        "reduceRight": false,
        "reduceExp": "",
        "reduceInit": "",
        "reduceInitType": "",
        "reduceFixup": "",
        "x": 1090,
        "y": 200,
        "wires": [
            [
                "50e9e02ebe503bde"
            ]
        ]
    },
    {
        "id": "50e9e02ebe503bde",
        "type": "function",
        "z": "ea7010c55ceba8e3",
        "name": "Rename Keys",
        "func": "msg.payload = {\n    BoardCount1: msg.payload[\"ns=2;s=BAR-GAL-AND1.PLC.BoardCount\"],\n    BoardCount2: msg.payload[\"ns=2;s=BAR-GAL-AND2.PLC.BoardCount\"],\n    BoardCount3: msg.payload[\"ns=2;s=BAR-GAL-AND3.PLC.BoardCount\"],\n   \n};\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 1260,
        "y": 200,
        "wires": [
            [
                "84b35168f1946a50"
            ]
        ]
    },
    {
        "id": "ebc495b1ad475a53",
        "type": "OpcUa-Item",
        "z": "ea7010c55ceba8e3",
        "item": "ns=2;s=BAR-GAL-AND1.PLC.BoardCount",
        "datatype": "Int32",
        "value": "",
        "name": "Anderson 1 Board Count",
        "x": 550,
        "y": 200,
        "wires": [
            [
                "882e1eb4745b401f"
            ]
        ]
    },
    {
        "id": "37137f37348b62b1",
        "type": "OpcUa-Item",
        "z": "ea7010c55ceba8e3",
        "item": "ns=2;s=BAR-GAL-AND2.PLC.BoardCount",
        "datatype": "Int32",
        "value": "",
        "name": "Anderson 2 Board Count",
        "x": 550,
        "y": 260,
        "wires": [
            [
                "882e1eb4745b401f"
            ]
        ]
    },
    {
        "id": "e96f3624fd9b39c7",
        "type": "OpcUa-Item",
        "z": "ea7010c55ceba8e3",
        "item": "ns=2;s=BAR-GAL-AND3.PLC.BoardCount",
        "datatype": "Int32",
        "value": "",
        "name": "Anderson 3 Board Count",
        "x": 550,
        "y": 320,
        "wires": [
            [
                "882e1eb4745b401f"
            ]
        ]
    },
    {
        "id": "84b35168f1946a50",
        "type": "debug",
        "z": "ea7010c55ceba8e3",
        "name": "debug 251",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 1430,
        "y": 340,
        "wires": []
    },
    {
        "id": "7290d8b0.f713d8",
        "type": "OpcUa-Endpoint",
        "endpoint": "opc.tcp://10.50.66.175:49320",
        "secpol": "None",
        "secmode": "None",
        "none": false,
        "login": false,
        "usercert": false,
        "usercertificate": "",
        "userprivatekey": ""
    }
]

You can put a timeout in the join node, or after inject add a delay/trigger node and send msg.complete to the join node.

Why do you need to join them?

I'm not sure, im pretty new to this.

What do you want to do with the data?

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.