01-03-2011 02:15 PM
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!!!!
01-03-2011 02:42 PM
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.
01-04-2011 08:45 AM
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!!
01-04-2011 10:55 AM - edited 01-04-2011 10:55 AM
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)
01-04-2011 12:38 PM
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??
01-04-2011 01:42 PM - edited 01-04-2011 01:48 PM
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.
01-05-2011 08:34 AM
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.....
01-05-2011 02:24 PM
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.
01-07-2011 02:58 PM