09-01-2017 09:30 AM
I have an array that is populated during the true section of a case structure. That part works fine. The issue I'm having is when the case is false, I do not want to add to the array at all, but since the array is moved outside of the case structure there is a tunnel. I'm not sure what do add to the false case, so the array does not get populated.
Solved! Go to Solution.
09-01-2017 09:40 AM
If you attached your VI (or at least the part with the Case Statement), we could quickly/easily answer it. The "best answer" depends both on what you are doing and on which LabVIEW Version you are using -- we can tell both by looking at your VI (but it has to be an actual .VI file, not an image of part of the Block Diagram).
If you tunnel in from the left and tunnel out to the right, simply wire from Input to Output in the False case and Do Nothing. If you are generating values inside the loop and only want to generate in the True Case, you put the Case statement around the Build Array and follow the previous suggestion. Or, if you have a fairly recent (I think since 2013 or maybe a year or two earlier) version of LabVIEW, you can select the Indexing Output tunnel and make it a Conditional tunnel -- wire your True/False to the "?" terminal and the value will be Appended to the Array only when the Conditional is True. Much simpler/neater than using Build Array.
Bob Schor
09-01-2017 09:40 AM
Just use shift registers for your array. Wire straight through in your FALSE case and the array wraps around to the beginning of the loop unaltered. I believe you said you already conquered the TRUE case?
09-01-2017 09:42 AM
@Bob_Schor wrote:
If you attached your VI (or at least the part with the Case Statement), we could quickly/easily answer it. The "best answer" depends both on what you are doing and on which LabVIEW Version you are using -- we can tell both by looking at your VI (but it has to be an actual .VI file, not an image of part of the Block Diagram).
If you tunnel in from the left and tunnel out to the right, simply wire from Input to Output in the False case and Do Nothing. If you are generating values inside the loop and only want to generate in the True Case, you put the Case statement around the Build Array and follow the previous suggestion. Or, if you have a fairly recent (I think since 2013 or maybe a year or two earlier) version of LabVIEW, you can select the Indexing Output tunnel and make it a Conditional tunnel -- wire your True/False to the "?" terminal and the value will be Appended to the Array only when the Conditional is True. Much simpler/neater than using Build Array.
Bob Schor
Good post. I just strictly limited myself to the given scope of the issue. 😉
09-01-2017 10:09 AM
Or, if you have a fairly recent (I think since 2013 or maybe a year or two earlier) version of LabVIEW, you can select the Indexing Output tunnel and make it a Conditional tunnel -- wire your True/False to the "?" terminal and the value will be Appended to the Array only when the Conditional is True. Much simpler/neater than using Build Array.
That is exactly what I needed thank you!
09-01-2017 10:13 AM - edited 09-01-2017 10:14 AM
NoNoNo... if anything mark Bob's solution as the real one. (I don't even think my comment deserves a solution checkmark, even though you can have multiple posts marked as such.)
09-01-2017 10:25 AM
Haha that was my bad. I meant to accept his, but didn't look that closely and saw the quoted text and thought it was his post.