ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Boolean value turns to false after leaving while loop

Hi,

 

I have a labview program which checks the time and if the time is between 7 AM and 5 PM, it outputs a true value from an 'and' object. 

 

This then goes into an if loop TRUE which runs a subVI.

 

The subVI then runs for 7 hours and turns off.

 

How I currently have it working is that I click 'run continuously' on the 'master' VI.

 

However I would like to not have to do run continuously but rather have the time checker in a while loop.

 

The problem is, when I try to bring the boolean value out of the while loop, it suddenly turns from true to false?

 

Is there a way around this?

 

I have attached 3 VIs, the labview master file and its subVI 'labview automated file' which work fine with 'run continuously', plus my attempt at making the master file use a while loop.

Download All
0 Kudos
Message 1 of 3
(1,202 Views)

You said "LabVIEW automated file" is a subVI. Get whatever you don't want to run continuously out of the while loop. Based on what you are describing, a state machine would be a good option or maybe not. 

When you said "I try to bring the boolean value out of the while loop", what boolean are you referring to ?  what value are you trying to bring out?

0 Kudos
Message 2 of 3
(1,179 Views)

@lorc34 wrote:

I have attached 3 VIs, the labview master file and its subVI 'labview automated file' which work fine with 'run continuously', plus my attempt at making the master file use a while loop.


You only attached two files. "Run continuously" is a debugging tool, not  a way to do any regular run. Most of your subVI code seems very amateurish, with oversized diagrams and right-to-left wiring. Do you know who wrote it?

 

You talk about a Boolean that turns false. Where is it?

 

All you probably need is the subVi. Turn it into a simple state machine that checks the clock and does whatever needs to be done according to state (something, nothing, etc.).

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