Mega Search
23.2 Million


Sign Up

Make a donation  
store data in alternating sequence  
News Group: comp.lang.labview

hello , 
 
i want to store data in a alternating sequence .  i generate data , random data ...lets say , a total of  30 digitis . now instead of just storing them in a array , what i would like to do is .. store the first element in the first array , the second element in the second array , the third
element in the first array , the fourth in the second array , the fifth in the first array and the sixth in the second array and so on ..
more like the odd numbered elements should get stored in the first array and the even numbered elements  in the  second array . 
hope someone can give me some idea on how to get this done ....
 
Motorhead ...

Vote for best question.
Score: 0  # Vote:  0
Date Posted: 23-May-2008, at 12:10 AM EST
From: motorhead
 
Re: store data in alternating sequence  
News Group: comp.lang.labview
see picture...


Example_VI_BD6.png:
http://forums.ni.com/attachments/ni/170/325891/1/Example_VI_BD6.png

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 23-May-2008, at 12:40 AM EST
From: Pnt
 
Re: store data in alternating sequence  
News Group: comp.lang.labview
Once you have all elements in one array, use "decimate 1D array" (from the array palette, resized to two outputs) for the desired outcome.
 
See image:
 
 (by LabVIEW definition, the first element is index#0 (even) and the 30. element is index #29 (odd). Tweak as needed).Message Edited by altenbach on 05-22-2008  10:39 PM


decimate.png:
http://forums.ni.com/attachments/ni/170/325893/1/decimate.png

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 23-May-2008, at 12:40 AM EST
From: altenbach
 
Re: store data in alternating sequence  
News Group: comp.lang.labview
:smileyvery-happy: I had never noticed it.

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 23-May-2008, at 1:40 AM EST
From: Pnt
 
Re: store data in alternating sequence  
News Group: comp.lang.labview
Hi , 
  I sure did what you recommended , but i am not able to understand what the first four elements in both the end  arrays represent . 
Could you please explain ? . 
Motorhead (feel like a dickhead now) ....


test38.vi:
http://forums.ni.com/attachments/ni/170/325906/1/test38.vi

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 23-May-2008, at 2:40 AM EST
From: motorhead
 
Re: store data in alternating sequence  
News Group: comp.lang.labview
You need to initialize the shift register with an empty array, currently it contains four elements. (set the index to 0 to see them all).
 
Simply right-click the array...data operation...empty array.
 
 
This code will probably not do what you want, because it will place all elements with an odd value in one array and all even values in the other array.
 
If I read your original question correctly, you want the values with odd array indices (not values!) in one array and the elements with even indices in the other.
 
Why don't you try the decimate suggestion?
 
(Also, remember that the number of visible elements has no relation to the array size). ;)

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 23-May-2008, at 3:40 AM EST
From: altenbach
 
Re: store data in alternating sequence  
News Group: comp.lang.labview
will do so ... thank you 
 
 

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 23-May-2008, at 8:10 AM EST
From: motorhead