Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

WaveformGraph with time plot

How do I set the WaveformGraph control x-axis to indicate time (system time?) instead of number of samples?
I'm using Measurement Studio and C#.
 
Thanks
0 Kudos
Message 1 of 3
(3,042 Views)

Hi sthompson,

Somewhere in your program, you are setting the range of your waveform graph.  It probably looks something like this:

this.xAxis.Range = new NationalInstruments.UI.Range(0, 20);

Instead of passing two numerics, we need to pass two DateTime objects:

this

.xAxis.Range = new NationalInstruments.UI.Range(DateTime.Now, TimeSpan.FromSeconds(10));

Also, you must change the default start and increment so it reflects this new range.  You need to make sure your increment value matches your timer tick interval as well (if you are using a timer):

this.waveformPlot.DefaultStart = (double)DataConverter.Convert(DateTime.Now, typeof(double));
this.waveformPlot.DefaultIncrement = (double)DataConverter.Convert(TimeSpan.FromMilliseconds(100), typeof(double));

I hope this helps.  Let us know if you have any questions!

Matt S
National Instruments
Applications Engineer
0 Kudos
Message 2 of 3
(3,014 Views)

Thanks you for the help. Having read quite a  few of the questions posted to this forum, it seems there are quite a few

lost souls out there seeking information. I only wish there were some good textbooks on Measurement Studio available.

Regards,

Sthompson.

 

0 Kudos
Message 3 of 3
(3,011 Views)