LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

disable property node problem

Solved!
Go to solution

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 Smiley Frustrated

Is there any suggestions?

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

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

 

 

0 Kudos
Message 2 of 6
(3,141 Views)
Message 3 of 6
(3,122 Views)

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.)

 

 

0 Kudos
Message 4 of 6
(3,117 Views)
Thank you guys for the posts!
Altenbach,the thread helped me a little but I think that the problem is the values of the time I have set,so it s not workin the way I want.
This is what I want to do..
I have two buttons (1,2).Pressing 1 in,it does a write to an instrument (let s say "preview").Pressing it out,does "stop".Pressing 2 in,does "start",pressing it out,does "stop".Obviously,when 1 is in and we press 2,
1 must to set to false.The same, must happen in case of the opposite situation,so there is no way both buttons will be pressed in at the same time.Also,no matter what button pressed or not,I need to graph my results that change every couple of seconds.The VI I posted,is fast made so I can find where is the problem.Leds stands for each state and the sum,for making my graph.
Souldn't I use "event structure"?I mean,there is any better way?
I m sorry for the sluppy VI I posted.I ll post the actual one tommorow so if you could tell me anything to notice.I m new in Labview and any advice or help is appreciated and welcomed so I can change the way I approach building a VI.Thank you so much!
0 Kudos
Message 5 of 6
(3,062 Views)
Solution
Accepted by johnny1985

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.

Message 6 of 6
(3,039 Views)