mikakaraila / node-red-contrib-opcua

A Node-RED node to communicate OPC UA. Uses node-opcua library.
Other
214 stars 197 forks source link

Issue: Queue overflow - one value missing #348

Open tr1kkk opened 3 years ago

tr1kkk commented 3 years ago

Hello everyone,

First things first, thank you all for sharing this opc ua contribution, it has been very useful!

I've been testing the capacities and limitations of Siemens Controllers (S7-1500) and I've found something that can be an issue of the opcua node.

The idea was to see how many data I could loose, so I created an overflow of the queue size.

My PLC1515F was set as:

My Node-RED OPC UA Client flow was set as:

Knowing the characteristics of this PLC being able to queue 10 values, I created a variable that has its value changed each 200ms, from 1 to 15. I'm expecting to loose 5 of the values in each of the publishing time.

The variables were written into a csv file and the results showed each 3s "package" had 9 values instead of 10 as it was supposed to. See table below:

<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40">

CLIENT_HOUR | VARIABLE | VALUE | Qty -- | -- | -- | -- 10:12:26354 | s="simulationBlock_DB"."test" | 12 | 9 values 10:12:26355 | s="simulationBlock_DB"."test" | 13 10:12:26355 | s="simulationBlock_DB"."test" | 14 10:12:26355 | s="simulationBlock_DB"."test" | 15 10:12:26355 | s="simulationBlock_DB"."test" | 1 10:12:26355 | s="simulationBlock_DB"."test" | 2 10:12:26355 | s="simulationBlock_DB"."test" | 3 10:12:26355 | s="simulationBlock_DB"."test" | 4 10:12:26355 | s="simulationBlock_DB"."test" | 5 10:12:29409 | s="simulationBlock_DB"."test" | 12 | 9 values 10:12:29409 | s="simulationBlock_DB"."test" | 13 10:12:29409 | s="simulationBlock_DB"."test" | 14 10:12:29409 | s="simulationBlock_DB"."test" | 15 10:12:29409 | s="simulationBlock_DB"."test" | 1 10:12:29409 | s="simulationBlock_DB"."test" | 2 10:12:29409 | s="simulationBlock_DB"."test" | 3 10:12:29409 | s="simulationBlock_DB"."test" | 4 10:12:29409 | s="simulationBlock_DB"."test" | 5

To check if it wasn't a problem with my PLC, I repeated the test using UA Expert and the results were different, with UA Expert Data Logger I've achieved to recover the full package of 10 queued values, as table below: <html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40">

ServerTimeStamp | Value | Qty -- | -- | -- 2021-10-22T13:12:22.411Z | 7 | 10 values 2021-10-22T13:12:22.611Z | 8 2021-10-22T13:12:22.811Z | 9 2021-10-22T13:12:23.010Z | 10 2021-10-22T13:12:23.210Z | 11 2021-10-22T13:12:23.410Z | 12 2021-10-22T13:12:23.610Z | 13 2021-10-22T13:12:23.810Z | 14 2021-10-22T13:12:24.010Z | 15 2021-10-22T13:12:24.210Z | 1 2021-10-22T13:12:25.410Z | 7 | 10 values 2021-10-22T13:12:25.610Z | 8 2021-10-22T13:12:25.810Z | 9 2021-10-22T13:12:26.010Z | 10 2021-10-22T13:12:26.210Z | 11 2021-10-22T13:12:26.410Z | 12 2021-10-22T13:12:26.610Z | 13 2021-10-22T13:12:26.810Z | 14 2021-10-22T13:12:27.010Z | 15 2021-10-22T13:12:27.210Z | 1

I hope my explanation is clear, it would very useful if anyone can take a look regarding this issue.

I will provide any additional info if required.

opcuaTestNode.txt NodeRedResults.csv UAExpertResults.csv

mikakaraila commented 3 years ago

It depends on both sides how your server will queue and this is client side code that will build subscription parameters:

image

I expect you need to modify those to use it as "data-logger".