LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to make a Do-It button?

Would this work?

Set the default switch position to false.

Set the mechanical action to change to true when the button is pressed...(don't latch it.)

Put a "while" around an "event" which is driven by the Button ... Mouse Down event.

inside the event,..., do all your stuff and oh by the way set the button back to false (either a create property or local variable off the button changed to write (or read...I forget which needs the gozinta on the left...) would do that). 

Be sure to put a TF...F constant inside the event and wire it to the stop on the while.

Action:

Button is pressed (going from false to true)...the mouse down event for the button fires which does your stuff inside the event structure...including resetting the button to false...and...turning off the while loop.

 

Now, one last thing, I have found that I am developing the habit of putting all the controls in one while loop and polling it using a timer.  This scans all the front panel controls every so often, but doesn't run anything else unless an event is kicked off. if the controls arn't moving, there is not much processor time being used, so everything just sits there...like it's supposed to...waiting for something to happen.

 

Hope this helps.

The Hummer

 

Let me know how that works out.

0 Kudos
Message 11 of 13
(622 Views)
Hi Hummer,

nice effort to give such a descriptive answerSmiley Wink

But have you ever looked at the date of the original post? This is a 8-year old thread, last message was written 7 years ago! (The original poster will either have it's vi running or will no longer use LabView (Heaven forbid!)Smiley Very Happy)


Message Edited by GerdW on 05-22-2008 10:16 PM
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 12 of 13
(612 Views)

Well how about that...guess that is the result of too much coffee.

Was looking for something else and saw a chance to contribute...Guess I'll just keep humming along.

Thanks for the note.

The HummerSmiley Surprised

0 Kudos
Message 13 of 13
(605 Views)