LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Adding Run Button to VI


rebghb wrote:

OMG!! are serious, isn't there a simpler code????????? Do you need all these sub VIs??


Just curious: Do you think it's any different in another programming language? Think about it. Smiley Wink

Message 11 of 14
(3,287 Views)

Does he really need a button to "run" the VI?  Or just a button that "starts" whatever process (game, etc) he wants to start.  It might be a simple matter of how "run" is defined. 

 

If that's the case, then an Event Structure or a State Machine would do the job..

Message 12 of 14
(3,255 Views)

Hi. I try to control the Run button in this program remotely.For this job I use Data DashBoard andorid program of NI Instrument. I designed a simple program to observe whether I can control your Run button with shared variable,but I can not control. My aim is that the user pushes the Run button on phone,the VI has to run. Everything is ready,but as I said,I can not make the VI start. I am sharing the photo what I did. Please help me

Download All
0 Kudos
Message 13 of 14
(1,754 Views)

I've not used X-Controls (which I think of as a reasonably-advanced concept), but couldn't this code be (almost trivially) written with an Event Loop and "ordinary" controls?

Control Start.png

Now, there are some caveats (that's a fancy way of saying "Warnings") to this code:

  • By default, the Square Button I used (it originally was the OK Button) has a Mechanical Action of Latch when Released, which means that if you push it before you run the program, it will "stick" in the "True" (or "Stop") state.  If you want to be sure to leave it "off" until you hit Run, change its mechanical action to any of the three top-row actions, such as Switch Until Released.
  • To get the Stop Button to function once the Run Button has been pressed, you need to edit the Event Case and turn off "Lock panel until the event case completes".  As it happens, Kathryn the Great posted a Reply on the Forums today pointing this out and including this helpful article.

Bob Schor

Message 14 of 14
(1,728 Views)