LAVA Forums Buy cool LAVA gear Forums RSS Feed

Welcome Guest ( Log In | Register )

> Related links

Check out the related Code Repository Files or visit the LabVIEW Wiki Development Environment Portal


Tags
(This content has not been tagged yet)
 
Reply to this topic Start new topic
> Public .ctl with private members, Implicitly private
Ton
post Feb 15 2007, 08:20 AM
Post #1


CCT It
*****

Premium Member
Posts: 1337
Joined: 13-June 05
From: Woerden, Netherlands
Member No.: 2399
Using LabVIEW Since:2001
LV:8.5.1 ,6.1 ,8.2.1
Netherlands hol_utrecht Nothing Selected My Blog My Gallery


Consider the following, you have a library that has private controls. For use inside other VI's you construct a typedef .ctl that contains some off these controls and make the typedef .ctl public.

Now if you use this typedef inside another VI/Ctl the VI/CTL will be broken since it refers directly to the private members thumbdown.gif . I was hoping that the public .ctl refered to the private members allowing a good use to these items....

Does anyone have an idea why? and how to bypass this.

The error:
CODE
This VI cannot access the referenced item because of library access scope. Private library items can only be accessed from inside the same library or libraries contained in that library. Protected library items can only be created inside LabVIEW classes and can only be accessed from inside the same LabVIEW class or LabVIEW classes inheriting from that class.


Ton

--------------------
Certified LabVIEW Developer
Shouldn't you be programming a Code Repository solution?


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
Ad
post Feb 15 2007, 08:20 AM
Post #















Tags
(This content has not been tagged yet)
Go to the top of the page
Quote Post
TG
post Feb 15 2007, 06:27 PM
Post #2


Very Active
***

Premium Member
Posts: 173
Joined: 13-June 05
From: Hillsborough, NJ
Member No.: 2402
Using LabVIEW Since:1992
LV:8.2.1 ,7.1.1 ,.
United States Nothing Selected Nothing Selected


QUOTE (tcplomp @ Feb 15 2007, 03:20 AM) *
Consider the following, you have a library that has private controls. For use inside other VI's you construct a typedef .ctl that contains some off these controls and make the typedef .ctl public.

Now if you use this typedef inside another VI/Ctl the VI/CTL will be broken since it refers directly to the private members thumbdown.gif . I was hoping that the public .ctl refered to the private members allowing a good use to these items....

Does anyone have an idea why? and how to bypass this.

The error:
CODE
This VI cannot access the referenced item because of library access scope. Private library items can only be accessed from inside the same library or libraries contained in that library. Protected library items can only be created inside LabVIEW classes and can only be accessed from inside the same LabVIEW class or LabVIEW classes inheriting from that class.



Ton


I hope you get a good answer to this one Ton. I have encountered this too. The encapsulation paradgim in LabVIEW
whereby all private data is accessible only by members of the class is a good idea, but how does one deal with public type definitions which may (by design) include some of these types in them as the structures develop in complexity?
It can get rather complicated.

I have actually changed the scope of some of my private elements to public to get around it (rather dirty I agree)
Im sure there is a better way, but being in a little over my head I have not the time to find the correct solution
(if there even is one.)

--------------------
NJG88_TG (Il2 1946)


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
Aristos Queue
post Feb 16 2007, 03:22 PM
Post #3


LV R&D Envoy
*****

NI
Posts: 1226
Joined: 15-August 06
From: Austin, TX
Member No.: 5877
Using LabVIEW Since:2000
LV:8.5.1 ,. ,.
United States Nothing Selected Nothing Selected My Gallery


QUOTE (John Rouse @ Feb 15 2007, 12:27 PM) *
I have actually changed the scope of some of my private elements to public to get around it (rather dirty I agree)

Why is it dirty? You want them to be public then make them public. If you don't want them to be public, why are you putting them on the FP of VIs outside of your library? If you want a datatype that keeps its insides private, that's what LabVIEW classes are for. But if you use a typedef, you darn well better have the rights to use *all* of that typedef because all of it is hanging out in the open.

File the bug report if you want, but it'll get closed "Not A Bug." :-)

--------------------
"A VI outside a class is a gun without a safety. Data outside a class is a target."
--- A message from LabVOOP R&D


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
TG
post Feb 16 2007, 06:20 PM
Post #4


Very Active
***

Premium Member
Posts: 173
Joined: 13-June 05
From: Hillsborough, NJ
Member No.: 2402
Using LabVIEW Since:1992
LV:8.2.1 ,7.1.1 ,.
United States Nothing Selected Nothing Selected


QUOTE (Aristos Queue @ Feb 16 2007, 10:22 AM) *
Why is it dirty? You want them to be public then make them public. If you don't want them to be public, why are you putting them on the FP of VIs outside of your library? If you want a datatype that keeps its insides private, that's what LabVIEW classes are for. But if you use a typedef, you darn well better have the rights to use *all* of that typedef because all of it is hanging out in the open.

