ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Creating an XY graph from a while loop

Greetings,
 
I am having trouble bundling information from a while loop into a XY graph. I want to be able to vary the start time and end time of my graph, ultimately graphing amplitude vs time. Increments in 0.1 seconds.
 
Attached is a vi & Word document w/ a screen shot of my front and block diagram.
 
Thanks for your help.
 
 
 
I
Download All
0 Kudos
Message 1 of 11
(3,938 Views)
check this if it help you getting started
-----------------------------------------------------------------------------------------------------
... And here's where I keep assorted lengths of wires...
0 Kudos
Message 2 of 11
(3,925 Views)

Thank you, it works like a charm. Do you have any idea I how I could obtain the slope at two random points?

 

 

0 Kudos
Message 3 of 11
(3,913 Views)
Thanks again,
 
I have a few questions. Would bundle have worked my requirements? All of the examples (with For Loops) showed bundle and nothing with the While Loop. I spend alot of time last night and this morning wrestling w/ trying to bundle.
 
Newbie 2
0 Kudos
Message 4 of 11
(3,904 Views)

yes bundle would have worked for an xy graph:

you bundle the x array with the y array and send the cluster to the graph.

in this case the x array could have been for example the index of the loop.

there is no fundamental difference between a for loop or a while loop in this regard, and the shift register (keeps the data between iterations of the loop) works the same way.

 

-----------------------------------------------------------------------------------------------------
... And here's where I keep assorted lengths of wires...
0 Kudos
Message 5 of 11
(3,895 Views)

 Do you have any idea I how I could obtain the slope at two random points?

Hum that is a little involved, as you have to define what are going to be your points.
the slope itsdelf very easy as soon as you have defined them: you can use directly the fit function in the mathematics panel, or calculate it yourself.
 
for picking up the points from the graph, there is no easy way that i know of, and this will require a small program of its own.
-----------------------------------------------------------------------------------------------------
... And here's where I keep assorted lengths of wires...
0 Kudos
Message 6 of 11
(3,893 Views)
in this thread you will find very interresting examples set by Altenbach for moving points on a graph (example 1), and maybe connecting them to original data points (example 2) 
-----------------------------------------------------------------------------------------------------
... And here's where I keep assorted lengths of wires...
0 Kudos
Message 7 of 11
(3,890 Views)

I am not sure how I would pick off the x-axis to give me the increments. Would I create a separate loop as you have shown? Also, any time I timed to specify a constant for the increment, the constant option wasn't available.

 

Thanks for your time and help.

0 Kudos
Message 8 of 11
(3,890 Views)
look at this vi.
the x array is created out of the index.
-----------------------------------------------------------------------------------------------------
... And here's where I keep assorted lengths of wires...
0 Kudos
Message 9 of 11
(3,866 Views)

Gabi1

 

Thank you again for your help! I've learn this morning from your help than I would typically learn in class for an evening.

 

Thank you

0 Kudos
Message 10 of 11
(3,850 Views)