LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Access Scope of Library

Solved!
Go to solution

As much as I hate to take your thread off topic, you appear to have an answer so...

 

Can someone explain access scope of a library?  

 

Generally what, how, and why is it?

 

Why is this or that "public" or "private" and what does that mean? 

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 11 of 12
(81 Views)

@RTSLVU wrote:

Can someone explain access scope of a library?  

 

Generally what, how, and why is it?

 

Why is this or that "public" or "private" and what does that mean? 


Private: Only other items in the library can access it

Public: Anybody can access it

 

It works the same for libraries as it does for VIs and controls.  If a library is private, only items inside of the parent library can access it.  A library cannot be a top level and set its scope.  For example, we have top level library Parent.  It has children libraries A and B.  If A has a VI inside of it set to private, only items in A can access it.  If A is set to private, then B can still access all of the public (relative to A) VIs inside of A, but C (not being inside of Parent) cannot access anything from A.

 

I recently did this with classes as I wanted some encapsulation for 3 parts of the library, but didn't want anybody outside of the library to be able to access those classes.  Those classes are specific to a QMH inside of the library.  So Driver.lib has classes A.lvclass, B.lvclass, and C.lvclass set to private with a bunch of API VIs that are public to command the QMH to do something with those classes.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 12 of 12
(77 Views)