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: 

cluster of two elements to signal

hi all! i have doubt.....i have two 1d array. one of them is the measurements i´m taking with my DAQ. the other one is an array i made, depending on the number of measurements (i construct angles from 0º to 360º).

The folowing step is to make a graph, so i can use this two arrays, using the second array as my "X" input, and the measurements in Y, (otherwise, the graph uses the number of measurements as X and the measurements in Y) so i use a convert to dynamic data in both arrays, and I use them as inputs in a built XY graph.

all i need to do then is two things:

 

to know the max measurement, the max index, the min measurement, the mix index, if it was an array i know how to do it, using the array max & min, but the result of the graph is no longer an array, is a cluster of two elements (two 1d array)

 

and second, convert this cluster into a signal, so i can use it as a report.

 

Is there any way to do this??

 

thanks!!!!

 

 

0 Kudos
Message 1 of 9
(5,956 Views)

It would help to attach a small VI so we can better see what you have. The description is not very clear.

 

Anyway, to get the data out of a cluster, you would just unbundle it.

0 Kudos
Message 2 of 9
(5,945 Views)

Here, I´m attaching the VI, I tried to unbundle it before, but the error message is "you have connected terminals of different types"

I´ve simulate a signal to make the VI easier....

I´m sure that I´m making it more difficult that it really is, but I just can´t see it...

Thanks altenbach!!

0 Kudos
Message 3 of 9
(5,917 Views)

Well, since your build xy graph express VI does not retain data between calls, you can just tap into the x and y arrays before it. Get the max of the y array, the use the max indices to get the corresponding x values.

 

(I probably would not use the xy graph express stuff, but here's a quick rewrite using mostly your code)

 

Download All
Message 4 of 9
(5,902 Views)

Thanks so much Altenbach!!! I see what you did, great idea!!!

I still have a problem though....in the report I still have the number of measurements instead of the angles in "X"...how can solve this problem? Is that what you meant with not using the xy graph express??

0 Kudos
Message 5 of 9
(5,895 Views)

When you are converting from dynamic data to an 1D array and back, you are stripping out all x information. Simply don't do that!

 

Here's how you would do it. See the difference in the code? 😄

 

 

Of course there are still many flaws in your code. For example the signal simulation does not belong inside the loop, it needs to be calculated only once.

0 Kudos
Message 6 of 9
(5,881 Views)

Yeah! I see the difference!! jaja! It was a quick example of someone who´s on his first steps!!

You´re right, I´m striping the X information, but, anyway, I´m not interested in the X information from the DAQ (number of measurements) that´s why I created an array, simulating the angles. I need, to create, somehow, a signal with my array of angles (X), and the signal from the DAQ (Y, in this case with the simulate signal) so I can take an XY graph to the report...I´ve tried with the bundle, some array functions, and others, with no success until now.....

0 Kudos
Message 7 of 9
(5,853 Views)

As any champion, I usually stay far away from dynamic data and express VIs, thus I am not very familiar with all this.

 

Your x-values are equally spaced in x, so it is just a matter of rewriting the waveform data x0 and dx. I don't really know how to do that ("set dynamic data attributes" would seem logical, but I don't get it :D).

 

Here's a clumsy way that seems to work... there must be a better way, though. 😮

Modify as needed.

 

 

Message 8 of 9
(5,836 Views)
0 Kudos
Message 9 of 9
(5,791 Views)