02-23-2015 11:02 PM
When the case is True, the output of case structure is a number, which is the result of a comparison.
When the case is False, the output is 0 (by default)..
But I don't need these 0s, actually I don't need the False case, I only need the output of True case. My question is How to only execute True case and avoid the output of False case?
02-23-2015 11:12 PM
02-23-2015 11:20 PM
Hi,
the condition of executing Truse case is also a result of comparison, so I might still need to use Case Structure.
When the comparison is True, I need some output.
When the comparison is False, I don't need any execution, but the output of case structure is still a consecutive 0s.
02-23-2015 11:26 PM
What do you mean you don't need any output? There always has to be something on the wire coming out of the case structure.
Are you using a newer version of LabVIEW? Is it a case that you don't want a value coming out of the For Loop at the auto-indexing tunnel? If so, then change the auto-indexing tunnel into a conditional tunnel.
PS: You don't need to add 1 or subtract 1 from a wire. There are functions in the Numeric palette called Increment and Decrement that add or subtract 1 in a single function without having to place the 1 constant.
02-23-2015 11:34 PM
Hi,
Yes I don't want any output of For Loop when the case is False. I tried to use contional tunnel mode as you said and got the result I want. Thanks`
02-23-2015 11:36 PM
Hi cantata2014,
Then in that you need to use "shift registers" and "build array" function where the all the inputs to case structure during false case are wired to shift register right side of the for loop and the output is added to array only during the true case .
Regards,
Srikrishna.J
02-23-2015 11:38 PM
@srikrishnaNF wrote:
Hi cantata2014,
Then in that you need to use "shift registers" and "build array" function where the all the inputs to case structure during false case are wired to shift register right side of the for loop and the output is added to array only during the true case .
Regards,
Srikrishna.J
You need to do that if you have an older version of LabVIEW before conditional tunnels were added. Newer versions with conditional tunnels make the code a whole lot simpler.