File the bug report if you want, but it'll get closed "Not A Bug." :-)



Thanks Aristos
Your answer is what I was looking for even if I did not realize it right away.
It not good practice to use a control outside its protection scope anyway.

I just hate realizing that my original design won't hold up as the APP complexity grows.
I need that type definition outside the class so, I'll just make it public and get on with it.
JR

--------------------
NJG88_TG (Il2 1946)


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
Ton
post Feb 17 2007, 01:02 PM
Post #5


CCT It
*****

Premium Member
Posts: 1337
Joined: 13-June 05
From: Woerden, Netherlands
Member No.: 2399
Using LabVIEW Since:2001
LV:8.5.1 ,6.1 ,8.2.1
Netherlands hol_utrecht Nothing Selected My Blog My Gallery


QUOTE (Aristos Queue @ Feb 16 2007, 04:22 PM) *
File the bug report if you want, but it'll get closed "Not A Bug." :-)

Not reported because I realize it is how it is meant to be mad.gif

It is more a convenience issue, we have some GPS lvlib's, where the main datatype is a typedef with 10 or so elements including 4 enum's.
So for a program where I want to build data for the lvlib or display data from the lvlib I set my data-cluster to public. The reason for the public datatype is that it is just a subset of all data we've got (that is about 40 elements, mainly debug). But in order to use the public datatype, all it's enums have to be public also, not really an issue but an inconvience, the structure of the public part of the lvlib grows unnesecarily in size...

So I've decided to just declare all my controls private, making it look more complicated than it is... wacko.gif

Ton

Sorry it turned kinda into a rant post, not meant to be sad.gif

--------------------
Certified LabVIEW Developer
Shouldn't you be programming a Code Repository solution?


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
Tomi Maila
post Feb 17 2007, 06:41 PM
Post #6


Drawing Tool - LVOOP example application
*****

Premium Member
Posts: 1169
Joined: 29-January 06
From: Helsinki
Member No.: 4014
Using LabVIEW Since:2004
LV:8.5.1 ,8.2.1 ,7.1.1
Finland Nothing Selected Nothing Selected My Blog


QUOTE (tcplomp @ Feb 17 2007, 03:02 PM) *
Not reported because I realize it is how it is meant to be mad.gif

It is more a convenience issue...

Ton, I suggest you post NI a change request. Don't request the functionality to change because it will not happen. Request change in the user interface of the LabVIEW development environment. Request that LabVIEW allows user to make all referenced private typedefs public for a public typedef. The same should apply for public VIs, the connector pane of which refers to private typedefs. There simply could be a new option "apply same option to all referenced items", where item means typedefs and classes and referenced means what I explained above.

Tomi

--------------------
Tomi Maila



Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
JFM
post Feb 18 2007, 09:52 AM
Post #7


Extremely Active
****

Member
Posts: 369
Joined: 24-August 06
Member No.: 5958
Using LabVIEW Since:1995
LV:8.5 ,8.2.1 ,7.1.1
Sweden Nothing Selected Nothing Selected


QUOTE (Tomi Maila @ Feb 17 2007, 07:41 PM) *
Ton, I suggest you post NI a change request. Don't request the functionality to change because it will not happen. Request change in the user interface of the LabVIEW development environment. Request that LabVIEW allows user to make all referenced private typedefs public for a public typedef. The same should apply for public VIs, the connector pane of which refers to private typedefs. There simply could be a new option "apply same option to all referenced items", where item means typedefs and classes and referenced means what I explained above.

Tomi

I don't really work with LVOOP yet, but I really think private items should stay private.
If I define something to be private, its because I would like to make sure that a end-user doesn't use this item (shouldn't even be aware of that the private items exist). If the end-user can not access the internal/private parts of the system, then they can be changed without affecting the end-user at all.

Allowing the user to break this "rule", would probably lead to situations where the higher levels in your program needs to be recompiled (or be broken), even though it is only an internal part of a subclass that has changed.

/J

--------------------
Wired but not weird...


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
Ton
post Feb 18 2007, 01:41 PM
Post #8


CCT It
*****

Premium Member
Posts: 1337
Joined: 13-June 05
From: Woerden, Netherlands
Member No.: 2399
Using LabVIEW Since:2001
LV:8.5.1 ,6.1 ,8.2.1
Netherlands hol_utrecht Nothing Selected My Blog My Gallery


QUOTE (JFM @ Feb 18 2007, 10:52 AM) *
I don't really work with LVOOP yet, but I really think private items should stay private.

To be clear this goes for lvlib's (at least my case).

Ton

--------------------
Certified LabVIEW Developer
Shouldn't you be programming a Code Repository solution?


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post

Reply to this topicStart new topic

 




Time is now: 3rd December 2008 - 08:47 AM