Hello,
I have establish communication between my PLC (Eaton E4) and an OPCUA Server. I think everything works fine. But in case of losing conncection to my PLC my console gives me "msg : error", I tried to catch it with catch node - but it does not work. I am new to Node-Red and I don't have an idea what to do now.
I hope you can help me. Thank you
Here is a minimal example:
[
{
"id": "8ed0d7b629d5bc0e",
"type": "tab",
"label": "Flow 1",
"disabled": false,
"info": ""
},
{
"id": "90515af6a98ac6d9",
"type": "easyE4 COM",
"z": "8ed0d7b629d5bc0e",
"name": "Easy_1",
"deviceId": "123",
"ip": "192.168.1.117",
"baseAuthPass": "peter",
"authScheme": "Basic",
"protocol": "http",
"baseAuthUser": "peter",
"cycleTime": "500",
"x": 440,
"y": 160,
"wires": [
[
"f1f9d46a6fd3329f"
]
]
},
{
"id": "77100a53f2650f29",
"type": "easyE4 IN",
"z": "8ed0d7b629d5bc0e",
"name": "",
"deviceId": "123",
"selectOpList": [
{
"type": "0",
"index": "1,8"
},
{
"type": "7",
"index": "104"
},
{
"type": "1",
"index": "1,8"
},
{
"type": "8",
"index": "100"
},
{
"type": "8",
"index": "102"
},
{
"type": "5",
"index": "17,32"
}
],
"sysinfo": [
"All"
],
"fb": "",
"indexRange": "",
"x": 430,
"y": 220,
"wires": [
[
"56b90cd73e613f91"
]
]
},
{
"id": "e7ada31a502a8f96",
"type": "catch",
"z": "8ed0d7b629d5bc0e",
"name": "",
"scope": [
"77100a53f2650f29"
],
"uncaught": false,
"x": 190,
"y": 280,
"wires": [
[
"f1fef18d2c301a2d",
"06da0c62815f7c8a"
]
]
},
{
"id": "56b90cd73e613f91",
"type": "debug",
"z": "8ed0d7b629d5bc0e",
"name": "",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 650,
"y": 220,
"wires": []
},
{
"id": "662320bb37425612",
"type": "inject",
"z": "8ed0d7b629d5bc0e",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": true,
"onceDelay": 0.1,
"topic": "",
"payloadType": "date",
"x": 210,
"y": 160,
"wires": [
[
"90515af6a98ac6d9"
]
]
},
{
"id": "f1f9d46a6fd3329f",
"type": "debug",
"z": "8ed0d7b629d5bc0e",
"name": "",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 650,
"y": 160,
"wires": []
},
{
"id": "f1fef18d2c301a2d",
"type": "debug",
"z": "8ed0d7b629d5bc0e",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "error.message",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 670,
"y": 280,
"wires": []
},
{
"id": "06da0c62815f7c8a",
"type": "template",
"z": "8ed0d7b629d5bc0e",
"name": "",
"field": "payload",
"fieldType": "msg",
"format": "handlebars",
"syntax": "mustache",
"template": "No conncection to device!",
"output": "str",
"x": 440,
"y": 340,
"wires": [
[
"417c378bc99783f2"
]
]
},
{
"id": "417c378bc99783f2",
"type": "debug",
"z": "8ed0d7b629d5bc0e",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 650,
"y": 340,
"wires": []
}
]