10-18-2011 07:41 AM
Hi,
How do I set the absolute start time of a strip chart in measurement studio? In CVI I would do the following....
GetCurrentDateTime (&start_time);
SetCtrlAttribute(panel, control, ATTR_XAXIS_GAIN , gain );
SetCtrlAttribute(panel, control, ATTR_XAXIS_OFFSET, start_time);
Many thanks
10-18-2011 05:18 PM
I am not exactly sure what you want your timestamps to look like, but here is an example that uses some of the methods and properties you will need. I may be able to make a more specific example if you give me some more information.
double[] myArray = new double[10];
for (int i = 0; i < 10; i++)
myArray[i] = i % 4;
NationalInstruments.UI.AnalogWaveformPlotOptions plotOptions = new NationalInstruments.UI.AnalogWaveformPlotOptions(
NationalInstruments.UI.AnalogWaveformPlotDisplayMode.Time,
NationalInstruments.UI.AnalogWaveformPlotScaleMode.Scaled,
NationalInstruments.UI.AnalogWaveformPlotTimingMode.Auto);
waveformGraph1.Plots[0].DefaultTiming = NationalInstruments.WaveformTiming.CreateWithRegularInterval(
TimeSpan.FromSeconds(2),
DateTime.Now,
TimeSpan.FromSeconds(8));
NationalInstruments.AnalogWaveform<double> myWaveform = NationalInstruments.AnalogWaveform<double>.FromArray1D(myArray);
waveformGraph1.PlotWaveform<double>(myWaveform, plotOptions);
10-20-2011 03:47 AM
Hi,
I have a stripchart with multiple traces and would like to display the real time of day along the x-Axis in the format hh:mm:ss. Currently when I run the application, the stripchart start time defaults to 12:00:00 and I would like this to be the actual time of day.
As mentioned when I do this in CVI I simply set the offset value to the current time of day but I cannot see how to do this in Measurement Studio.
Hope this makes sense.
Thanks
10-21-2011 05:55 PM
double[] myArray = new double[10];
for (int i = 0; i < 10; i++)
myArray[i] = i % 4;
NationalInstruments.UI.AnalogWaveformPlotOptions plotOptions = new NationalInstruments.UI.AnalogWaveformPlotOptions(
NationalInstruments.UI.AnalogWaveformPlotDisplayMode.Time,
NationalInstruments.UI.AnalogWaveformPlotScaleMode.Scaled,
NationalInstruments.UI.AnalogWaveformPlotTimingMode.Auto);
waveformGraph1.Plots[0].DefaultTiming = NationalInstruments.WaveformTiming.CreateWithRegularInterval(
TimeSpan.FromSeconds(1),
DateTime.Now,
TimeSpan.FromSeconds(0));
NationalInstruments.AnalogWaveform<double> myWaveform = NationalInstruments.AnalogWaveform<double>.FromArray1D(myArray);
waveformGraph1.PlotWaveform<double>(myWaveform, plotOptions);
Plots something that looks like: