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.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Fastest way to add action engines to a project

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?

Message 1 of 20
(4,113 Views)

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)


"Should be" isn't "Is" -Jay
0 Kudos
Message 2 of 20
(4,099 Views)

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

Message 3 of 20
(4,089 Views)

One again, Jeff beats me to the draw ...

 

BS

Message 4 of 20
(4,084 Views)

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?

0 Kudos
Message 5 of 20
(4,080 Views)

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  Smiley Tongue

0 Kudos
Message 6 of 20
(4,076 Views)

Couldn't sign it until after I posted and noticed Jeff hit "Post" a minute before I did ...

 

Bob (chagrinned) Schor

0 Kudos
Message 7 of 20
(4,048 Views)

@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.


"Should be" isn't "Is" -Jay
0 Kudos
Message 8 of 20
(4,027 Views)

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?

0 Kudos
Message 9 of 20
(3,968 Views)

@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.


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
0 Kudos
Message 10 of 20
(3,955 Views)