Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

access real time data from another form

Hi

I am using C#. I acquired data for a specific configuration of Virtual channel input and stored in a public array named data[,].I used one of the example code:ContAcqVoltageSamples_IntClkwGr..

I wanted to access and plot the data to a WaveformGraph control(PlotYAppend) placed in another form as well I need to process the signal data. But I can't access the data[,] array from the other forms. For information, I need to acquire the data at the same time, i.e. the plots should be real.

I will appreciate any help in this regard.

thanks
Rahul
0 Kudos
Message 1 of 5
(3,485 Views)
pass the data array as a variable to the new form and then you can do your graphing and processing.
0 Kudos
Message 2 of 5
(3,479 Views)
Hi

Thanks for your reply. I request one more favour.I am quite new to this field. Can you please send me an example code as how to transfer the array as a variable to the new form?

I am eagerly waiting for your reply.

Thanks again.
0 Kudos
Message 3 of 5
(3,457 Views)
My MS is messed up right now so I can't make a simple example but the code looks like this.

In your code for your second form you have a piece of code like, you have to add the "double [] data"

public Form1(double [] data )
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
ReadinData();
EventHandlers();

//
// TODO: Add any constructor code after InitializeComponent call
//
}

In your main form you have to create the second form and show it.

Form1 NF = new Form1(data)
NF.Show();

With this method you have to finish reading all the data before you can view it. If you want to view the data as you read it reply back and I'll describe a way to do that also.
0 Kudos
Message 4 of 5
(3,454 Views)
Thanks a lot for your reply. Thanks again for the code as well.
But I need to display the data along with the reading. I can't finish reading before display.

Please let me know how to do that.

Thanks again
0 Kudos
Message 5 of 5
(3,447 Views)