06-06-2013 05:55 AM
Hi guyz
I have a problem regarding reading and processing element of an array. I have a "Reference Base Generator" and for example I generate a sine wave. Then I use "Get waveform components" to get the data from the graphic, after this i have a 1-D array of data (right?) at the output of the "Get waveform component' bloc. I need to read every element, process it and then send it as a value further to a function input. So, how can i get every element of that array and send it further ?
I hope I was clear with my problem.
It would be great if you could provide me with some help.
Thanks alot,
Andrei_L.
Solved! Go to Solution.
06-06-2013 05:59 AM
Andrei,
what is it when you say "process every element"? Is it a computation which is the same for every value as adding an offset?
Is it a computation specific to waveforms, so different for each value depending on "previous results"? Or block computation like FFT?
Please provide more information, including an example on how you currently try to solve it.
thanks,
Norbert
06-06-2013 06:09 AM
The processing step doesen't matter that much (just wanted to divide each value from that string). I think i found a solution for reading the elements of the array by using auto-indexing with a while loop.
Andrei_L
06-06-2013 07:27 AM
String?
Where do you get a string?
You can, if the value you use for division is constant for all array elements, use the polymorphism of the arithmetic functions. Simply wire the array to the division function and wire a single (scalar) numeric element to the other input.
This is a little more performant (faster) than your FOR loop.
Norbert
06-06-2013 07:36 AM
While loop is not suitable, its For loop meant for 'Auto Indexing'...!!
06-06-2013 08:12 AM - edited 06-06-2013 08:12 AM
And just for completeness sake: