Professional OPC
Development Tools

logos

Reading multiple variable values, timing and synchronization in respect of OPC Server

More
01 Sep 2015 16:02 #3537 by support

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

  • Alexander
  • Topic Author
  • Visitor
  • Visitor
01 Sep 2015 14:36 #3535 by Alexander
We have forced Reads from Device and this gave us the actual values as required.

Many Thanks for your support.

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

More
17 Aug 2015 12:02 #3488 by support
Hello,
I am not sure if I correctly understand the issue. I can imagine two interpretations:

1) The "trigger" variable in the OPC server is signaled *before* all OPC data items that it covers have their proper values.

In this case, I am afraid, the issue needs to be solved on the server side, or you need to resort to artificial delays, as you have already done.

2) The "trigger" variable in the OPC server is signaled *after* all OPC data items it covers have their proper values, but for some reason, when reading those OPC items, you get values that are older.

In this case, the reason may be in the way OPC (the specification), and also QuickOPC (as a client implementation), handle the Reads. In OPC Data Access 2.0, it is possible (for the client) to specify a read from the (server's) Cache, or from a Device. In OPC Data Access 3.0, in addition to this, the client can also specify a read by MaxAge (of the value). QuickOPC uses possibly all these methods interchangeably, also adds a read from "memory", providing you with a value that it already has in its (client-side) cache, if it is fresh enough. There is default setting in EasyDAClient that specifies that the values you get should not be "older" than 1000 milliseconds; if we don't have such value already for you, we call the server, and use Device, Cache, or MaxAge method, depending on the circumstances.

You can force a Read from Device e.g. like this:
var client = new EasyDAClient();
DAVtq vtq = client.ReadItem("OPCLabs.KitServer.2", "Simulation.Random", 
    new DAReadParameters(DADataSource.Device));
Best regards
The following user(s) said Thank You: Alexander

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

  • Alexander
  • Topic Author
  • Visitor
  • Visitor
15 Aug 2015 20:54 #3485 by Alexander
Hello,

We have recently obtained QuickOPC licenses and integrated its libraries with our application, running with Bachman equipment and OPC Server successfully.

However, during more intense testing we discovered an issue that we wish discussing with you how best to solve.

The process control unit behind the OPC server writes a set of variables first, and then writes a designated variable that triggers the application to read that written associated variables set.
For example, the control unit writes a protocol record in a variable or two, and then notifies via another variable that the associated protocol values are ready to read. The application is then triggered by that designated variable, and reads the associated set of variables subsequently.

The issue we experience here is now as follows: The application is triggered to read the associated variable set what it then does. The values it reads, however, are still the old (previous) ones. The write-operations for the associated variables set complete following the write operation to the trigger variable. They also complete in different times, so that the arrival of the new values varies in their sort order compared to the original order of the write operations.

That means finally for us that the value of the trigger variable arrives faster than the values from write-operations to the associated variable set, accompanied by another sort order of arrival. Accordingly, we read the wrong values.

As yet, we sorted this issue by a simple delay following arrival of the trigger variable value. We chose a delay of 100 milliseconds. This seems to help by letting a sufficient amount of time the write operations to complete for the associated set of variables.

However, we think, that cannot be the final solution so that we look for a solution that gives us a proper synchronization mechanism that avoids any sort of this kind timing issues.

Please, can you advise on a way to proceed here in terms of capabilities that QuickOPC provides us for the communication with the OPC Server to achieve a proper mechanism here.

Many Thanks
Alexander Fridman

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

Moderators: support
Time to create page: 0.186 seconds

      

 Recommend this on Google