LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a way to 'latch' a boolean condition when using local variables? Help!

Hello all
 
I've made LOTS of progress on my vi over the weekend and even today.  I've been battling with a project with this scope:
 
1.  Read temperatures from 24 locations (6 banks of four thermocouples).
2.  Set individual channel temperature upper limits
3.  Output temperatures, elapsed time and time stamp to file in 5 minute increments AND write data when an overtemperature condition occurs.
4.  Use NI-switch to shut off a motor related to each of the 6 banks of thermocouples independently
5.  Be able to start/stop elapsed timers on each of the 6 banks based on user input (start/pause) OR conditions (pause at overtemperature)
6.  Be able to reset those elapsed timers with user input as well.
 
I've gotten 1-4 working nicely (although my example included has the DAQ assistant replaced with random number generation) and the NI-switch cases replaced with a simple boolean indicator.
 
My problems lie in two areas now.  First, I need the switch condition AND the 'pause time' to be 'latched' when an overtemperature is reached and NOT continue operation until user input.  Basically, when the motor relay is triggered to shut the motor off, I need the timer to stop with it and not restart when the input condition changes (in this case, when the thermocouple drops below the control temperature) until an operator tells it to resume.  I also need the switch condition to stay true so that my 1160 isn't switching back and forth every iteration until the temperature drops.
 
You'll notice there's 5 'elapsed time' express VI's in conditional loops on there--and one time structure in a parallel while loop.  The outside structure is the way I'm heading as it retains the value in the elapsed timer when paused.  This is critical to the test!  All 5 of those elapsed time express VI's will be leaving in favor of more of those outside loop structures.  My issue with the outside timing loop structure is that I can't figure out how to 'reset to zero' with a user input like you can with the express VI's, and that it outputs only ms data rather than a HH:MM:SS format (not a complete deal breaker but would be nice).
 
Please, anyone in the know, I need to button this up so I can get it implemented soon.  My old VI which is currently running the tests is far too user-unfriendly for most of the users to handle and the output to file is a wreck...  THANKS so much in advance.
 
Ralph
___________________________________________________________________
Still confused after 8 years.
0 Kudos
Message 1 of 4
(2,967 Views)
Ralph,

In your "outside structure" use an enum control to the case selector instead of a boolean. It would have cases for initialization, enabled (run), pause, resume, stop, and reset. Depending on your needs some of these cases might not be used. You can use the Get Date/Time in Seconds in place of the Tick count to get the time of day formatting.

Lynn
0 Kudos
Message 2 of 4
(2,959 Views)
Thanks...  Lots of new words there but I'll start my process looking for them.  Thanks!
___________________________________________________________________
Still confused after 8 years.
0 Kudos
Message 3 of 4
(2,947 Views)
I've looked up the enum constant and am completely baffled as to how to use this to do what I'm trying.  Can you shed a bit more light on the subject?
___________________________________________________________________
Still confused after 8 years.
0 Kudos
Message 4 of 4
(2,930 Views)