LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
altenbach

Change Template behavior when inserting via palette (select a VI ...)

Status: New

Background information:

 

Templates have two personalities, depending on how they are opened.

 

  1. If I open them from the file explorer or "open" dialog, they open as a *.vit, allowing us to modify, and possibly resave the template with new features.
  2. If we open them from the "New..." dialog and select  "From Template...Browse...", we will get a new VI containing the template code and having a unique name as described in detail here.

This is all reasonable! 🙂

 

It becomes a little bit confusing if we insert a VI into a diagram using the function palette (Select a VI...):

 

Current behavior: we get the *.vit inserted into the diagram. This is probably not what we really want in the typical case.

 

Desired behavior: We should get a plain VI inserted into the diagram. That VI should contain the template code and should be named according to the convention in point (2) above.

 

Idea Suggestion:

When inserting a VI template (*.vit) via the function palette, it should not insert as a template, but it should insert as a plain VI containing the template code.

 

(It might even be more reasonable in general if templates would always open as VIs (e.g. in case (1) above). We can always re-save them as templates if desired! I am not suggesting this yet, but it could be another idea in the future depending on how this idea is received. ;))

6 Comments
altenbach
Knight of NI

... after all, the palette entry is named "Select a VI...", not "Select a VIT...". 😄

dthor
Active Participant

I've never noticed this behavior, so now I'm glad I know about it!

 

If I opened up a template using Right Click --> Select a VI... I can guarentee you that I would accidently save over my nice pretty template with whatever code I put in there. And then I would be unhappy. Smiley Sad

 

So, I hope this Idea gets more traction, because I don't want others to make the same mistake!

altenbach
Knight of NI

After thinking more about all this, I take back the statement above for the existing behavior that said "This is all reasonable". It actually is not! The more general extension of this idea (including case (1)) can be found here.

AristosQueue (NI)
NI Employee (retired)

I'll agree the current behavior is weird, but I'm not so hot on the suggested fix. I'd say, instead, "You should not be able to pick templates if the VI you're working on is not a template." To me, it does not make sense to say "I'm dropping this node and, whoa, at the same time it's creating a new, untitled, unconnected to anything thing for me to save."

altenbach
Knight of NI

> I'd say, instead, "You should not be able to pick templates if the VI you're working on is not a template." 

 

Stephen, maybe I am completely misuderstanding, but why would a template need to contain only templates?

 

Templates should be VIs that already have certain typical and often used elements implemented: I might create a template for some generic signal processing operation that has a 1D array In/out and two scalar in/outs for parameters and a half-finished Icon, already containing a common header graphic. If I need to do some signal processing on a 1D array, I could just right-click the wire...insert...all palettes ...select a VI...and insert a new, unsaved instance of that template. All I need to do now is modifiy the code and re-save. This seems like a time-saver. Even if I (e.g.) need less or more parameters, most of the work is already done. The great thing about computers is that they can free us from repetitive work. This is one of these cases. 😉

 

(Again, MS word templates are analogous. We might have a template with the company letterhead, a template for a rejection letters for job applicants, a template for a thank you letter, etc. LabVIEW currently makes the use of templates in this fashion unecessarily difficult. They could be made more useful).

 

LabVIEW currently has pretty good mechanisms for toplevel templates in the "new..." functionality. Templates are equally useful for subVIs and this idea (and also this one) could help...maybe.

daveTW
Active Participant

Hello Christian,

 

I remember to old LV 5.1 and perhaps 6.x- times when LabVIEW handled VITs exactly in the way you described. And I found it very useful to drag a VI from the palettes to my BD and expect it to be an unsaved instance of a VI. The VIT is placed in the palettes exactly for this purpose!

 

Greets, Dave

Greets, Dave