04-10-2015 11:07 AM
I acquire two signals from the same daq. And I want to plot one signal against the other.
so I extracted the sample value from every waveform sample. And then bundled it with the other waveform's sample value. Then I used the XY Graph to plot the two values but instead of giving a proper continuous single it gives me a spider web.
In the VI attached I used Ex XY Graph and it gave me the same plot using the inputs from channel 1 and channel 2.
Anyway I viewed one sample of my data and I got the image attached as my output. How can one time instant have so many values ? shouldn't it just be a single point on cartesian plane? Am I missing a link?
04-10-2015 12:15 PM
How can one time instant have so many values ?
Not sure why you think it's only "one time instant" ...
You read the file, and use the output, which is an array of waveforms.
You split out waveform #0 as the X, and waverform #1 as the Y-axis.
But each waveform might have many, many samples in it.
So it's plotting what you give it.
If you want to plot only one point, then don't feed the graph an array of points.
Blog for (mostly LabVIEW) programmers: Tips And Tricks
04-10-2015 12:21 PM
04-10-2015 12:26 PM
As to the Spider Web appearance, I'm assuming that your X and Y channels are independent of each other. The appearance of the plots is basically showing you the lack of correlation between the two channels. Here's a simple way to visualize this -- assume you are measuring two things that don't evolve with time, and assume your measurement has "noise". Let's further simplify this and say that the values of X and Y are uniformly distributed between 0 and 1. If you let an X, Y sample be a point, then each point will appear somewhere at random inside a unit square. Now connect these random points with lines and you have a tangled mess. Is this what you are seeing?
Bob Schor
04-10-2015 01:22 PM
04-10-2015 01:23 PM
04-10-2015 01:35 PM
I'm not sure what you mean by "reading one sample". Look at the VI and look at the wire carrying your "one sample" -- is it a thin orange or blue wire (suggesting a single Float or Integer), a thicker wire (a 1D array), or a pair of wires (a 2D array)? [Or is it patterned, perhaps the dread Dynamic Data wire?]. If it isn't thin, then it (may) contain multiple values -- wire it to Array Size and see how many points you really have.
BS
04-10-2015 03:25 PM
But I'm reading only one sample.
Try putting a probe on the "Y" output of thoseWAVEFORM COMPONENTS (or whatever they're called - I forget) functions.
That is an ARRAY.
Check with your probe and see how many elements there are. I'll wager there are more than one.
Blog for (mostly LabVIEW) programmers: Tips And Tricks
04-10-2015 03:53 PM - edited 04-10-2015 04:15 PM
... and now get rid of that silly "AND TRUE" and "EQUAL TRUE". What was your thought process to wire it up like that?
Pure Rube Goldberg! (See also here for more details)
04-10-2015 11:31 PM
I found out what my problem was.
My values are like this:
X Y
I was expecting them to be in this order:
X Y
Hence the spider web.
Now I guess I will have to arrange my X array in ascending or descending order?