LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Boolean Switch Trouble Any suggestions?

I am building a program for a final project.  In my attachment, you will see I have six number generators that are simulating random numbers for a 5 second interval and then taking the mean of those numbers and senting them to a spreadsheet. 

 

My problem is:  On my random command, while the program is running,  I want to push my boolean switch, and have it run for 5 seconds and collect that data.  But after the 5 seconds are up, I want the boolean switch to be off and not collecting the data.  As of right now, if I want it to shut off after 5 seconds, I have to click the button and then click it again in that 5 second interval to make sure it shuts off after 5 seconds.    BUT, when I want to start this collecting again, and turn the boolean on, it will collect one point and send it to a spreadsheet and then collect the 5 seconds worth. 

 

Is there any way of usind the button, so that it attomatically shuts off after 5 seconds and will not collect that initial random numbers into the spreadsheet after I turn it back on?

Any help would be greatly appreciated.

 

Thanks.

0 Kudos
Message 1 of 2
(2,299 Views)

You have dataflow problem with your 2nd while loop in.  That while loop either runs once.  That is because the boolean button is only read outside the loop.  If it is true, that value gets passed through the tunnel (actually the selector of the case structure) and into the tunnel of the while loop to the stop terminal.  The loop will run once and stop.  If the boolean is false, then the false case of the case structure executes.

 

0 Kudos
Message 2 of 2
(2,285 Views)