Professional OPC
Development Tools

logos

Online Forums

Technical support is provided through Support Forums below. Anybody can view them; you need to Register/Login to our site (see links in upper right corner) in order to Post questions. You do not have to be a licensed user of our product.

Please read Rules for forum posts before reporting your issue or asking a question. OPC Labs team is actively monitoring the forums, and replies as soon as possible. Various technical information can also be found in our Knowledge Base. For your convenience, we have also assembled a Frequently Asked Questions page.

Do not use the Contact page for technical issues.

QuickOPC and SIMATIC NET - reading problems

More
17 Aug 2020 12:30 #8775 by support
Thank you for letting me know.
I am glad that it works now :-)

Best regards

Please Log in or Create an account to join the conversation.

More
17 Aug 2020 10:32 #8774 by bvader
Hi,

thank you for your fast reply. My colleague tested implementation of application with your suggestion and it works properly, the read values are now the latest values.

Please Log in or Create an account to join the conversation.

More
13 Aug 2020 13:23 #8762 by support
Hello,

I will answer your questions, but there is one more thing that can be causing this behavior:
There are certain parameters associated with each Read call; one of these parameters is "maximum age". The default setting for that in QuickOPC is Int32.MaxValue, which denotes reading from cache.

Do you specify any read parameters?
If not, I suggest that you change your code to specify the maximum age zero, which denotes "reading from the device".

More information:
- opclabs.doc-that.com/files/onlinedocs/QuickOpc/Latest/User%2...s%20of%20OPC%20UA%20Nodes.html
- opclabs.doc-that.com/files/onlinedocs/QuickOpc/Latest/User%2...dArguments~ReadParameters.html
- opclabs.doc-that.com/files/onlinedocs/QuickOpc/Latest/User%2...ReadParameters~MaximumAge.html

Best regards

Please Log in or Create an account to join the conversation.

More
13 Aug 2020 08:56 #8756 by bvader
So after additional testing we have come to the following conclusion. If there is an active connection, establish by some other OPC UA Client such as OPC Scout, UAExpert, Traeger OPC UA Client etc. which don't use connectionless approach (need to call connect method before being able to read and write), SIMATIC NET OPC UA Server data is refreshed promptly and we receiv the expevted values fro mthe server when readin with QuickOPC UA Client. If there is no connection establieshed, read value is wrong (last old value read by the server when there was some kind of connection established).

Is there a way for QuickOPC UA Client to establish an active connection to the OPC UA Server? I think this would solve the issues we are currently facing.

Please Log in or Create an account to join the conversation.

More
13 Aug 2020 08:41 #8755 by bvader
Hi,

Client 1 is GE Ifix which is reading and writting values from / to OPC UA Server via QuickOPC for COM.

Client 2 is our .Net Core application which is reading ang writting values from / to OPC UA Server via QuickOPC for .Net Core.

Please Log in or Create an account to join the conversation.

More
13 Aug 2020 08:20 #8752 by support
Hello,
in your description, what are the clients "Client 1" and "Client 2"? Are they programs written with QuickOPC, or some other UA client software?

Regards

Please Log in or Create an account to join the conversation.

More
13 Aug 2020 06:16 #8747 by bvader
We have performed another test today using SIMATIC NET. We have subscribed to all parameters on the OPC UA server and are checking the trigger variables based on a timer every 500 ms. OPC UA client writes the data to the OPC UA Server sequentially in a manner "Username", "Password", "trigger". Once the trigger value is changed, our application detects the trigger and starts handling the received data. Once the operation is finished a response from our application is written to the trigger location. In the next time cycle this same trigger, to which we have written the reponse, detects a value (old value) which again triggers the function but it shouldn't becase the trigger value was overwritten by the application in the previous time cycle.

Time cycle 1:
1. Client 1 writes username to server
2. Client 1 writes password to server
3. Client 1 writes trigger to server (value 1)
4. Client 2 detects the trigger in its current time cycle
5. Client 2 handles the received data
6. Client 2 writes a response to the trigger location (value 2)

