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: 

Library-Template

Hi friends

I'm just thinking about creating a Library-Template or maybe a Template-Library.

I want to achieve the following goal:

In the end I want to have a library, which includes several files. One of those is then used as the libraries main-vi and the others are needed in this one. So for example I want a simple statemachine. The main vi contains a loop with a case structure. To select the appropriate case, I want to use an enum (strict type def). So in this library I want the main-vi with the loop and the enum control-file.
So if I want to create a new statemachine I just want to do a simple operation (something like copy the library). In addition to this, I'd like it to be able to have more instances in a project. So for example I want to creat a statemachine 1 and a statemachine 2 using this template.

I hope you understand what I mean and maybe one could give me an advice, how I can do this.

Thanks in advance.

Thomas
Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
0 Kudos
Message 1 of 2
(2,201 Views)
I've considered doing something similar, and this is how I thought it wold have to work.

Instead of opening the template itself, you would open a VI that would prompt you for a name to save the state machine to, then it would save the template (using VI server) along with the enum to where ever you specify, and open the newly created state machine.

You'd have to save everything in the correct order to make sure the top level links to the newly named enum. To do this, I think you'd need to first save the state machine with the template enum, then (using VI server) do a Save on the enum with the new name, then save the state machine again. This should get the top level properly linked to all its subVIs and controls.

Ed


Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
0 Kudos
Message 2 of 2
(2,194 Views)