LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Why don't VIs created from VITs automatically class members if the VIT is a member?

Solved!
Go to solution

I have an .lvclass that contains a VIT that I use to create methods.  The VIT is a member of the class so that it can access the data members.  However, the new VIs that I create from the template are not automatically members of the class, so I have to save them and add them to the class when they are complete.

 

Is there anything I can do to save the extra steps?

0 Kudos
Message 1 of 14
(3,897 Views)

Sounds like a good suggestion to post on the LabVIEW Idea Exchange.

0 Kudos
Message 2 of 14
(3,889 Views)

How does that work? I thought the point of VIT's was to use multiple copies, like Reentrant VI's, which is what a class function do, so what do you use this for? 

(quite curious, baffled and confused, no sarcasm)

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 3 of 14
(3,886 Views)

Capture.PNG

New... opens this (I actually keep them on a pallate under favorites too with Place Contents enabled) 1 click to place this including documantation 

Capture.PNG

 

Now if only New... was available in Projects...


"Should be" isn't "Is" -Jay
0 Kudos
Message 4 of 14
(3,881 Views)

@Yamaeda wrote:

How does that work? I thought the point of VIT's was to use multiple copies, like Reentrant VI's, which is what a class function do, so what do you use this for? 

(quite curious, baffled and confused, no sarcasm)


I think that's more a side effect of templates.  The usual idea of templates (in any program) is to make it easy to create a new document that already contains certain items or data, which is what VITs are for.

 

If you have a template in your project, you can right-click on the template and choose "New from Template" which creates a new untitled VI that contains whatever is in the template.

Message 5 of 14
(3,877 Views)

nathand wrote: 

If you have a template in your project, you can right-click on the template and choose "New from Template" which creates a new untitled VI that contains whatever is in the template.


If you do this on a VIT in a class, it also adds the new VI to the class, which I think is what PVAHamm wants.


___________________
Try to take over the world!
0 Kudos
Message 6 of 14
(3,840 Views)

@tst wrote:

nathand wrote: 

If you have a template in your project, you can right-click on the template and choose "New from Template" which creates a new untitled VI that contains whatever is in the template.


If you do this on a VIT in a class, it also adds the new VI to the class, which I think is what PVAHamm wants.


When I do this, it does not add the new VI to the class.  Is there a setting or property of the lvclass that I can set so that it does so?

0 Kudos
Message 7 of 14
(3,817 Views)

@PVAHamm wrote:
When I do this, it does not add the new VI to the class.  Is there a setting or property of the lvclass that I can set so that it does so?

I don't think so. It should just work. Maybe it depends on your LV version? I just tested this on a .lvclass in 2011 and a .lvlib in 2009 and it worked for both.


___________________
Try to take over the world!
0 Kudos
Message 8 of 14
(3,815 Views)

I'm working with an .lvclass in 2011 and it is not working for me.  Perhaps someone from NI will shed some light on why this would be working for you and not for me.

0 Kudos
Message 9 of 14
(3,813 Views)

I ran into that issue and it is not an opion now or in the future.

 

Members of the class are recorded in the class itself. Since the VI created from teh template does not exist at development time there is no record of that VI in the class. As reported by the OP, it can be added but that only works at development time.

 

I had to re-work my code such that templates only used public methods and all was well.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 10 of 14
(3,809 Views)