LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

action delay of boolean button up to a new program run

hello 

 

in attachement  VI below
the problem is the action delay  4 Boolean button (EA50, SA, Sa, Ea) up to a new program run

I used Queue  for transferring data between the 2 while loop

 

 

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

What do you mean by "action delay"?

 

Does it have anything to do with the 60 second wait you have in your producer loop?

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

@bilalus wrote:

hello 

 

in attachement  VI below
the problem is the action delay  4 Boolean button (EA50, SA, Sa, Ea) up to a new program run

I used Queue  for transferring data between the 2 while loop

 

 


What do you mean by Action delay? Your 2nd loop iteration depends on the 1st loop and your 1st loop iterates every 1 minute. Your button executes only every 60 seconds. Please clarify for more clear information.

-----

The best solution is the one you find it by yourself
0 Kudos
Message 3 of 6
(2,393 Views)

1. You don't need the wait in your consumer loop.  It will run when you get data from the producer.

2. How are you stopping the VI?  From what I can see, you are using the ABORT button in the toolbar.  You should not be doing that.  You need a clean way to allow your VI to stop on its own.  I would recommend adding a stop button to go in the producer loop to stop it.  Then send an empty array through the queue.  In the consumer, do a check for an empty array.  Stop that loop when you see an empty array.

3. Are you really just gathering data at once a minute?  That is a bloody eternity!


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
0 Kudos
Message 4 of 6
(2,369 Views)

hello

 

Why is the execution of the 4 buttons depends on the acquisition loop every 60 seconds?

me I want an instantaneous execution of buttons, without delay, without dependence of the acquisition loop

 

action delay=the delay for execution of the 4 buttons, that's what I mean,I am sorry

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

It actually depends on the timeout you specify in the Dequeue function. Since your 1st loop executes every 60 seconds your queue doesn't have anything to be read. When you see the dequeue functions its default timeout is -1 which means it will wait indefenetly until an element is available in the queue. To overcome this situation you can wire a timeout of 1000 ms so that your 2 nd loop executes every 1 second. 

 

But I don't really understand what you are trying to achieve in the 1st loop waiting for 1 minute and doing nothing.

-----

The best solution is the one you find it by yourself
0 Kudos
Message 6 of 6
(2,337 Views)