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
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.

More
12 Aug 2020 09:07 #8740 by bvader
Hi,

we are testing QuickOPC UA Client with our application developed on .NET 3.1 platform. We have noticed that when using our application, which acts like an OPC UA Client, with SIMETIC NET OPC UA Server we have issue with reading the latest data from the PLC. I will explain the situation in a bit more detail below:

1. SIMATIC NET OPC UA server is running, tags are visible with OPC Scout, UAExpert... Monitoring of tags in these programs is disabled.
2. Value to the PLC datablock is written via QuickOPC client 1. Newly written value is visible in the PLC datablock.
3. .NET Core application (QuickOPC Client 2) which should detect a trigger, based on the value written to the PLC byClient 1 system, does not detect change of data. If readvalue method is used, old value of the PLC variable is read and not the latest actual value.

We have tested multiple options and have found out that .NET Core application detects the newly written value to the PLC if OPC Scout or UAExpert is monitoring this exact variable. If monitoring in these apps is disabled QuickOPC client does not detect the value change.

We have also tested subscriptions in our .NET Core application which do the trick and the PLC variable value change is detected by QuickOPC Client. If we want to use the subscription method we need to purchase the Ultimate version of the QuickOPC UA Client, correct?

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.

See the code below:
EasyUAClient.SharedParameters.EngineParameters.CertificateAcceptancePolicy.AcceptAnyCertificate = true;
 
      var client = new EasyUAClient();
      string server = "opc.tcp://P18011DemoS2:55105/";
      string address = "ns=6;s=S71500ET200MP station_1.PLC_1.dbAPI.PdbmApi[1].TimeSync.TimeSyncTriggerAndResponse";
 
      client.WriteValue(server, address,5); 
      var result = client.ReadValue(server, address);
 
      Console.WriteLine(result);

The C# code above executes in the following manner:
1. TimeSyncTriggerAndResponse variable value is 0.
2 Value 5 is written to variable TimeSyncTriggerAndResponse with QuickOPC UA client.
3. Value of TimeSyncTriggerAndResponse variable from the OPC UA Server node is read by the QuickOPC UA client and the read value is 0, not the latest value but the old value of the variable prior the execution of write function.

Can you confirm that QuickOPC can't read the latest values from the server node if SIMATIC NET OPC UA Server is used, unless if there is an established subscription to the locations for which we want to have the latest values? Is there a workaround or maybe some QuickOPC UA setting which we are missing?

We were testing with latest version of QuickOP UA Client and SIMATIC NET V15.1 and SIMATIC NET V16.

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

Moderators: support
Time to create page: 0.051 seconds