G Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
Neil.Pate

Some kind of hotkey to run a top-level VI

Status: Released

We have a first version of this feature released here
https://www.vipm.io/package/gcentral_lib_top_level_launcher/

 

Issues and feature requests can be reported here 
https://github.com/gcentral/top-level-launcher

 

Description
In Visual Studio or similar environments it is common to have a shortcut key (F5 for example in VS) build and run some preconfigured project. It would be really cool if we could have the same thing in the LabVIEW IDE. Pressing F5 (or whatever key was configured) from anywhere "inside" LabVIEW would then start a VI.  
Submitter
Neil Pate
LabVIEW Compatibility
The older the better
How would the user interact with this tool?
A (configurable) key. Default would be F5 to mimi what is done in Visual Studio
Distribution Method
VI Package (.vip)
Development Target Cost
$?

Other Notes
As a first attempt this could probably be implemented using Quick Drop, but I think it deserves to be baked into the actual IDE itself.
9 Comments
crossrulz
Knight of NI

Perhaps a QD plugin to run the top-level VI in a build specification would work.  The default could be the first or last application build specification in the project.  But also with QD, you could type in the build specification name to run its top-level VI.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
JKSoerensen
Member

Hey Neil. This looks like an awesome idea, and I think some of this would play nicely with what @theQ was proposing in his presentation at CLA Summit. 
https://labviewwiki.org/wiki/Americas_CLA_Summit_2019/Help!_I%27m_out_of_letters_in_Quick_Drop!

 

Could we use some of that to get the project moving?

GCentral
CTD + CLD + Pythonista
TheQ
Active Participant
Status changed to: New

Here is a link to my QDKS to run VIs by name as @JKSoerensen mentioned. Mine has a config screen and stores a config file for the shortcut to a VI. I’m sure it could be adapted to look at EXE build specs instead of the config file to chose which VI to run. 

https://gitlab.com/QSI_Shared_Code/quick-run

Quentin "Q" Alldredge

Chief LabVIEW Architect, Testeract | Owner, Q Software Innovations, LLC (QSI)
Director, GCentral | Admin, LabVIEW Wiki | Creator, The QControl Toolkit
Certified LabVIEW Architect | LabVIEW Champion | NI Alliance Partner



fabric
Active Participant

Could tie in with this idea for identifying the "main" VI in a project:

https://forums.ni.com/t5/LabVIEW-Idea-Exchange/Project-should-support-links-like-bookmarks-to-main-V...

JKSoerensen
Member

Hey @Neil.Pate

 

Would it be useable to have a quick drop shortcut or are you looking for something else.

Another way to solve it would be to have a floating dialogue where you can specify the top level VI to launch and it would remember this until it was launched again or if you redefine the VI from the settings.

Or is it more like this identification of the Top level VI from an LLB automatically and then executing that when a user presses a button. https://forums.ni.com/t5/LabVIEW/Defining-quot-Top-Level-quot-VI-in-LLB-created-with-application/td-...

 

All the best

The GIE team 🙂

GCentral
CTD + CLD + Pythonista
Schliepe
Member

For anyone that is following this post, and especially @neil.pate, we are preparing to do a couple of mob programming sessions with the intention of trying to implement this feature.  We still have some slots open.  We are going to be doing the session on Thursday October 10th from 11:00am - 12:30pm Central Time (US).  Send me a DM here or in the LabVIEW Discord with your email address and I'll get you added to the meeting invite.

tst
Knight of NI Knight of NI
Knight of NI

Regarding the launching aspect, here are a couple of other options other than a QD plugin:

 

  1. It's possible to have LV launch a daemon in a private context on startup, which will monitor for the key press. This will require polling or handling the event in a platform-specific way, so it's not ideal. I also don't remember checking whether something like the Application class property App.ActiveApp will actually get you to the active project from there.
  2. If you add a VI to the LV menus (for instance, by saving it in <LabVIEW>\project), you can assign it a shortcut key (at least some of them. They don't all appear in the list), but LV only saves shortcuts which are assigned to the built-in tags, so it doesn't survive a restart (or at least it didn't. I haven't checked in recent versions). It's possible to work around this by having the VI hijack an existing item which is launched from a VI and has a tag (like MAX). I suppose it's also possible to run a VI when LV starts to configure the shortcut we want, but I'm not sure how that would be done if the item doesn't have a tag.

I suppose that in such cases, if the goal is to have a specific VI configured for a project, we would still need something like a project provider or a menu option to let the user define what that VI is.


___________________
Try to take over the world!
Michael_Munroe
Active Participant

This is one of hundreds of features of Property Inspector 5.0 LabVIEW add on.  Just define a simple macro to find the Main.vi and run it.  The macro can be selected from a persistent floating window with just one click.

 

Here is the macro that automatically selects the newest matching Main.vi if there is more than one.

 

Run Main VI.pi5

Search Name Equals Main.vi
Sort Date Desc
Select First
View VI

View Run

 

Michael Munroe, CLD, CTD, MCP
Automate 1M+ VI Search, Sort and Edit operations with Property Inspector 5.0, now with a new Interactive Window Manager!
Now supports full project automation using one-click custom macros or CLI.
JKSoerensen
Member
Status changed to: Released

We have a first version of this feature released here
https://www.vipm.io/package/gcentral_lib_top_level_launcher/

 

Issues and feature requests can be reported here 
https://github.com/gcentral/top-level-launcher

 

GCentral
CTD + CLD + Pythonista