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.