LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

read boolean input and write to text file

Solved!
Go to solution

Hello everyone, 

I am doing this just as a simple exercise. I read a boolean input (a rocker control) and write it to a text file every time it changes (read1.vi). It works prefectly fine.

But if I pull the control out of the loop - as I thought I should - it doesn't work (see read2.vi). 

Why? Thanks for your reply.

 

 
 

 

 

Download All
0 Kudos
Message 1 of 3
(1,892 Views)
Solution
Accepted by topic author DavideB

Hi DavideB,

 

Once data hits the data terminal of a while loop it will stay the same for all iterations of the loop. Just like your "File Dialog" only runs once, the value of "On/Off" is only read once. 

 

On the other hand, with every iteration of the while loop, everything inside of it is "run" again. The "stop" button is read, the "On/off" indicator is updated, etc.

Message 2 of 3
(1,872 Views)

got it! thanks

0 Kudos
Message 3 of 3
(1,863 Views)