Closed xshan8333 closed 5 years ago
Hi,
cya Klaus
API docs ClientSubscription node-ocpua
- options.trigger {DataChangeTrigger} {Status|StatusValue|StatusValueTimestamp}
- options.deadbandType {DeadbandType} {None|Absolute|Percent}
- options.deadbandValue {Double}
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": "" } ]
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" } }
That is to set from your first inject to the listener. It does not change with next option injects without a deploy before.
Problem
( ) unexpected behavior => please visit the Wiki before
Current behavior
I get Square1 data from Prosys simulation server. but get changed data only!
Expected behavior
I want DataChangeFilter=StatusValueTimestamp. How can i set it?
Minimal reproduction of the problem with instructions
1.inject is { "interval": 1000, "queueSize": 1}
Your Environment
Please tell us about your environment:
(X) I am using just the Node-RED package and got node-opcua installed with it
( ) I have installed node-opcua global from source (using git clone)
(X) I have installed node-opcua as a global package (using npm i -g)
Device :
( ) macOS: v
( ) Linux: v
( ) Windows: v
(X) Raspbian: v
( ) Other:
Description of the connecting OPC UA system:
node-red-contrib-iiot-opcua version: `` node-red-contrib-iiot-opcua@2.7.1
Node: (min. 8.x) node = v8.12.0 node-red = V0.19.4