LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Are there any "execute once" buttons in labview?? (the likes of command buttons in VB)

Solved!
Go to solution

In VB, a button can be able to exucute a task or command once when pressed, in other words, we can NOT hold down this button as in the following case:

 

 

 

Command1_Click()

 

text3 = text1 + text2

 

 

Note,that if the form is still running and yo add new numbers to text1 and text2, text3 isn't updated unless Command button is pressed once again.

Unfortunately in LabVIEW, the only buttons I know are boolean, they seem to be held down when pressed or latched, sothat  when new numbers are inserted in the numeric controls, and mouse is pressed anywhere on the front panel (when vi runs) the indicator is automatically updated.

 

So is there any execute once buttons??

T. A.
0 Kudos
Message 1 of 4
(3,393 Views)
Solution
Accepted by topic author toniaz

It is a bit difficult to understand the problem, maybe you can post some LV code that does not work as desired.

 

I guess that you do the following mistake: you do not read the terminal of the button. If a button (mechanical action) is set to 'Latch when released' (default), as soon as you read the terminal it snaps back.

 

Felix

Message 2 of 4
(3,392 Views)
thanks... i believe i got that. 🙂
T. A.
0 Kudos
Message 3 of 4
(3,389 Views)

Well the VB code you post is a Event Triggered code, you can use the same in LabVIEW with the event structure.

 

The concatenation of strings can be put inside the event case and will only execute when the button is pressed.

 

Ton

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 4 of 4
(3,365 Views)