Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Need assistance setting WaveformGraph XAxis to time intervals starting at 0

I've been fumbling with a WaveformGraph in a finite aquisition program. It records 100 points at 10kHz.

 

I plot the data as below:

 

 

waveformGraph1.PlotWaveforms<double>(dataIn, new AnalogWaveformPlotOptions(AnalogWaveformPlotDisplayMode.Time, AnalogWaveformPlotScaleMode.Scaled));

 

But it doesn't plot in milliseconds or anything, it plots with major marks at "6.337e10", which, though some sleuthing, I think are "ticks" in the Timing property. I can't seem to find a way to convince it to use something else -- something more reasonable. When I try to set a different XAxis, it shifts and only shows me the select part of the dataset at that X-Range.

 

I hope this is descriptive enough; if you need clarification, please let me know. Thanks much.


 

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

In the properties of the WaveformGraph (you can use Design mode for this if you want) you can edit the X-axis ranges and scaling. It sounds like you just have this set to an unfortunate value.

 

 delete.PNG

 

Regards,

 

Steven Zittrower

Applications Engineer

National Instruments

http://www.ni.com/support

Message Edited by StevieZ on 06-04-2009 05:49 PM
0 Kudos
Message 2 of 4
(4,372 Views)

No matter what I set the x-axis for, it changes when I plot the waveform. If I change the range after plotting, it only shows me a fragment of the graph, corresponding to that time range.

 

This is the problem I am getting, when using the following code:

 

AnalogWaveformPlotOptions options = new AnalogWaveformPlotOptions(AnalogWaveformPlotDisplayMode.Time, AnalogWaveformPlotScaleMode.Raw);

waveformGraph1.PlotWaveforms<double>(dataIn, options);

 

time.jpg

 

As you can see, it gives me time in CPU ticks. While precise, it is of little help in deciphering the graph easily. I just need to convert "ticks" to "milliseconds", but have not yet found a way to do that.

0 Kudos
Message 3 of 4
(4,350 Views)

It looks like the LabelFormat of the Xaxis of the WaveformGraph is set to a numeric rather than a DateTime format, which is what you want. Changing that should fix issue.

 

Regards,

 

Steven Zittrower

Applications Engineer

National Instruments

http://www.ni.com/support

0 Kudos
Message 4 of 4
(4,340 Views)