01-30-2020 12:24 PM
I have to create a file and initialize my instrument on the first iteration of my loop but I can't figure out how to pass the Error out reference and file path after the first iteration when the switch case becomes false. Only two errors from not being able to route those two through the switch structure on the false case. As well as the VI, I linked pictures with the problem area having an orange square around it so hopefully downloading the vi isn't necessary.
Solved! Go to Solution.
01-30-2020 12:54 PM - edited 01-30-2020 12:56 PM
Hi Crash,
Those are referred to as "case structures" in LabVIEW. The best way to maintain data between iterations is to either use a shift register, which goes on the while loop border, or a feedback node, which goes inside the loop.
By the way, you can wire a numeric type directly into the case structure, so you don't even need the [=0] function. You could still make two cases, "0" and "default". However, the way I would do it is to run any "initialization" code before the while loop, then you don't need to bother with the case structure.