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.

Reading OPC DA Items Cyclic

More
27 Mar 2024 07:39 #12692 by support

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

More
27 Mar 2024 01:45 #12689 by Marrgo
Replied by Marrgo on topic Reading OPC DA Items Cyclic
Hello.

I have one question.

In a situation where values ​​are read every second using OPC DA's ReadMultipleItems function,

When the OPC DA Server is shut down for a certain period of time (for example, about a day) and then turned on,

Is it possible to reconnect to the OPC DA Server and obtain the value normally again just by continuously calling the OPC DA's ReadMultipleItems function?

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

More
07 Mar 2022 11:15 #10707 by support
Replied by support on topic Reading OPC DA Items Cyclic
Hello.

QuickOPC does connection/disconnections for you, you cannot directly control it ( opclabs.doc-that.com/files/onlinedocs/QuickOpc/Latest/User%2...tml#Connection%20handling.html )

QuickOPC holds the connection open for some time after each read. If your code makes the next reader after a longer time, a new connection will be needed. You can increase the hold period for it to be longer than your read cycles, and then the connection will stay open.

An example of setting the hold period is here:
- opclabs.doc-that.com/files/onlinedocs/QuickOpc/Latest/User%2...tting%20a%20hold%20period.html

But it does the opposite (setting it very short). You need to set it longer (and for Read, not for Write, so it would be the .TopicRead property)

Best regards

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

More
07 Mar 2022 10:36 #10706 by mut9bu
Hello
I can connect to the remote OPC server and read multiple tags with the following code, without problem. But I want to read the items periodicaly.
If I run the code periodicaly, i think i will also make the connection to the OPC DA Server each time repeatedly.
How can I first just make the connection to the OPC DA server, and then read the items? (seperately)
So , i could run just the reading part periodically.
I couldnt a find a code example, for just connecting to the server (without reading tag)

Or is there a better way for reading periodically?


public static void Main1()
{
// Instantiate the client object.
var client = new EasyDAClient();

DAVtqResult[] vtqResults = client.ReadMultipleItems("opcda://10.92.XXX.XXX/OPC.IwSCP.1",
new DAItemDescriptor[]
{
"Simulation.Random", "Trends.Ramp (1 min)", "Trends.Sine (1 min)", "Simulation.Register_I4"
});

for (int i = 0; i < vtqResults.Length; i++)
{
Debug.Assert(vtqResults != null);

if (vtqResults.Succeeded)
Console.WriteLine("vtqResults[{0}].Vtq: {1}", i, vtqResults.Vtq);
else
Console.WriteLine("vtqResults[{0}] *** Failure: {1}", i, vtqResults.ErrorMessageBrief);
}
}

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

Moderators: support
Time to create page: 0.049 seconds