LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW classes and references

Hi everybody !

I am just a beginner with LVOOP and I really like it, but like every beginner I have several questions about it.

Actually, I am designing a software that will automate a XYZ table and do several acquisitions, thus process the data acquired to generate a report.

I just developed an instrument driver for the XYZ table using LVOOP.

Now what I plan to do is to use one instance of this class in the main VI to automate the move of the different axis.

For this part everything is fine, but I would like to allow the user to do a manual move to control the axis if needed (using a modal window).

So, I just wondered what would be the best way to do it because I don't want to create another instance of this class in the sub VI handling the manual move.

Should I use a reference of this class ? What kind of reference should I use ? Data reference ? Or a reference of the class control I would have created on my main VI's front panel ?

 

I found this document : http://zone.ni.com/devzone/cda/tut/p/id/9386 . Do you think I can use this method in my case ?

 

I need your advice to do the best and most efficient application.

Thanks for your answers.

Have a nice day.

Regards,

Da Helmut
Voir le profil de Maxime M. sur LinkedIn - View Maxime M.'s profile on LinkedIn
0 Kudos
Message 1 of 4
(3,400 Views)

Nobody ?

Da Helmut
Voir le profil de Maxime M. sur LinkedIn - View Maxime M.'s profile on LinkedIn
0 Kudos
Message 2 of 4
(3,370 Views)

Hi Helmut,

 

Thank you for posting on National Instruments’ forums.

 

Your question is a little puzzling. Indeed, when using classes, you normally have to declare several VIs, either private or public. Private level VI cannot be called by any other Vis than the ones belonging to their class. On the contrary, public level VIs can be used by the elements that exist outside of the LVclass. Therefore, if you created several public VIs controlling the way your table moves on the X, Y & Z axes, you should be able to use them inside a subVI.

 

Of course, it depends on the way you created your LVclass. Another way could be to create a supervisory class, containing two sub classes, one dedicated to the automated move of your table, and the other to the manual move. Of course, the VIs responsible for the XYZ movements, inside the two subclasses would be the same.

 

Either way, in order to help you further, I will need more information about the way you created your lvclass.

 

I hope the above info will help you.

 

Best regards,

Guillaume H.
National Instruments France

0 Kudos
Message 3 of 4
(3,280 Views)

The DVR (tutorial you linked) is the best way of doing by-ref LVOOP.

Now you have the option of putting the object into the DVR and bass a ref to the object to your parallel loops. This even gives you the ability in LV2010 to use property nodes for your accessor VIs (they are dealing with the DVR behinde the scenes).

The second option is to use a type-defed cluster and place it in an DVR in an Initialization method of your class. The class private data cluster then  consists of the DVR. This allows you to mix by-val and by-ref.

You need to try out both to get a feeling for the unique powers and short-comings of both approaches.

There is also a lot of discussion on LAVA when the DVR came out (mid-2009) that make a in-depth reading while experimenting with it.

 

Felix

Message 4 of 4
(3,260 Views)