LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Open VI reference to private scoped VI, Error 1390

Solved!
Go to solution

Hi all,

 

I am running into a problem trying to open a VI reference to a private scoped VI.  I get error 1390 stating:

"You attempted to open a VI Server reference to an out-of-scope VI. A VI can open VI Server references only to other VIs that it could call as subVIs. After the reference is opened, that VI can return the reference to other VIs that could not normally open the reference."

 

I find this odd because the open VI reference function, it's caller, and the private VI I am attempting to access are all apart of the same class.  What is more interesting is that I can replace the open VI reference function with the private VI, and LabVIEW does not throw any error.

 

I have attached an example of what I am talking about.  Can anyone explain why this is happening?  I have not been able to find any documentation that validates this behavior.

0 Kudos
Message 1 of 3
(230 Views)
Solution
Accepted by topic author yourfavoriteproperty

Your VI "String Autocomplete.lvlib:String Autocomplete.lvclass:Create.vi" is inlined, so when opening the reference to the private VI, it is as if the caller VI (Example.vi) opened it, which is forbidden. Make it not inline and it will work.

 

The difference of treatment compared to calling the private VI statically is because otherwise you could basically open a reference and call any private VI from any scope, which would break the encapsulation principle.

 

You could still open a private VI reference from a class method and give it away outside of the class, but then it would be an intentional class design choice.

 

Regards,

Raphaël.

Message 2 of 3
(208 Views)

Ahh, that makes sense, and also would have never occurred to me.

 

I made a number of modifications to my original code before uploading it here.  Create.vi was originally a malleable VI, that is why it is inlined.  It looks like I will need to find a workaround for that, but at least I know what the problem is now.

 

Thank you!

0 Kudos
Message 3 of 3
(190 Views)