473,322 Members | 1,345 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Form refresh - Class comunications

Hi,

I'm developing an application that use an OPC client. In this
application I create a class <Ato manage the OPC data (read values
from server every xxx seconds or with subscription, ecc...). In the
application form I put some label, checkbox, ecc.. to show the values
readed from the server and stored in <A>. How can I update
automatically the window object with the values readed? If it is not
possible, which is the better mode to read the data from OPC server and
update the form?

Thank you!

Jan 3 '07 #1
1 1711
al********@gmail.com wrote:
Hi,

I'm developing an application that use an OPC client. In this
application I create a class <Ato manage the OPC data (read values
from server every xxx seconds or with subscription, ecc...). In the
application form I put some label, checkbox, ecc.. to show the values
readed from the server and stored in <A>. How can I update
automatically the window object with the values readed? If it is not
possible, which is the better mode to read the data from OPC server and
update the form?

Thank you!

you want to create an event inside class A called DataRecieved. And
then, on your windows from, you want to add an event handler to listen
to that event.

Inside your event handler function, you can update the windows form.
Make sure you check, from.InvokeRequired to marshal the call to the
proper thread.

HTH.
John.
Jan 3 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Drakier Dominaeus | last post by:
This is my first time posting here, so please forgive me if I do anything incorrectly. I've been learning C# and working with different things and decided I wanted to get into Multi-Threading....
2
by: Peter Oliphant | last post by:
I now have graphics being drawn in the Paint event of my form (yeah, and it's very cool). Problem was that it only updated any changes to these graphics when Paint was called. So, I then made it...
4
by: Cath Victor | last post by:
Hi... I have a windows form that calls/uses a class to do some processing. I want this class to return values or append text to the form's textbox as it processes data. Any of you guys know how...
1
by: tmaster | last post by:
Within a class, can I create a property that is a listview? Here's what I tried, but it doesn't seem to work: '------------ create property to give the second form access to the first form's...
16
by: Adda | last post by:
If I cycle through the MdiChildActivate event of the parent form I can read text in a textbox on the child mdiform -- console.writeline(Me.ActiveMdiChild.Controls(1).Text) But if I have a sub...
1
by: Martin Racette | last post by:
Hi, I tried the first part of the suggested code below (in a test program first), and all I get is an error telling me that "System.Windows.Forms.ToolStripStatusLabel" is not define and the same...
4
by: Rich | last post by:
Hello, I have a child form in an Mdi Parent form. I have 5 menu buttons on the Parent that I use to show the child form. Originally, in the Parent form on load event I had this line of code ...
6
by: Chris Larmer | last post by:
I have two subforms in my main form. In the main form I want the user to select a customer, class, and date range. The 2 subforms are similar. One is the history records in the recent past and the...
1
by: romerve | last post by:
Hello; i am having some problems trying to get a form that has a datagridview to refresh after a new record is created. I have a MDI container and menu form and add new record form; the menu...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.