From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
11-11-2015 02:49 PM
I often use action engines in projects. Sometimes they are very specific to the data in my application, other times they check for elapsed times or send a message on a queue. Sometimes when I want two action engines with the same functionality (timers of 2 different events), I'll duplicate the files and re-name/re-icon before adding to my project.
Then I found out about LabVIEW libraries (.lvlib). I made a library (call it Timer_AE.lvlib) and implemented some standard vi's and wrappers: core, init, set interval, reset timer, check timer... Thanks to the library, I can have many "core.vi" in different libraries, and LabVIEW doesn't get confused. I can easily change the icons for a library all at once. It seems like a great way to do what I want, but I know that when dealing with LabVIEW it's always better to deal with toolbars and pallettes in LabVIEW rather than copy+pasting in windows explorer.
Am I abusing the LabVIEW libraries? Does LabVIEW have a built in way to do what I am describing?
11-11-2015 02:56 PM
You are abusing lvlib just a bit.
Have you considered "Project Templates?" That and a bit of lvlib mojo to keep the "Core.vis" private and expose the API by "Going to Nirvana" with your Action engines... (enough said by me untill I know your use case and user base)
11-11-2015 02:59 PM
My simple Action Engines (such as Timers) I save as LabVIEW Templates (.vit) and keep them (typically) outside my Projects, but available from File/New ... under User Templates. When time to save, I name them appropriately for the Project and save them inside the Project. Each one has a unique (and, I like to think, mnemonic) name, which I find helps me to "self-document" my code.
Bob Schor
11-11-2015 03:00 PM
One again, Jeff beats me to the draw ...
BS
11-11-2015 03:00 PM - edited 11-11-2015 03:03 PM
Hi Jeff,
I have not considered project template, I have never made one before. You are correct that I set the scope of the core.vi to private. Sometimes I do not realize that I want an AE until I've gotten a little ways into the project, would a project template mean that I have to use it as a starting point?
11-11-2015 03:03 PM
Hi Bob, I will have to look into .vit's. Yes, I rename mine as well within the project explorer so that LabVIEW can make all the correct connections. And I don't think I'd be allowed to have two "Timer.lvlib" in the same project. I was expecting your signature: Bob (beaten to the draw) Schor
11-11-2015 04:37 PM
Couldn't sign it until after I posted and noticed Jeff hit "Post" a minute before I did ...
Bob (chagrinned) Schor
11-11-2015 05:20 PM - edited 11-11-2015 05:22 PM
@Bob_Schor wrote:
Couldn't sign it until after I posted and noticed Jeff hit "Post" a minute before I did ...
Bob (chagrinned) Schor
Kudos for using "File New..." rather than "Ctrl+N
Nothing to be chagrinned about!
Project Templates are a great way to pull re-usable code into a new project that still maintains name-spacing. True re-use code would be written without bugs! Unless you have a "Bug Tracking" system or, can afford the "Burden Hours" to support the internal code you can't charge to a customer,... these project templates will save you hours per deliverable executable.
11-12-2015 09:40 AM
Can I save a group of VIs as a template, or do I have to save them one by one? Or do you make a "Tree.vi" that has all of the subVIs on the block diagram so that you can pull them all into your project at the same time?
11-12-2015 09:49 AM
@Gregory wrote:
Can I save a group of VIs as a template, or do I have to save them one by one? Or do you make a "Tree.vi" that has all of the subVIs on the block diagram so that you can pull them all into your project at the same time?
You have to make individual templates. However, if you put all of your templates in the same folder, you can just add that folder to your project. I could also argue that templates do not belong in the project at all, but in your reuse library.