LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to get a XY graph like a paper recorder, anyone can help?

Hi, i am a freshman in labview. but now i have trouble in achieving a DAQ project, which i want to get one XY plot for two signals, one for movement(distance), another for force, and then find the inflection, get the x1-x2, y1-y2,... now i have PCI6221, SCB-68A, and installed properly. i checked the examples on my books for months, but i cannot get the right way. anyone can give me some hints or example for block program, thanks a lot,...... the attached img is a manual paper recorder result, paper recorder result, horizontal for movement, vertical for force,paper recorder result, horizontal for movement, vertical for force,

0 Kudos
Message 1 of 11
(2,961 Views)

Usually when you have a (or two) signals and you talk about their "inflection", you usually mean a plot of Signal vs Time, where Time is usually the (uniform) sampling rate of the signal.  You are discussing an X-Y Plot that seems to be (but I'm not certain) the two signals plotted against each other.

 

That can be tricky.  Have you heard the term "Lissajous Figure"?  [I wonder if this has gone out of vogue with the disappearance of analog oscilloscopes ...].  Consider X as a sine wave at some frequency "f", and Y as the cosine wave at the same amplitude and frequency.  Plotting X vs Y gives you a circle that just goes round and round (well, it actually gives you an N-gon if you sample the Cycle N times/cycle, which approximates a circle as N gets larger, but that's a different issue).

 

So are you plotting X vs Y, or are you talking about two plots of X vs t and Y vs t?  If the former, consider the circle and what you would want to do with it ...

 

Bob Schor

0 Kudos
Message 2 of 11
(2,938 Views)

@Mybr wrote:

Hi, i am a freshman in labview. but now i have trouble in achieving a DAQ project, which i want to get one XY plot for two signals, one for movement(distance), another for force, and then find the inflection, get the x1-x2, y1-y2,...  


So you have a set of xy data pairs and there are seemingly two problems:

  • Display it: I assume you are able to graph it on an xy graph. Are you? Why would you show it on a paper graph? How dense is your data? Just a few points or thousands of points?
  • Analyze it:: From a first glance, the curve seems to be composed on nearly linear sections, each described by an offset and slope, and each section well delineated by kinks, i.e. rapid changes in slope. If you would graph the first derivative, these would be dominant steps (and spikes in the second derivative). The slope of the leftmost segments is nearly infinite, so make sure to protect the algorithm from that.

 

What are you most interested (It is not clear what x1-x2, y1-y2 means here!) Do you want to find all the kink locations? All the slopes?

 

Are the data values sorted in x or y or all over the place?

 

Easiest would be if you could attach a simple VI that contains some typical data, then tell us exactly what kind of information you are trying to extract from it. What is the experiment?

0 Kudos
Message 3 of 11
(2,928 Views)

first thanks for you kindly and quick response, i take my holiday last week so i reply you till today.

actually the curve is simple, just formed by thousands of (x1, y1),(x2, y2),...(xn, yn,), in my case, the horizontal axis x means movement or distance, the vertical axis y means force (you can regard it as a spring force, in fact this case just measure the feature of a mechanical relay terminal spring and movement), each y (force) value corresponding to an x value. you ask how dense the data, now we use a screw micrometer to feed the force sensor manually , so i plan to acquire data continuously, i need maybe 2000 points or more for the whole travel---2 mm or less, should i determine how often acquire a pair of data or how long of movement to acquire? , so the data would be (x1, y1) by t1, (x2, y2) by t2, ...(xn, yn) by tn, OR, (x1, y1), (x1+delta, y2), (x1+delta*2, y3), ...(x1+delta*(n-1), yn), hope you can understand! this is the first step, and second , analyze it, find the inflection point, on the whole graph, normally we have 6 such point, so make a simple subtraction of adjacent point, to find out the feature for every travel. 

i check many DAQ examples, but i cannot work out a proper VI for this, any help would be appreciated, 

0 Kudos
Message 4 of 11
(2,875 Views)

thanks for you kind response. in fact the curve i need just form by thousand of (x1,y1), (x2,y2),...(xn,yn), and the inflection point here means the intersection(or peak) of different slope. 

0 Kudos
Message 5 of 11
(2,873 Views)

@Mybr wrote:

first thanks for you kindly and quick response, i take my holiday last week so i reply you till today.

actually the curve is simple, just formed by thousands of (x1, y1),(x2, y2),...(xn, yn,), in my case, the horizontal axis x means movement or distance, the vertical axis y means force (you can regard it as a spring force, in fact this case just measure the feature of a mechanical relay terminal spring and movement), each y (force) value corresponding to an x value. you ask how dense the data, now we use a screw micrometer to feed the force sensor manually , so i plan to acquire data continuously, i need maybe 2000 points or more for the whole travel---2 mm or less, should i determine how often acquire a pair of data or how long of movement to acquire? , so the data would be (x1, y1) by t1, (x2, y2) by t2, ...(xn, yn) by tn, OR, (x1, y1), (x1+delta, y2), (x1+delta*2, y3), ...(x1+delta*(n-1), yn), hope you can understand! this is the first step, and second , analyze it, find the inflection point, on the whole graph, normally we have 6 such point, so make a simple subtraction of adjacent point, to find out the feature for every travel. 

i check many DAQ examples, but i cannot work out a proper VI for this, any help would be appreciated, 


Not sure if this is what you're looking for; however, this is how I create a graph of two data sets (real and imaginary amplitudes vs. frequency in this case) to see data live as we are recording. Hope this helps as a starting point!

 

This is what it looks like on the front panel:

XY-Graph.PNG

0 Kudos
Message 6 of 11
(2,859 Views)

Start by looking up examples in the Example finder (Help -> Find examples) and learn how to acquire the two signals you want versus time. The examples are usually configured that way.

 

Next, look at the XY Plot. I think there are examples for how to use that as well. You can plot as XY pairs; just combine your two time-sampled arrays, and use the XY plot to plot your force versus distance.

0 Kudos
Message 7 of 11
(2,843 Views)

I would also advise you that if you are dealing with data points from an acquisition process, where the time interval between the points is a constant, you consider a Chart instead of a Graph.  Charts "scroll", typically holding the last 1024 data points and allowing you to plot the most recent 100, 200, 500, 1000 (whatever makes sense for your situation, remembering the finite width of your display's pixels and the speed that both the display and your eye work -- something zipping by right-to-left at one screen/second is going to be very difficult to "see" and understand, whereas a plot that updates at 20-50 points/second will scroll rather nicely.  Instead of X explicitly being a "time" channel, you don't plot X at all, but set its properties (depending on your sampling and display rates) to have the units of Time by adjusting the number of points plotted (X Max, X Min) and the "Multiplier" (go ahead and plot something that you understand, then vary the X Scale properties of the Chart and see how it affects the Plot -- an Experiment is worth 1000 Characters of Explanation).

 

Bob Schor

0 Kudos
Message 8 of 11
(2,827 Views)

thanks for you example, but it is not compatible, my Labview is 15.0f2, cannot open this file. i will show you the vi and front panel i work out from a "continuous input" example, but it does not work, cannot run, i just copy and add another one channel to the example, em... front panel.PNG

0 Kudos
Message 9 of 11
(2,821 Views)

for the example you provide, could you modify it so that it can be open using LV2015, so many thanks, ...

0 Kudos
Message 10 of 11
(2,820 Views)