Hi,
I'm trying to subscribe Prosys OPC UA Simulation Server 5.2.2 simulation folder just using iiot-opcua nodes. Using a "read node" I can read all values from tags of simulation folder but when I try to subscribe same tags using a "subscribe node", I get a error message.
My intention is subscribe tags instead call read node periodically:
Working flow using node "read" triggered by injection node:
[
{
"id": "bb75dff736f15f64",
"type": "tab",
"label": "opc read",
"disabled": false,
"info": ""
},
{
"id": "9b7c70c0d9bb699f",
"type": "OPCUA-IIoT-Browser",
"z": "bb75dff736f15f64",
"connector": "18fecfa6.964f1",
"nodeId": "ns=3;s=85/0:Simulation",
"name": "",
"justValue": false,
"sendNodesToRead": false,
"sendNodesToListener": true,
"sendNodesToBrowser": false,
"multipleOutputs": false,
"recursiveBrowse": false,
"recursiveDepth": "1",
"delayPerMessage": "",
"showStatusActivities": false,
"showErrors": false,
"x": 340,
"y": 160,
"wires": [
[
"eac6e41e50101fb7"
]
]
},
{
"id": "864b73bbd67aeaca",
"type": "debug",
"z": "bb75dff736f15f64",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload.resultsConverted",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 770,
"y": 160,
"wires": []
},
{
"id": "1f2ef3f06ccaadf3",
"type": "inject",
"z": "bb75dff736f15f64",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 140,
"y": 160,
"wires": [
[
"9b7c70c0d9bb699f"
]
]
},
{
"id": "eac6e41e50101fb7",
"type": "OPCUA-IIoT-Read",
"z": "bb75dff736f15f64",
"attributeId": "130",
"maxAge": "5",
"depth": 1,
"connector": "18fecfa6.964f1",
"name": "",
"justValue": false,
"showStatusActivities": false,
"showErrors": false,
"parseStrings": false,
"historyDays": "1",
"x": 510,
"y": 160,
"wires": [
[
"864b73bbd67aeaca"
]
]
},
{
"id": "18fecfa6.964f1",
"type": "OPCUA-IIoT-Connector",
"discoveryUrl": "",
"endpoint": "opc.tcp://efc:53530/OPCUA/SimulationServer",
"keepSessionAlive": true,
"loginEnabled": false,
"securityPolicy": "None",
"securityMode": "None",
"name": "PROSYS SERVER",
"showErrors": true,
"individualCerts": false,
"publicCertificateFile": "",
"privateKeyFile": "",
"defaultSecureTokenLifetime": "60000",
"endpointMustExist": true,
"autoSelectRightEndpoint": true,
"strategyMaxRetry": "",
"strategyInitialDelay": "",
"strategyMaxDelay": "",
"strategyRandomisationFactor": "",
"requestedSessionTimeout": "",
"connectionStartDelay": "",
"reconnectDelay": "",
"maxBadSessionRequests": ""
}
]
Succesful output:
[{"nodeId":"ns=3;i=1001","statusCode":{"value":0},"nodeClass":2,"browseName":{"namespaceIndex":3,"name":"Counter"},"displayName":{"text":"Counter"},"description":{"text":""},"writeMask":0,"userWriteMask":0,"value":42,"dataType":"ns=0;i=6","valueRank":-1,"arrayDimensions":null,"accessLevel":5,"userAccessLevel":5,"minimumSamplingInterval":-1,"historizing":true},{"nodeId":"ns=3;i=1002","statusCode":{"value":0},"nodeClass":2,"browseName":{"namespaceIndex":3,"name":"Random"},"displayName":{"text":"Random"},"description":{"text":""},"writeMask":0,"userWriteMask":0,"value":-0.5189329,"dataType":"ns=0;i=11","valueRank":-1,"arrayDimensions":null,"accessLevel":5,"userAccessLevel":5,"minimumSamplingInterval":-1,"historizing":true},{"nodeId":"ns=3;i=1003","statusCode":{"value":0},"nodeClass":2,"browseName":{"namespaceIndex":3,"name":"Sawtooth"},"displayName":{"text":"Sawtooth"},"description":{"text":""},"writeMask":0,"userWriteMask":0,"value":-0.8,"dataType":"ns=0;i=11","valueRank":-1,"arrayDimensions":null,"accessLevel":5,"userAccessLevel":5,"minimumSamplingInterval":-1,"historizing":true},{"nodeId":"ns=3;i=1004","statusCode":{"value":0},"nodeClass":2,"browseName":{"namespaceIndex":3,"name":"Sinusoid"},"displayName":{"text":"Sinusoid"},"description":{"text":""},"writeMask":0,"userWriteMask":0,"value":-1.17557,"dataType":"ns=0;i=11","valueRank":-1,"arrayDimensions":null,"accessLevel":5,"userAccessLevel":5,"minimumSamplingInterval":-1,"historizing":true},{"nodeId":"ns=3;i=1005","statusCode":{"value":0},"nodeClass":2,"browseName":{"namespaceIndex":3,"name":"Square"},"displayName":{"text":"Square"},"description":{"text":""},"writeMask":0,"userWriteMask":0,"value":2,"dataType":"ns=0;i=11","valueRank":-1,"arrayDimensions":null,"accessLevel":5,"userAccessLevel":5,"minimumSamplingInterval":-1,"historizing":true},{"nodeId":"ns=3;i=1006","statusCode":{"value":0},"nodeClass":2,"browseName":{"namespaceIndex":3,"name":"Triangle"},"displayName":{"text":"Triangle"},"description":{"text":""},"writeMask":0,"userWriteMask":0,"value":-0.7999999,"dataType":"ns=0;i=11","valueRank":-1,"arrayDimensions":null,"accessLevel":5,"userAccessLevel":5,"minimumSamplingInterval":-1,"historizing":true}]
Fault subscribe flow using "listener node" as subscriber:
[
{
"id": "507d8e18.767b68",
"type": "tab",
"label": "opc listener",
"disabled": false,
"info": ""
},
{
"id": "39cdf744.28ca18",
"type": "OPCUA-IIoT-Inject",
"z": "507d8e18.767b68",
"injectType": "listen",
"payload": "{\"interval\":1000,\"queueSize\":4,\"options\":{\"requestedPublishingInterval\":1000,\"requestedLifetimeCount\":60,\"requestedMaxKeepAliveCount\":10,\"maxNotificationsPerPublish\":4,\"publishingEnabled\":true,\"priority\":1}}",
"payloadType": "json",
"topic": "",
"repeat": "",
"crontab": "",
"once": false,
"startDelay": "",
"name": "",
"addressSpaceItems": [],
"x": 170,
"y": 100,
"wires": [
[
"8b969a42.65dad8"
]
]
},
{
"id": "8b969a42.65dad8",
"type": "OPCUA-IIoT-Browser",
"z": "507d8e18.767b68",
"connector": "18fecfa6.964f1",
"nodeId": "ns=3;s=85/0:Simulation",
"name": "Single Browser",
"justValue": false,
"sendNodesToRead": false,
"sendNodesToListener": true,
"sendNodesToBrowser": false,
"multipleOutputs": false,
"recursiveBrowse": false,
"recursiveDepth": "1",
"delayPerMessage": "",
"showStatusActivities": false,
"showErrors": true,
"x": 340,
"y": 100,
"wires": [
[
"95f8eefc.7f68a8"
]
]
},
{
"id": "243f0736.abdc18",
"type": "debug",
"z": "507d8e18.767b68",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 730,
"y": 100,
"wires": []
},
{
"id": "95f8eefc.7f68a8",
"type": "OPCUA-IIoT-Listener",
"z": "507d8e18.767b68",
"connector": "18fecfa6.964f1",
"action": "subscribe",
"queueSize": "6",
"name": "",
"topic": "",
"justValue": true,
"useGroupItems": true,
"showStatusActivities": true,
"showErrors": true,
"x": 580,
"y": 100,
"wires": [
[
"243f0736.abdc18"
]
]
},
{
"id": "18fecfa6.964f1",
"type": "OPCUA-IIoT-Connector",
"discoveryUrl": "",
"endpoint": "opc.tcp://efc:53530/OPCUA/SimulationServer",
"keepSessionAlive": true,
"loginEnabled": false,
"securityPolicy": "None",
"securityMode": "None",
"name": "PROSYS SERVER",
"showErrors": true,
"individualCerts": false,
"publicCertificateFile": "",
"privateKeyFile": "",
"defaultSecureTokenLifetime": "60000",
"endpointMustExist": true,
"autoSelectRightEndpoint": true,
"strategyMaxRetry": "",
"strategyInitialDelay": "",
"strategyMaxDelay": "",
"strategyRandomisationFactor": "",
"requestedSessionTimeout": "",
"connectionStartDelay": "",
"reconnectDelay": "",
"maxBadSessionRequests": ""
}
]
Error message:
Error: encodeObject Error: [Error] Value: {
payload: {
addressSpaceItems: [ [Object] ],
nodetype: 'listen',
injectType: 'subscribe',
value: DataValue {
statusCode: [ConstantStatusCode],
sourceTimestamp: [Date],
sourcePicoseconds: 0,
serverTimestamp: [Date],
serverPicoseconds: 0,
value: [Variant]
},
monitoredItem: ClientMonitoredItemImpl {
_events: [Object: null prototype],
_eventsCount: 4,
_maxListeners: undefined,
statusCode: [ConstantStatusCode],
subscription: [ClientSubscriptionImpl],
itemToMonitor: [ReadValueId],
monitoringParameters: [MonitoringParameters],
monitoringMode: 2,
timestampsToReturn: 2,
result: [MonitoredItemCreateResult],
monitoredItemId: 5,
filterResult: undefined,
[Symbol(kCapture)]: false
}
},
topic: '',
justValue: false,
_msgid: 'c05f0190dbdeacf5'
}
If I enable "Send Just Values" listener node works but I didn't receive tag name or aditional data.
Any suggestions?
Node-RED and all nodes are updated.