LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I set a flag to stop a function once there is a triggered event?

I know this is VERY basic, yet it is giving me fits.  I have a toggle on the front panel of my vi.  The user sets it to 'ON'.  The vi runs until there is a triggering event.  When the triggered event is sensed, it passes a 'true' statement to a case structure that sends an email message.  At this point I want to turn the toggle 'OFF" so I don't get multiple emails telling me the same thing.  Again, I know this is basic, I know someone is going to say, 'Set a flag!' and yes, I have done that in programming code.  How do I do it in LabVIEW?

Ron

0 Kudos
Message 1 of 6
(2,965 Views)

local variable

 

Right-click on your control, create->local variable


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 2 of 6
(2,962 Views)

Excellent!  I knew I was missing something simple.  Much MUCH simpler than setting flags.  Thanks.  KUDOS!

0 Kudos
Message 3 of 6
(2,959 Views)

Store the boolean value in a shift register or feed back node. Then use some boolean logic.  IF the old value is false and the new value is true, then execute the true case of the case structure.

 

0 Kudos
Message 4 of 6
(2,953 Views)

RavensFan,

I like your example as well. I think crossrulz will work for me, but then again, I also have to worry about reseting it to on, don't I?  By the way, I haven't watched more than 3 games this year in Philly.  How the heck did you guys lose to them???!!!

0 Kudos
Message 5 of 6
(2,944 Views)

Essentially here, the flag is the value stored in the feedback node.  So if you want to make it on or off you can feed that value into the feedback node instead.

 

Philly.

 

Bad refs.  We had a winning touchdown taken away on a suspect offensive pass interference call.

0 Kudos
Message 6 of 6
(2,939 Views)