ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

multiple waveformplot

Hi Sir :

 

I use measurement studio 2013 for my project.

 

There is a waveformgraph and twenty waveformplots in my project.

 

In my project, I need waveformPlot.GetYData() method to get Y data.
 
Since, I have twenty waveformplots, I need to write twenty statements in function likes below.
 
waveformPlot0.GetYData();
waveformPlot1.GetYData();
waveformPlot2.GetYData();
waveformPlot3.GetYData();
waveformPlot4.GetYData();
waveformPlot5.GetYData();
…………
waveformPlot18.GetYData();
waveformPlot19.GetYData();
 
Is it possible to use for loop to shorten statements like below?
 
for(int i=0; i<20; i++)
{
       waveformPloti.GetYData();
}
 
In C#, there is a function which calls find controls, and I can write my function very simple.
 
for (int i = 0; i < 20; i++) // suppose that I have twenty TextBoxs
{
    TextBox gain_tbx = this.Controls.Find("gain_tb" + i.ToString(), true).FirstOrDefault() as TextBox;
    if (gain_tbx != null)
    {
       gain[i] = Convert.ToInt16(gain_tbx.Text);
    }
}
 
Please give me your suggestion!
 
Best regards,
 
Marcus

0 Kudos
Message 1 of 1
(4,494 Views)