Tip For Testing and Debugging Tools Menu Tools
Did you know that you can simply drop a Windows shortcut to a VI into "<LabVIEW>/project" and it will show up in the Tools menu in the IDE?
If you've done any scripting or built any LabVIEW IDE tools you are probably aware of the Tools menu. If you drop a VI in the <LabVIEW>/project
directory, the next time you start LabVIEW the name of the VI will show up as a menu option in the Tools Menu. You simply select it in the Tools Menu and LabVIEW will run the VI for you. It's a quick and easy way to extend the IDE. It's used by a lot of popular tools, such as DQMH and Caraya.
When I build tools, I often use the Tools menu. Usually, my tool gets packaged into a VIPM package that when installed puts the correct VI in the correct place and usually throws any supporting code in <.vilib>
. This is a great process for distributing an IDE Tool. However, it is not great for prototyping and rapid iteration, because the whole build and install process takes some time to set up and each iteration takes some time to produce and install a new package. I have some tools and templates to make that process easier and it can still be cumbersome.
I was working on a new Tools menu tool and I just wanted to be able to rapidly iterate and debug. I didn't want to work directly out of the <LabVIEW>/project
directory because I wanted to have a git repository and that would just pollute that folder. I wanted a repository but I also didn't want to take the time to set up the whole CI/CD package building routine, because I wasn't entirely sure this idea would even work out. So I started by having my code in a separate folder on my Desktop and then copying my VI into the <LabVIEW>/project
directory. I would run it and debug it from there. When I had made a change I liked I would copy the file out of the <LabVIEW>/project>
directory back into my source directory and commit the changes. That worked only because the VI was simple enough and had no subVIs yet.
I quickly realized that wasn't sustainable. I got to the point where I wanted some subVIs, but I still wasn't ready to commit to the whole package-building route. I thought well, what if I just dropped a shortcut into the <LabVIEW>/project
directory and pointed it at the VI in my source directory. And it worked! Now I could easily rapidly prototype and debug directly from the VI running from the Tools menu while still keeping my separate source directory. That may seem really dumb and obvious, and it is. Yet I didn't immediately think of it and I found it really useful. Hopefully, someone else will as well. To be honest I was kind of surprised that it actually worked- I wasn't sure if LabVIEW would follow the link, but it does!