LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Creating a run button

Solved!
Go to solution

Hello. I would like to know how I could create a "Run" button on a Vi so that the operator wouldn't have to go to menu bar to start Vi, if this is possible. Thank you

0 Kudos
Message 1 of 13
(6,220 Views)

The VI properties, in the Execution options, has a Run When Opened option. This will probably do what you want.

 

Otherwise, you will need to click the Run button to start the VI unless it is called by reference, or you build an executable.

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


Message 2 of 13
(6,214 Views)
Solution
Accepted by topic author ceilingwalker

Use a state machine and make sure the VI is set to run when opened. Start in an idle state. A VI used by an end user should never be in edit mode or stopped.

Message 3 of 13
(6,211 Views)

Simply build an executable.  Your Operator is probably not running on a machine with LabVIEW, but rather just wants a Program, right?  That's an Executable.  When you double-click it, it opens and runs.  If you want even more "hands-off" behavior, make it part of the PC's Startup code, so when the PC is rebooted, the code automatically runs.

 

Is this what you mean?

 

Bob Schor

Message 4 of 13
(6,144 Views)

@Bob_Schor wrote:

Simply build an executable.  Your Operator is probably not running on a machine with LabVIEW, but rather just wants a Program, right?  That's an Executable.  When you double-click it, it opens and runs.  If you want even more "hands-off" behavior, make it part of the PC's Startup code, so when the PC is rebooted, the code automatically runs.

 

Is this what you mean?

 

Bob Schor


Simply build an executable.  Your Operator is probably not running on a machine with LabVIEW, but rather just wants a Program, right? So, to make sure I understand you, this will run on a PC that doesn't have LV installed? Sorry to sound silly but I really don't know the answer to that and I think I am mis-understanding you.

0 Kudos
Message 5 of 13
(6,128 Views)

LabVIEW is a programming language and we coders use the development system to create our code and run it.  But just like any other language you can build an executable that can be distributed to any other computers that don't have the development system.  LabVIEW requires a run-time engine on the distributed system and whatever drivers you may have used in you code (DAQmx, VISA, etc).  You can build an installer too.  That takes the executable, packages in the run-time engine and any required driver packages and makes an MSI like package you can easily distribute.  Search LabVIEW Build Application for more details...

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019 - Unfortunately now moving back to C#, .NET, Python due to forced change to subscription model by NI. 8^{
Message 6 of 13
(6,113 Views)

The ability to create an executable comes with the Application Builder. The Application Builder can be purchased as an Add-on or is included with LabVIEW Professional. This is the best way to give your customer the finished application. If you are delivering a product, it's a must because you're not going to install your LabVIEW environment on your customer's computer.

 

If you are developing on a computer that will always have LabVIEW on it (like a classroom student licenced LabVIEW, or a lab with a test setup), it's more cost effective to use the LabVIEW Development environment.

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


Message 7 of 13
(6,111 Views)

You need the LabVIEW RunTime Engine for the particular version of LabVIEW (e.g. LVRTE2014) installed.  I'm assuming that you are not doing lots of device I/O -- if you are, you'll also need Device Drivers.  When you build an Executable, you can also build an Installer (I've never had to do this, myself, so I don't know all the details) that will handle the Installation for you.

 

In my case, we have one PC that collects the data and is connected to hardware.  It has LabVIEW installed, with all the necessary drivers.  I build an executable on this machine, and when we collect data, we simply double-click on the Executable's shortcut.  Other than I, noone runs LabVIEW directly on this machine.

 

The data that is collected needs to be analyzed, and we have separate programs for that.  I have all of those executables stored on a Share that everyone can see, along with the installer for the LabVIEW RTE (which they only need to run once, unless I upgrade the code to a new version of LabVIEW).  All they need to do is to create a shortcut to the executable on the share, or pull down their own copy, and double-click.

 

Bob Schor

Message 8 of 13
(6,107 Views)

deleted, info given already by prev posts.

0 Kudos
Message 9 of 13
(6,103 Views)

@James.M wrote:

The VI properties, in the Execution options, has a Run When Opened option. This will probably do what you want.

 

Otherwise, you will need to click the Run button to start the VI unless it is called by reference, or you build an executable.


This is what I originally wanted. However, I didn't know about building the executable. Really all of these responses qualify as a "solution". Thank you very much everyone.

0 Kudos
Message 10 of 13
(6,080 Views)