LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Labview create and reuse template vi

It has been quite a shock today for me to find that Labview Template subvi is actually not a template reusable code!!!!!

 

Template Reusable code:

When created, usually allow the developer to define 'editable regions'

For any vi that is created from template, the developer then could define desired parameters/code etc in the editable region

Any reusable code/vi created from template must not allow developer to delete non-editable regions from derived code/vi.

Non-editable regions could only be deleted from template code/vi and when deleted, the derived code/vi automatically updates

 

 

Now I might not have completed my thorough research and above features probably exist in Labview development environment.

Could I request the experts to comment on this please

Thank you

K.Waris

0 Kudos
Message 1 of 4
(2,938 Views)

Hi K.,

 

sorry you're shocked by the way LabVIEW works (or by the difference of your expectations and the reality)…

 

Opening a template VI opens a fresh copy of that VI and you are free to do whatever you would like to do with this fresh copy of your template VI!

 

For any vi that is created from template, the developer then could define desired parameters/code etc in the editable region

VIs created from a template can be edited.

 

Any reusable code/vi created from template must not allow developer to delete non-editable regions from derived code/vi.

You can either block the full BD from editing (using a password) - or no part. There's no in-between.

 

Non-editable regions could only be deleted from template code/vi and when deleted, the derived code/vi automatically updates

Sounds like the concept of using subVIs: part of code encapsulated in its own entity. When changing the subVI all instances of that subVI are influenced…

 

 

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 4
(2,900 Views)

I agree with GerdW. I think what you mean by template is not what LabVIEW means. In LabVIEW the template is 'starter' code - it is something that gives you the basics and then you change what you need to change. A LabVIEW template is not a form letter, it is a partially assembled kit.

 

What you want sounds more like an Express VI than anything else to me. An Express VI is a Block diagram module that you can configure in a strict, limited, and structured way. Many LabVIEWers dislike them due to the limited and structured part (as well as some wastefulness inherent to their development).For your purposes, these may not be drawbacks. Take a look at creating one of them to accomplish what you are trying.

 

I hope that this helps,

Bob Young

 

 

 

0 Kudos
Message 3 of 4
(2,874 Views)

Thanks for replying Gents

 

Labview development environment is alright. As a matter of fact, very nature of typedef control automatically updates any changes in the control to all the vis which use that control. However, a template vi as I described above will save development time to a great deal.

 

Lets think of a situation. Suppose one has to use a general vi format/style/architecture for 500 vis. After all vis have developed, one may want to then add some more comments for certain features which are common to all vis derived from a template. I would in such scenerios like Labview Template VI to update those comments automatically to all subvis derived from template vi.

 

What I am looking for is an ordinary feature which is even available from freely available development environment for other languages such as C++, JavaScript etc!!

 

Nonetheless I must thank you for sharing your views on whats available with current labview versions

 

Many thanks

K.Waris

Message 4 of 4
(2,871 Views)