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.

Sync and Async Reads

More
18 Dec 2011 17:52 #723 by support
Sync and Async Reads was created by support
From: R.
Sent: Friday, December 16, 2011 2:34 PM
To: Zbynek Zahradnik
Subject: RE: Sync and Async Reads

Thanks. That’s exactly what I needed.

R.

From: Zbynek Zahradnik
Sent: Friday, December 16, 2011 2:11 AM
To: R.
Subject: RE: Sync and Async Reads

R.,

There are 2 factors in play here:

1) When the component already has a value, and it is not older than EasyDAClient.ClientMode.DesiredValueAge, it is used (passed to the caller) without invoking an OPC Read.

2) When a new item is read, it is initially placed onto a subscription; the component expects that it might be read again at some time. The initial update rate is given by EasyDAClient.UpdateRates.ReadAutomatic property; it later slows down and eventually the subscription is removed, if the application does not read the item repeatedly.

So, what happens in your case, is that the item is placed onto subscription, the component receives its value by the subscription, and because that’s a fairly new value, it passes it to the caller, without invoking an OPC Read.

Since other toolkits don’t do it this way, migrating instructions should instruct that the EasyDAClient.UpdateRates.ReadAutomatic is set to System.Threading.Timeout.Infinite, right after creating the EasyDAClient object. This will prevent a subscription from being created. In addition, the EasyDAClient.ClientMode.DesiredValueAge might be set to the value best suited for the application (0 will cause reads from the Device).

Best regards,
Zbynek Zahradnik

From: R.
Sent: Thursday, December 15, 2011 6:13 PM
To: Zbynek Zahradnik
Subject: Sync and Async Reads

Zbynek,

I am working on creating some sample solutions for migrating our existing SLIK-DAC toolkit users to your toolkit as we had previously discussed. I was testing the async vs sync read methods and monitoring the data in the TOP Server’s OPC diagnostics window. It appears that the EasyDaclient is actually setting up a subscription to the tag rather than issuing the IOPCSync:Read or IOPCAsync:Read calls. Can you explain to me a bit why that is?

Below is the code sample I was using the test this:

******

EasyDAClient1.ClientMode.DesiredMethod = OpcLabs.EasyOpc.DataAccess.DAReadWriteMethod.Asynchronous
Dim MyVTQ As New OpcLabs.EasyOpc.DataAccess.DAVtq
MyVTQ = EasyDAClient1.ReadItem("127.0.0.1", "SWToolbox.TOPServer.V5", "Channel_1.Device_1.Tag_1")

txtAsyncDA.Text = MyVTQ.Value.ToString
*****

Thanks in advance,
R.

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

Moderators: support
Time to create page: 0.050 seconds