Sinusoid simulation value returns 0 on first read
- May 19, 2021
- 2 replies
- 3231 views
Hello! I wonder if someone can explain the behaviour of KepServer described below. I couldn't find anything similar online.
Context:
I'm building a POC of an application with an OPC UA client in it. For that I'm using node-opcua opensource product.
I'm using KEPServerEX 6.10 as an OPC UA server.
Use case:
I have a basic script that reads a value attribute from the server. The node is pre-configured and comes out of the box with Kepware Server. Node ID is ns=2;s=Simulation Examples.Functions.Sine1.
The script establishes a connection with the server, creates a session, reads a values, closes the session, disconnects from the server.
Expected behaviour:
Each script invocation should return a simulated sinusoid value.
Actual behaviour:
First script invocation returns 0 (zero) value. Response status code is 0 (Good). Subsequent request if it happens within 5 seconds, returns a legit sinusoid value, e.g. 0.20106108486652374. I figured "Tag Cache Timeout (s)" in KepServer Project Settings is relevant. It is set to 5 seconds by default.
Question:
How do I make initial data read return a valid value and not a zero?

