LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Save file path and error out variables from a switch structure, for use when case is false?

Solved!
Go to solution

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. 

Untitled.png

Untitled1.png

  

0 Kudos
Message 1 of 2
(1,997 Views)
Solution
Accepted by topic author crash_override

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.

Message 2 of 2
(1,981 Views)