LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

event memory

Hello,

 

I have an Event structure, with 100+ event pages.

 

Some events take longer than 2-3 seconds (moving a servo)

 

When inbetween starting and finishing, the button is pressed again, this is buffered somewhere, and after the first time completing the event, the event is fired again.

This is unwanted behavour. I thought that "Lock front panel" would block this, but it's not.

 

I simply want the program to start listening to buttons after finalizing the event.

 

 

Please don't tell me to "disable and greyed out" the buttons, this will take me a week.

 

See the simplified program in attachment.

Run it, then quickly press 5 times "+1"

I want the result to be "1" instead of "5"

 

.

 

0 Kudos
Message 1 of 2
(2,357 Views)

First , it is generally not good practice to include any code in an event case which can take longer to execute than the time it takes a user to click somewhere to generate another event.  I usually take the limit on the time to execute code in an event case to be no more than a few tens of milliseconds.  If it is longer than that, it goes into a parallel loop.  Parallel loops (as in the Producer/Consumer architecture) are a good way to handle this situation.

 

Read the LabVIEW help on events and locking the front panel.  It clearly indicates that the subsequent events are queued and will be processed after the event case completes.

 

You may need to look at filter events or use a state machine which is configured to ignore multiple events until the first task is complete.

 

You may also want to think about your "user experience."  In your example I would expect the code to work just as it does.  In other words when I hit the button 5 times, I expect the result to increase by 5, even if it takes some time.  What do your users expect?  Disabling and graying may be more work for you, but may match the users expectation better.

 

Lynn 

Message 2 of 2
(2,345 Views)