LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Delaying an event after a trigger event

I have an event, a Subvi, that I would like to occur a specific time AFTER a boolean event which will not remain 'fixed'.  An exception occurs, a boolean is switched 'true' momentarily and my test rig shuts down.  About two minutes later I would like another loop or subvi to output a voltage to turn off an oil pump.
 
I've created a subvi that has a 'wait' function that standalone, seems to do what I want.  I'll include that at the end of the post.  However, if I use it in my main loop the 'wait' function causes my entire VI to wait two minutes;  If I use it outside the loop, as soon as the boolean condition changes back to false, the pump turns back on.  I somehow need this to work outside my main loop and also be able to 'latch' the condition so that it doesn't revert to the 'oil pump on' state when the boolean event returns to false.
 
Maybe a state machine?  I really suck at those things.  Any input?
___________________________________________________________________
Still confused after 8 years.
Download All
0 Kudos
Message 1 of 5
(3,104 Views)
0 Kudos
Message 2 of 5
(3,093 Views)

Try this.  Attached is a picture of an idea for how to execute the wait.

Put your commands to turn off the pump in a case structure.  When the boolean goes true, the case structure executes.  The first sequence of the frame will be a wait statement, once that completes the second frame for turning on or off the pump occurs.  This way there is no wait in the normal running condition of the loop.

I didn't quite understand your description about what you want to happen in what order.  When do you want the pump turned on (beginning of the program or when the fault occurs)?  You want it to turn off 2 minutes after the fault.  When do you want the pump to turn back on again?  Your example program was so simplified, it really didn't show any thing about the on or off sequences.  You just had one true going to a sub VI.

Plus I don't think you really want to be creating a task in a sub VI happening over and over and over again.  Create the task the once at the beginning of the programming.  Write your true or false voltage in the loop.  Clear the task when the program ends.

You think you are "really, really confused."

Message Edited by Ravens Fan on 08-23-2007 09:04 PM

Message 3 of 5
(3,091 Views)

Once the pumps turn off, I don't want them to turn back on again at all until the VI is shut off and restarted or a user action takes place.  This is a progressive shutdown of a fairly critical piece of equipment;  When the exception occurs, the motor to the assembly turns off.  Two minutes later, it has spooled down to a stop, and I can then shut the oiling system down.  At that point the test is complete and I can start over.

And my signature has been 'I'm really, really confused' since I started here and had no clue at all.  Now I have a little bit of the clue, haha.

___________________________________________________________________
Still confused after 8 years.
0 Kudos
Message 4 of 5
(3,070 Views)
Ravens Fan, thanks for that.  I actually took your example and applied it to my entire shutdown sequence and even a couple of fan circuits that previously were turning on and off like mad at one specific temperature.  Now I delayed that circuit so the fans have a 5 degree window to operate.
 
Every new thing I learn about this stuff shows me there's a million more to go. 
 
Thanks again
___________________________________________________________________
Still confused after 8 years.
0 Kudos
Message 5 of 5
(3,044 Views)