Time cycle 2:
1. Client 2 reads the trigger location
2. Client 2 reads value 1 from the trigger location (it should read value 2)
3. Client 2 handles received data again (data from the allready handled trigger)
4....

Time cycle 3:
1. Client 2 reads the trigger location
2. Client 2 reads value 2 from the trigger location (this value was written by Client 2 in Time cycle 1)
3. ....

To tell things short, subscribing to a variable didn't resolve the issue of receiving old data from the OPC UA server. Any suggestions how to solve this?

Please Log in or Create an account to join the conversation.

More
12 Aug 2020 11:14 #8744 by bvader
Looks like QuickReply didn't work.

CompletesAsynchronously is se to false.

We have conducted a test Where OPC SCout was on client and the second one was UAExpert. We have written the value with UAExpert to the PLC and the read value by OPC Scout was correct.

If we execute the code from my original post the read value is the old value, wrong value. QuickOPC only gets the correct value if either OPC Scout Monitoring is active or monitoring in UAExpert is active, meaning when connection to the OPC server is established.

Is there a way to open and maintain connection to the OPC UA server by QuickOPC UA client? Apart from subscribing to desired variables.

Please Log in or Create an account to join the conversation.

More
12 Aug 2020 10:24 #8742 by bvader
Hi,

thank you for your quick response. We will make a quick test qith OPC Scout as one client and UAExpert as the second and see what happens. Will let you know as soon as we have performed the test.

Regarding the different setup, it is different, see below:

1. SIMATIC NET is our OPC UA Server which is reading tags from S7-1500 PLC. This method does not work, returns old values.
2. Siemens PLC S7-1500 itself is our OPC Server, does not involve SIMATIC NET OPC UA Server. This method works, returns new values.

Program code is identical in both above mentioned cases.

We will check regarding "CompletesAsynchronously" and get back to you on this one as well.

Please Log in or Create an account to join the conversation.

More
12 Aug 2020 10:16 - 12 Aug 2020 10:17 #8741 by support
This looks most likely like a bug in the OPC UA Server.
Establishing a subscription from one client should not have influence on whether changes are detected by another client.

It would be possible to determine "who is at fault" by taking Wireshark traces and related logs - see kb.opclabs.com/Collecting_information_for_troubleshooting .

You can also do the same thing with other OPC UA clients and see if you get the same problem. I do not see that mentioned anywhere in your report, yet that is the first thing I would do. For example, run two instances of UAExpert, on for writing, the other for reading, and see if no subscriptions are involved whether that works or not.

Regarding

We have also tested a bit different setup where OPC UA server was started on the Siemens S7-1500 PLC and new PLC variable value was written from Client 1, change of value is detected and Client 2 has the accurate value.

: I do not understand what is the difference between this, and the setup you described before. Please explain.

You do not need the QuickOPC Ultimate for OPC UA subscriptions. In general, QuickOPC Standard is sufficient (see opclabs.doc-that.com/files/onlinedocs/QuickOpc/Latest/User%2...e.html#Product%20Editions.html ), You might have confused the client-subscriptions in OPC UA client-server model (which is what you are referring to) with OPC UA PubSub, which is a completely different model.

Regarding the example code, I do not see anything wrong with it. Since the calls are synchronous, the written value should be available for reading immediately after the WriteValue call returns. With one exception (which I do not think is the case here, but need to be mentioned): The server has the option to return "completes asynchronously" flag from the Write service, indicating that the actual Write might be completed later. The WriteValue returns a tuple
(bool Clamped, bool CompletesAsynchronously)
so you should inspect the returned value whether the CompletesAsynchronously is not set - in which case the imemdiately following ReadValue may legitimely return ther "old" value - but at some later point (after a delay) the "new" value should be there anyway. And I do not think that the server will actually return CompletesAsynchronously == true; but it has to be mentioned, for completeness.

Best regards
Last edit: 12 Aug 2020 10:17 by support.

Please Log in or Create an account to join the conversation.

Moderators: support
Time to create page: 0.230 seconds