08-28-2009 11:40 AM
Hi,
I am new to .NET, so I tried to use the NI ContAcqVoltageSamples_IntClk_ToFile example to get an anlog reading, display and save. I also wanted to add a plot and gage control to display the waveform on the plot and the current reading on the gage. But had difficulty converting the data array in the example to a format I can use for the plot and the gage.
Does anyone know of any example code to perform this task?
Thank you very much for any help.
Here is a portion of the NI example code that I am trying to add these futures
private double[,] data;
//Read the available data from the channels
data = analogInReader.EndReadMultiSample(ar);
//Plot your data here
//Displays data in grid and writes to file
DisplayData(data, ref dataTable);
LogData(data);
analogInReader.BeginReadMultiSample(Convert.ToInt32(samplesPerChannelNumeric.Value),
analogCallback, myTask);
08-31-2009 12:30 PM
Hi ege,
You should be able to call something similar to: waveformGraph1.PlotYMulitple(data). There is an example of plotting continuously acquired data using the Waveform graph at this link. Also, if you go to the Measurement Studio help, and perform a search on "gauge" you will come up with an article entitled "Walkthrough: Creating a Measurement Studio Application with Windows Forms Controls and Analysis" that will walk you through using both a Waveform Graph control and a Gauge control along with example code. Hopefully this will help out!