02-24-2014 12:12 AM
Hi,
I am trying to put values into an array using for loop. My requirement is to insert the value into the output array only if i mod 2 is equal to zero. Otherwise, I do not want to pass anything to the array. The problem arises because I cannot leave the output tunnel unwired in the 'False' condition of the case structure. So I tried wiring a constant value of 0. Now my result array has zeros also. How can I modify this VI so that I get an array like 0 2 4 6 etc?
Thanks in advance
Solved! Go to Solution.
02-24-2014 12:25 AM - edited 02-24-2014 12:28 AM
Wouldn't it be easier to simply multiply [i] by two and run the loop for only half the current number of iterations?
(You have LabVIEW 2012, so there is also the condtional output tunnel that could do what you want.)
02-24-2014 12:34 AM
Hi,
That is a sample code I attached. Not the actual problem I am working on. I want to pass a value to the output array only if the case condition inside the for loop is true. Otherwise, I do not want anything to be passed to the array. Kindly help
02-24-2014
12:40 AM
- last edited on
01-10-2025
01:48 PM
by
Content Cleaner
@annakurian wrote:
Otherwise, I do not want anything to be passed to the array. Kindly help
I already mentioned conditional tunnels. See here for details. See how far you get. 😄
02-24-2014 12:42 AM
Thanks a lot for the reply. I tried using the conditional output terminal on the for loop and it seems to work 🙂