From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

error 1390 (Calling a VI, that was originally copied from a library)

Solved!
Go to solution

error 1390 states: "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 am trying to programatically run a VI i copy, while the original VI is belonging to a library.

Error occures when i try to open the reference by VI address.

 

Obviously, after copy, the VI is still belonging to a library, therefore there is an invoke node to disconnect it from library before running, but im unable to acquire the reference in the first place.

 

I should note that removing the source VI from a library is not an option at this point.

 

In this topic was a similar error, back from 2009, but a solution was never posted.

http://forums.ni.com/t5/LabVIEW/Creating-VI-file-programmatically-still-owned-by-LVLIB/m-p/863050

 

What is preventing the reference from being acquired? and is there a workaround?

________________________________________________________________________
"When I need the side of a building to view all the code..." -Mark Yedinak
"...when you need a navigation window to view the navigation window..." -Jeff Bohrer
0 Kudos
Message 1 of 8
(3,586 Views)

@UFOslava wrote:

[..]I should note that removing the source VI from a library is not an option at this point.[..]


"source VI" refers to the original VI in the library or does it refer to the copy you created?

Either way, i suggest to remove the copy from the library since it seems the easiest solution for the issue....

 

Norbert 

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 2 of 8
(3,579 Views)

I've got a present. Its the piece of code that causing the problem.

 

"Source VI" i refered to is the VI that being copied and is a part of a library.

"Target VI" is the copied VI, that i try to run programatically.

 

The .rar i attached includes a piece of project that causing the error. The project is based around several libraries, containing VIs with matching names among libraries. I am required to copy them to a new location and to run them. I am unable to add all of them into project because of the matching names. Only solution is libraries.

Now, ever since i use the libraries (instead of files outside of the project), I am unable to copy and run them.

 

To reproduce the error, just run the "Run me.vi" in the project. It will attempt to copy a VI that is a part of a library, and open its reference. Upon opening the reference the error #1390 will be generated.

Is there a way to work around this?

________________________________________________________________________
"When I need the side of a building to view all the code..." -Mark Yedinak
"...when you need a navigation window to view the navigation window..." -Jeff Bohrer
Download All
0 Kudos
Message 3 of 8
(3,574 Views)

Only 3 attachments per message...

Here are the rest.

________________________________________________________________________
"When I need the side of a building to view all the code..." -Mark Yedinak
"...when you need a navigation window to view the navigation window..." -Jeff Bohrer
0 Kudos
Message 4 of 8
(3,570 Views)
Solution
Accepted by topic author UFOslava

Your approach is the reason for failing. You simply copy a VI out of context, but do not update anything else.

You have to duplicate the whole lvlib:

duplicate lvlib.PNG

or you have to manage the new copy within the existing lvlib:

addItem lvlib.PNG 

 

hope this helps,

Norbert 

 

 

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Message 5 of 8
(3,568 Views)

The piece of code i provided is incomplete. I tried to use the method to remove the VI from the lib, but couldnt acquire a reference in the first place.

 

About your examples, how do i acquire a library reference?

Managing my library from within labview may just be a solution...

________________________________________________________________________
"When I need the side of a building to view all the code..." -Mark Yedinak
"...when you need a navigation window to view the navigation window..." -Jeff Bohrer
0 Kudos
Message 6 of 8
(3,565 Views)

You can use VI Server to load the library.

 

Norbert 

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 7 of 8
(3,561 Views)

After playing around with property nodes i've got a solution...

 

The VI seems to run ok if you save it via LabView property nodes and not via plain file copy. Then, i "befriended" the new copied VI with the original library, so it could use its contents (not sure if necesary). The whole thing seems to work ok.

 

Thanks for all your help.

 

Adding the solution VI and a screenshot.

________________________________________________________________________
"When I need the side of a building to view all the code..." -Mark Yedinak
"...when you need a navigation window to view the navigation window..." -Jeff Bohrer
Download All
0 Kudos
Message 8 of 8
(3,546 Views)