LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Need help on plotting graph

I will use waveform graph/chart to plot the change of data with time.
 
I don't want to use the default x-axis of the graph. What I want to use for x-axis is the time passed, starting with zero.
 
My code structure is:
 
In a loop structure, I read one force from DAQmx read (I extracted the DBL data from waveform data), also I got a current time value (the passed time w.r.t. zero  time).
 
So, in every execution of loop structure, I got a DBL force data and a DBL time. Then I want to plot them to a force-time graph.
 
My question is: how can I make x-axis to be the time passed with zero as origin?
 
Thanks. 
0 Kudos
Message 1 of 10
(3,828 Views)
I think you should try using an XY Graph instead of a Waveform Chart or Waveform Graph...
0 Kudos
Message 2 of 10
(3,816 Views)
You can just wire the waveform data directly to the graph. There is no need to extract the the Y array or the current time. To display time on the x-axis, right click and choose X Scale>Formatting or select properties and select the Format and Precision tab. Choose Absolute time and pick the time format you want.
0 Kudos
Message 3 of 10
(3,809 Views)

If you wanted to build your own time scale, you could do something like this... (attached)

 

0 Kudos
Message 4 of 10
(3,805 Views)

Great, I think I should use XY plot.

Another question. I don't want to let the x-axis changes with adding plotting point. To make the x-axis fixed, with zero as starting point and the largest possible time as ending point, I shall use property node of graph, right?  So that I can use a control to set the maximum x value.

Thank you for your patience to a newbie's question.Smiley Happy

Derek

0 Kudos
Message 5 of 10
(3,793 Views)
Hmm, the example I wrote earlier does that. The start time on the graph is 0, and the end time is whatever the last time is. Did I not get your question?
0 Kudos
Message 6 of 10
(3,791 Views)
Yes, the code you give me can show the last time, but during the plot the x-axis changes continuously.
 
I just want set the whole range of x-axis fixed at the begining, and the the plot will grows without scaling.

Message Edited by Dejun on 01-23-2006 02:01 PM

0 Kudos
Message 7 of 10
(3,788 Views)
I see. You can right-click on the graph to remove auto-scale. To fix the min/max, either from the graph properties under 'scales', or as you said, using property nodes if you need to.
0 Kudos
Message 8 of 10
(3,782 Views)
Thank you so much, Sima.
0 Kudos
Message 9 of 10
(3,780 Views)
No problem
0 Kudos
Message 10 of 10
(3,774 Views)