06-18-2006 09:19 PM
06-18-2006 09:39 PM
Hi Ann,
You can accomplish this with a Case Structure and 4 shift registers. Make cases for iterations 0, 1, 2, and 3. Add a shift register to the For Loop for each iteration as well, and initialize each shift register with an empty array. In the case for iteration 0, use a Build Array to add whatever you want to the array in the first shift register, while just passing through the wires for the other three shift registers. Then in the case for iteration 1, add whatever you want to that shift register, while wiring through the shift registers for 0, 2, and 3. Repeat this for all cases.
Try it out, let me know if you need any additional advice.
-D
06-18-2006 10:48 PM
Hi Daren,
But what if the loop iteration is very big like 50 iterations ? In this case, isn't it very troublesome to add 50 shift register ? Is there any other methods that you can suggest ? Thank you
06-18-2006 10:54 PM
Hi Darren,
But what if the loop iteration is very big like 50 iterations ? In this case, isn't it very troublesome to add 50 shift register ? Is there any other methods that you can suggest ? Also, what if the number of the iterations is to be determined by the user ? Thank you for your advice
06-19-2006 01:13 AM
Hi Ann,
Ok, the way your first post was worded, it sounded like your specific use case was a hard-coded iteration count of four. In the case of an arbitrary number of iterations, you would probably want to create a single shift register that contains an array of clusters of an array. You can't have an array of arrays in LabVIEW, so what I'm suggesting is the next best thing. Every iteration of the loop, you can use the Build Array function along with a Bundle function to add a cluster of an array to the shift register on every iteration of the loop. Let me know if you need any more assistance.
-D
06-19-2006 02:14 AM
06-19-2006 09:41 AM
06-19-2006 10:36 AM - edited 06-19-2006 10:36 AM
Message Edited by Darren on 06-19-2006 10:36 AM
06-19-2006 11:27 AM
Hi Darren,
Thank you for your solution. One more question, when you initialized the left shift register, how did you get/create the 1D array of cluster of 2D array ? I am using Labview7.0 , is it some extra function from newer edition ?
06-19-2006 11:47 AM
Nope, nothing special. Just drop an array constant. Then drop a cluster constant inside it. Then drop an array constant inside the cluster, then drop a numeric constant inside the array. It's just that easy! 😛
-D
P.S. - Don't forget to right-click the numeric constant and change its representation from I32 to DBL.