LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Boolean indicator operation?

Dear all,

 

I have one question to ask. I have written a small example to illustrate my point. I have one indicator that is triggered by a condition. This condition can happen anytime.

 

Once it happens, it will enter a case and display a message. Inside this case, it will be delay by about 20 sec delay. The problem is if the condition occurs within the interval of 20 sec delay, the message will only be diaplayed only once. 

 

 

 I am wondering is there a way to display the message  a few times if the indicator is "on" a few times during the 20 sec delay? Example, if the condition occurs 5 times, the message should display 5 times only. It is more like queueing.

 

Thanks and hope someone can help out!

0 Kudos
Message 1 of 6
(3,596 Views)

Why are you using a local variable?

 

Why do you have a 10 second delay in there if you have a popup dialog delaying your code?

 

As you said "It is more like queueing".  So set up two loops, one that captures the events of the button press, then uses a queue to pass that information off to another loop that handles whatever popup dialog and/or delay that you are trying to do.

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

Dear Raven,

 

By right, it should be only an indicator, just ignore the local variable.

 

The operation is whenever an indicator lights up, it will go inside the case. I am using message box just as an illustration, in actual fact it is doing some sending of data and the delay is fixed at 10 secs.

 

 May i know how do i implement this? Is queueing the only way out? I only know a bit of event sequence but not know how to queue the data? 

 Can you lend me a helping hand on this? Thanks so much!

 

 

0 Kudos
Message 3 of 6
(3,563 Views)

newbieboy wrote:

Dear Raven,

 

By right, it should be only an indicator, just ignore the local variable.

 

You can't ignore the Local Variable, as it is not needed and causes erratic behavior in your code.

 

Let's go through some iterations:  (LI = loop iteration number based on "i")

 

Run the code.  

LI0:  Local =Last value in memory (could be True or False) If True, code executes True Case, the popup appears.

LI1:  Reads the value of test.  If False, passes the value to the Local.  Local = False, code goes to False Case.

note that there is no delay in the loop iteself, so it is spinning very fast...

LI2588: Click on test.  Local= True, code executes True Case, the popup appears.  Click ok on popup, it dissappears. It waits 10 seconds.

LI2589: Race Condition:  Which one will execute first?  Let's vote for Local.  Local still True.  Code executes True Case, popup appears. It waits 10 seconds.  It reads the test button. Local = False.

 

do I need to go further?

 

0 Kudos
Message 4 of 6
(3,530 Views)
As a matter of fact, there is no need for the indicator unless you want to see if the button was pressed or not.  In either case, you should wire the boolean control directly to the Case Statement.
0 Kudos
Message 5 of 6
(3,524 Views)
Look in the example finder for queues.  Or search the forums and you'll find countless examples.
0 Kudos
Message 6 of 6
(3,507 Views)