12-08-2013 07:18 AM
Hello everyone!
I want to make a VI that the user won't fool around with the button.
So I put in my event case "value change",a disable property node for 1sec (disable) and out of it,an enable.
The problem is that if I press the button like 3 times in 1second,the button still will change value 3 times,like it has memory.
I just want the user to be able to make changes to the value only after 1 sec and not save them.I hope I made my self understood
Is there any suggestions?
Solved! Go to Solution.
12-08-2013 08:15 AM - edited 12-08-2013 08:19 AM
At first it looks like you have a dataflow problem. You have nothing that insure that the control is disabled before the 1 sec wait. what if the wait happens before, you will then be able to click your control a couple of time before it is disabled and these value change events will be queued.
Ben64
12-08-2013 11:05 AM
12-08-2013 12:02 PM - edited 12-08-2013 12:23 PM
Looking at your code is a bit more details, ther are many things way too convoluted. For example none of your inner case stuctures seems to be needed (just retain the code from the TRUE case). It is not really clear what the four indicators should show depending on the button states. Why are there so many value property nodes?
In any case, you need to ensure that the events complete quickly and that the disabled state resets after a given timeout, for example.
Here's a very quick draft. There are many more improvements needed (Maybe the buttons should be latch action. The re-enabling should only happen if they are still disabled, etc.)
12-09-2013 12:01 PM
12-09-2013 02:35 PM
Maybe you should use a state machine with two loops. The UI loop enqueues the actionwith a timestamp, and the consumer loop can compare the timestamps to decide if enough time has passed or if the action should be discarded.