BiancoRoyal / node-red-contrib-iiot-opcua

deprecated - very new developed by PLUS for Node-RED - https://plus4nodered.com
https://www.npmjs.com/package/node-red-contrib-iiot-opcua
BSD 3-Clause "New" or "Revised" License
34 stars 8 forks source link

How to set DataChangeFilter in listener #59

Closed xshan8333 closed 5 years ago

xshan8333 commented 5 years ago

Problem

Your Environment

Please tell us about your environment:

biancode commented 5 years ago

Hi,

cya Klaus

biancode commented 5 years ago

API docs ClientSubscription node-ocpua

  • options.trigger {DataChangeTrigger} {Status|StatusValue|StatusValueTimestamp}
    • options.deadbandType {DeadbandType} {None|Absolute|Percent}
    • options.deadbandValue {Double}
xshan8333 commented 5 years ago

Hi, biancode: I just study OPC UA with node-red. be prepare for access some PLC device. I use node-red-contrib-iiot-opcua for first time now, so i need some help. sorry set bug report, but i donot known how to set "DataChangeTrigger ..." options in node-red. next is my flow in node-red. maybe give me some advice? thanks.

[ { "id": "a6f7c370.9501a8", "type": "tab", "label": "opc listen", "disabled": false, "info": "" }, { "id": "b53de21a.c7a54", "type": "OPCUA-IIoT-Listener", "z": "a6f7c370.9501a8", "connector": "70d1df5f.2610f", "action": "subscribe", "queueSize": "1", "name": "", "justValue": true, "showStatusActivities": false, "showErrors": false, "x": 360, "y": 120, "wires": [ [ "e1aa9291.176f7", "768cc25c.ecc684" ] ] }, { "id": "b94f91b8.790088", "type": "OPCUA-IIoT-Inject", "z": "a6f7c370.9501a8", "injectType": "listen", "payload": "{\"interval\":1000,\"queueSize\":1}", "payloadType": "json", "topic": "", "repeat": "", "crontab": "", "once": true, "startDelay": "", "name": "listen Square1", "addressSpaceItems": [ { "name": "", "nodeId": "ns=5;s=Square1", "datatypeName": "" } ], "x": 160, "y": 120, "wires": [ [ "b53de21a.c7a54" ] ] }, { "id": "768cc25c.ecc684", "type": "debug", "z": "a6f7c370.9501a8", "name": "", "active": true, "tosidebar": true, "console": false, "complete": "true", "x": 850, "y": 120, "wires": [] }, { "id": "e1aa9291.176f7", "type": "OPCUA-IIoT-Response", "z": "a6f7c370.9501a8", "name": "", "showStatusActivities": false, "showErrors": true, "x": 520, "y": 180, "wires": [ [ "29963671.fed68a" ] ] }, { "id": "29963671.fed68a", "type": "function", "z": "a6f7c370.9501a8", "name": "", "func": "var msg1 = {};\n\nmsg1.topic = msg.addressSpaceItems[0].nodeId;\nmsg1.payload = msg.payload.value.value;\nmsg1.timestamp = msg.payload.sourceTimestamp;\n\n//{topic:\"name\", payload:value, timestamp:1520527095000}\nreturn msg1;", "outputs": 1, "noerr": 0, "x": 670, "y": 180, "wires": [ [ "768cc25c.ecc684" ] ] }, { "id": "70d1df5f.2610f", "type": "OPCUA-IIoT-Connector", "z": "", "discoveryUrl": "", "endpoint": "opc.tcp://10.190.41.9:53530/OPCUA/SimulationServer", "keepSessionAlive": true, "loginEnabled": true, "securityPolicy": "None", "securityMode": "NONE", "name": "PROSYS SERVER", "showErrors": true, "publicCertificateFile": "", "privateKeyFile": "", "defaultSecureTokenLifetime": "60000", "endpointMustExist": false, "autoSelectRightEndpoint": false, "strategyMaxRetry": "", "strategyInitialDelay": "", "strategyMaxDelay": "", "strategyRandomisationFactor": "", "requestedSessionTimeout": "" } ]

biancode commented 5 years ago

it works as expected via listener parameters

{ "interval": 200, "queueSize": 10, "options": { "requestedPublishingInterval": 1000, "requestedLifetimeCount": 1000, "requestedMaxKeepAliveCount": 12, "maxNotificationsPerPublish": 100, "publishingEnabled": true, "priority": 6, "trigger": "StatusValueTimestamp" } }

biancode commented 5 years ago

That is to set from your first inject to the listener. It does not change with next option injects without a deploy before.