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.

Creating EasyDAClient

More
16 Mar 2012 10:36 #800 by support
P.,
No problem – but I can only offer limited advise with WPF as well.

In general, the EasyDAClient objects that you create are just a thin “façade” over the underlying engine that drives the OPC connections. You can therefore create and use multiple EasyDAClient objects, or even keep creating/”forgetting” them without much worries. If you, however, hook to the object events, and the event handler is e.g. your WPF Form that gets created and removed, then you need to take care of unhooking the event handler as well, otherwise both the EasyDAClient object and the form will stay in existence.

If you have permanent “control” functionality in your application, then such functionality (and corresponding EasyDAClient object) belongs to some class with longer lifetime than the transient user interface objects – maybe a main window, or even a separate, non-UI class.

Other functionality, such as displaying values on forms, can use EasyDAClient objects located on the actual forms.

I hope this helps. Best regards,
Zbynek Zahradnik

From: P.
Sent: Thursday, March 15, 2012 9:18 AM
To: Zbynek Zahradnik
Subject: RE: OPC.net question

Zbynek

Thanks. Can I ask you another question which probably says a lot about my lack of experience with c# development.

I am planning on creating a public class to hold the code that reads the data from the OPC Server and then exposing the values I read using public properties. I am using WPF as the user interface with only one page in memory at any one time. Would you think that the best way is to create a new instance of my OPCData class every time I open a page so that I can be sure that the comms is always monitored?

Regards

P.

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

Moderators: support
Time to create page: 0.041 seconds