LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Accessing data in a class when not in the class library

Spoiler
 

Hi,

 

I'm fairly new to labview classes and am wondering if it is possible to make public or read the value coming from a lvclass control.

 

If I highlight the control all the values are listed as private and I can't unbundle the class, of course once I make a vi a member of the lvclass I can unbundle the class.  However there are two elements that I want o be globally available, is this possible?

 

Sean

0 Kudos
Message 1 of 4
(2,067 Views)
Open the .ctl in the class and right click -> Create Accessor. This should give you a function you can use to obtain your class data.
0 Kudos
Message 2 of 4
(2,062 Views)

Thanks for the feedback Taki1999 but I don't appear to have that option. 

 

I am using labview 2010 Full Development System. 

 

If I right click on the ctl in the lvclass the "Create Accessor" option does not appear.

If I open the .ctl right click on the ctl in the lvclass the "Create Accessor" option does not appear.

If I open the .ctl and right click on the cluster in the .ctl the "Create Accessor" option does not appear.

 

Maybe there is a different way to do it in 2010?

 

SEan

 

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

You need to select your class, not the ctl.

This is the same thing as making a member vi for the class, it's just a shortcut for making a .vi that can output the private date.

 

( The way LabVIEW has implemented the OOP, all class attributes are private. And there are no way to make them public or protected. The only way to access the data from outside is by making a Accessor. )

 

Here are some reading: http://zone.ni.com/devzone/cda/tut/p/id/3574

0 Kudos
Message 4 of 4
(2,057 Views)