LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to dynamically load a vi from an earlier version?

Hi,
 
We have a program that allows the customer to insert his own subvi at specific places. As we don't know (or have) the subvi the customer will use, we load it dynamically.
 
Now it makes sense to me that if our program was written in LV 8.2 that it won't be able to load a vi written in LV 8.5; however, apparently it can't load a vi written on LV 7.1, or even LV 8.0. I get the error:
 
"LabVIEW:  VI version is too early to convert to the current LabVIEW version.
An error occurred loading VI 'vi7testrecomp.vi'.
LabVIEW load error code 10: VI version (8.0) is too old to convert to the current LabVIEW version (8.2.1)."
 
The only solution I found when searching manuals and knowledgebase was that I should open the vi in LV 8.2, run and save it. This means that our customer needs to send us his subvi so that we save it in LV 8.2 and he won't be able to modify it (because he doesn't have LV 8.2, only LV 8.0). This is cumbersome and stupid.
 
Does any one have any ideas? Is there a way I can programatically "upgrade" older version dynamic vi's?
 
Thanks,
Danielle
"Wisdom comes from experience. Experience is often a result of lack of wisdom.”
― Terry Pratchett
0 Kudos
Message 1 of 10
(4,072 Views)
It sounds like you do this in an executable?
I don't think the runtime includes conversion capability. (like you noticed).

Ton
Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 2 of 10
(4,067 Views)

> Now it makes sense to me that if our program was written in LV 8.2 that it
>won't be able to load a vi written in LV 8.5; however, apparently it can't
>load a vi written on LV 7.1, or even LV 8.0. I get the error:

Your program is probably an executable (or else the customer will have
LV8.2), and the run time engine is not capable of recompiling code. For the
same reason, the Linux RTE cannot run windows VI's...

> "LabVIEW:  VI version is too early to convert to the current LabVIEW
>version.
> An error occurred loading VI 'vi7testrecomp.vi'.LabVIEW load error code
>10: VI version (8.0) is too old to convert to the current LabVIEW version
>(8.2.1)."

This message is a bit stupid, but it is true. What it should say is: "We
cannot convert any version to the current LabVIEW version (8.2.1), and the
VI has a different version VI version (8.0)"

> The only solution I found when searching manuals and knowledgebase was
>that I should open the vi in LV 8.2, run and save it. This means that our
>customer needs to send us his subvi so that we save it in LV 8.2 and he
>won't be able to modify it (because he doesn't have LV 8.2, only LV 8.0).
>This is cumbersome and stupid.

You have other options, but none will be ideal (bot are cumbersome and
stupid). E.g. you can:

1) Compile your program in the customers version.
2) Have the customer build a dll of his VI. This dll will use the RTE of his
version.
3) Have your customer upgrade to 8.2.1 (nobody should be allowed to use 8.0
anyway).

> Does any one have any ideas? Is there a way I can programatically
>"upgrade" older version dynamic vi's?

Not without a development version. So an executable will not be
able to do that.

Regards,

Wiebe,


0 Kudos
Message 3 of 10
(4,062 Views)
I recommend the last option of Wiebe. There is a LabVIEW debug license which suits this work.

Ton
Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 4 of 10
(4,050 Views)

Weibe, thanks for your detailed reply, even though it wasn't what I wanted to hear Smiley Sad...

 Is there a way to dynamically load a dll? We had trouble with that before. If there is one, we can try using dlls instead of subvis.

Thanks for all your help,

Danielle

"Wisdom comes from experience. Experience is often a result of lack of wisdom.”
― Terry Pratchett
0 Kudos
Message 5 of 10
(4,047 Views)
Ton,
 
Where can I find out more about the debug license?
 
Thanks,
Danielle
"Wisdom comes from experience. Experience is often a result of lack of wisdom.”
― Terry Pratchett
Message 6 of 10
(4,045 Views)
Hi, Danielle
In general there are two possible ways in case if you don't like to upgrade dynamically loaded VIs to the same version as executable.
For example, we have simple VI written in 7.1.1 named Sin(x)_711.vi, and this VI should be called dynamically from LabVIEW 8.5.1 application.
 
The first possible way in using VI Server:
You need to develop small "Helper application" in the same version as customer's VI:
Your host application looks like this:

 

So, now Sin(x)_711.vi loaded into memory and you can call it from your 8.5.1 application:

In this example VI Server running on Port 1234.

The second way is using DLL as mentioned above:

In your DLL you should have "wrapper" to old version VI (DLL written with same version, of course):

Now you can call this DLL dynamically from LabVIEW 8.5.1:

I have attached example for 7.1.1 / 8.5.1. Sorry, I haven't other versions of LabVIEW at this time on my PC.

Hopefully it helps,
Andrey.

Message 7 of 10
(4,036 Views)
Danielle,

> Weibe, thanks for your detailed reply, even though it wasn't what I wanted
to hear Smiley Sad...

Thought so...

>  Is there a way to dynamically load a dll? We had trouble with that
before. If there is one, we can try using dlls instead of subvis.

Yes there is. In 8.2 it's a lot easier then in 7.1. Create a Call Library
Function Node, and dubble click it to configure it. Specify the prototype
like you'd always do, but in 8.2 there is an option "Specify path on
diagram". If you select it, you can use a path constant or control to
specify which dll to call.

If you also want to specify the function, you need to use windows API's. See
http://forums.ni.com/ni/board/message?board.id=170&thread.id=39381&view=by_date_ascending&page=2 .

Regards,

Wiebe.


0 Kudos
Message 8 of 10
(4,030 Views)
Andrey,

That is very creative. Wouldn't it be somehow possible to open an
application reference to LabVIEW.exe (7.1), and have it call a subVI
dynamically though property nodes?

Regards,

Wiebe.


0 Kudos
Message 9 of 10
(4,016 Views)

Hi, Wiebe,

Of course, you can call VI also from LabVIEW.exe.
First you should start LabVIEW 7.1.1.
Then open VI in the LabVIEW 7.1.1.
Then open reference to LabVIEW 7.1.1, and call SubVI dynamically from application written with 8.5.1.

Andrey.

0 Kudos
Message 10 of 10
(4,005 Views)