LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Making an array with elements with the correct running order of index

Hi all,
 
I have a question regarding making arrays.
 
I have customised my program to extract a reading of Sine function at a particular time, running in a For Loop.
 
At each interval, for e.g, at T = 1ms, I will obtain it's magnitude. After 30 readings @ different frequencies but at al same time, T =  1ms, I want to compile them into an array, however, I do not know how to go about doing that.
 
Would appreciate help. Thanks!
 
Howk
 
 
edit:
 
To add on, I placed an indicator at the output of the sine function, it shows correct respective amplitudes at T = 1ms,with respect to different frequencies.
 
I tried initializing array, but i could not index the elements in the same order I got them. Initializing only allows me to decide on the dimension of the array. 
 
Pls help.  

Message Edited by How81 on 07-17-2007 08:41 PM

0 Kudos
Message 1 of 6
(3,045 Views)
Does each iteration of the FOR loop generate one value that you want to save? If so all you have to do is run a wire out through the wall of the FOR loop and LV will turn it into an array where the output of the first iteration is element 0, the second iteration is element 1 and so on.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 6
(3,036 Views)
Hi Mike,
 
Appreciate your reply, maybe I made an error somewhere in the block diagram?
 
Let me clarify what I am doing abit more.
 
I have a pre-determined Array X, of 25 values as amplitudes to Sine function, first index from Array X will undergo the Sine Function, and I will want the reading (element) at T = 0, second index from Array X, I will want it at T= 1 so on and so forth.
 
Each iteration, I am only interested in a particular element. I would like to retain all these elements subsequently and make them into an array .
 
 
My reason for doing so : After I get them as an array, I want to do a FFT to get my desired graph form.
 
Alternative idea: I could do FFT at each interval, and get the respective values of the FFT. But I will still need to compile them into an array to get the wave form, yes?
 
I'm not too sure about this actually, just picked up labview recently. Will appreciate all the help you can give. Thanks a lot!
 
Howk
 
 
0 Kudos
Message 3 of 6
(3,033 Views)
Actually you're very close. Inside the loop, instead of using the array subset use the array indexer. The output of this will be a single value. Move your array indicator outside the loop and wire directly from the output of the array indexer to the indicator. You will notice that as the wire goes through the wall of the FOR loop it changes from a skinny orange wire to a fat orange wire.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
Message 4 of 6
(3,030 Views)
Dear Mike,
 
I was wondering if these are your instructions. I swapped array subset to index array, but the thin orange line didn't change to thick one, as what, I presume would be an array.
 
Really appreciate you taking time to follow through these steps with me!
 
Here's what I did, but the error list tells me I have connected scalar to array type..hmm..and the default indicator was element. It didn't auto-array-ised it?
 
 
edit:
 
Oh !! Oh!! I think i know where my mistake lies...lemme check again!! haha...realised it after reading through your reply slowly again. Smiley Very Happy

Message Edited by How81 on 07-17-2007 10:24 PM

0 Kudos
Message 5 of 6
(3,027 Views)
Thanks mike!!
 
I think I got it!! Once again, your help proved invaluable! Smiley Happy
0 Kudos
Message 6 of 6
(3,024 Views)