Closed MileBuurmeijer closed 4 years ago
Finally I had the time to do testing of the underlying node-opcua node-module. I edited the sample-client.ts in the node-opcua-samples package so that it sets the sampling interval of the monitored item to zero. When I ran this sample-client.ts is published far more values than with the original sampling interval of 1000 in the sample client. I have no means to check if the used OPC UA server (opc.tcp://milo.digitalpetri.com:62541/milo) has sent all the samples that occurred, but for now, I think I can conclude the node-opcua package does support setting sampling interval to zero and that node-red-contrib-iiot-opcua should be able to support setting sampling interval to zero. If only I was more fluent in javascript I could check where in the source code it checks for non-zero values of the sampling interval. Could someone point me in the right direction? If so I would like to try to change it myself and do some more testing.
Ok I think I found it in the "core/opcua-iiot-core-listener.js" on row 224 and on row 277. If the part options.interval >= coreListener.MIN_LISTENER_INTERVAL
is replaced by (options.interval >= coreListener.MIN_LISTENER_INTERVAL || options.interval == 0)
it should work. I can not test is myself, but love to see this fixed and use this great IIOT-OPCUA package.
Did some more testing and found out that node-js itself is very fast. I could receive up to 7000 samples per second from my OPC UA server. The server was derived from the Eclipse Milo project (see github OPCUA-Player. Any ideas if node-red would be capable of processing up to 7000 s/s?
Minimum is set to 0 now -- you can test it if it works for you and if node-opcua will accept it
Problem
Information
Current behavior When subscribing to an OPC UA server with 2 monitored items in a subscription and each with sampling interval set to zero, not every data value the OPC UA server creates is sent to this Node-Red IIOT OPC UA client
Expected behavior When setting sampling interval to zero on a monitored item the expected behavior is that each data value the OPC UA server creates is sent to this Node-Red IIOT OPC UA client
Minimal reproduction of the problem with instructions
Your Environment
Please tell us about your environment:
( *) 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)
( ) I have installed node-opcua as a global package (using npm i -g)
Device :
( ) macOS: v
(x ) Linux: v 19.04 (Unbuntu)
( ) Windows: v
( ) Raspbian: v
( ) Other:
Description of the connecting OPC UA system:
Node-RED version: 0.20.5
node-red-contrib-iiot-opcua version: `` 3.10.20
Node: (min. 8.x)
node --version
= 9.10.1