11-02-2012 02:25 PM
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?
Solved! Go to Solution.
11-02-2012 03:28 PM
Sounds like a good suggestion to post on the LabVIEW Idea Exchange.
11-02-2012 03:44 PM
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
11-02-2012 04:05 PM - edited 11-02-2012 04:07 PM
New... opens this (I actually keep them on a pallate under favorites too with Place Contents enabled) 1 click to place this including documantation
Now if only New... was available in Projects...
11-02-2012 04:17 PM
@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.
11-04-2012 01:21 AM
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.
11-05-2012 06:10 AM
@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?
11-05-2012 06:48 AM
@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.
11-05-2012 07:01 AM
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.
11-05-2012 07:24 AM
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