LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I programmatically determine what version a VI was saved in?

I need to programmatically determine what version a VI was written in or saved in. For example I would like to upgrade to LabVIEW 7.0, however, my customers only have LV 6.1. There are several tools that I want to use in LV 7.0 then save my VIs down to 6.1 before I ship the application(VIs, not exe) to my customer. As I am sure you are aware of having multiple versions of LV on your computer that it can be a headache trying to determine if the VI was saved in LV 6.1 or 7.0.
I want to create a tool that will scan a directory and tell me what version the VIs are saved, so that I can confidently ship my application to my LV 6.1 customer.

I don't use the application builder, but send the VIs with
locked diagrams.

Thank you for your help.
0 Kudos
Message 1 of 13
(4,412 Views)
Although LabVIEW seems to know what version it was previously in, (it shows this information when you close a VI without saving and it promts you to save, you can click 'Explain' and it says it was in a previous version and what that version was) I don't think you can get that previous version number through a property node or any other means.

One way you might be able to it would be to actually open the VI, then check the VI property "Modifications>VI Modifications Bitset" property. If the output of this property is zero, then no changes have been made to the VI, so that would indicate that it is saved in whatever version you are running the tool in. If this number is anything other than zero, then something in the VI has changed. Unfortuately, you w
on't know for sure what has changed. It could be recompiled due to a version change, or it may have found a sub-vi in a different place. You would then have to open the VI and look for yourself.

It's not exactly what you want, but it might get you close.

Ed


Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
Message 2 of 13
(4,411 Views)
Each bit in the Modification Bitset has a meaning. Surely one can figure which bit is related to the upgrade from a previous version...

If the VI is in a LLB, Librarian Get Info.vi can return the LabVIEW version of the VI (or is it the LabVIEW version that last saved in the LLB?)


LabVIEW, C'est LabVIEW

Message 3 of 13
(4,412 Views)
Good thinking.

After a bit of experimenting, my best guess would be bits 4 and 5 of the number indicate a version change and recomile, and I think bit 4 is the one for a version change.

Maybe somebody at NI could verify/correct this, or at least point to some documentation on the mod bitset property.


Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
Message 4 of 13
(4,419 Views)
Hi,
I have attached an llb that allows you to decode the Modification Bitset Properties of a VI

I hope this helps.

Sincerely,
Feroz
National Instruments
Message 5 of 13
(4,419 Views)
I was able to play with the modification bit set and found that
bit 1 was Front Panel modification
Bit 2 was Block Diagram modification
Bit 3 was conversion from previous version of LV
Bit 6 was VI was recompiled
Bit 7 was SubVI call was modified

I was not able to open your library since I don't have LV 7.0 yet.
0 Kudos
Message 6 of 13
(4,419 Views)
I am very surprised that the LabVIEW version of a VI cannot be reached with a simple propery node. This seems like a very desirable information parameter.

Just peeking inside a vi file, I found that a few bytes at offset 44 show a relatively strong correlation with LabVIEW version back to 6.1 on all VIs I have made. On some rare VIs picked up here on this board, the pattern does not match (my wild guess is either foreign version, student version, evaluation version, or similar, but who knows).

I have attached a demo (LabVIEW 7.0). Maybe some of you can get a few more measuring points to verify. Maybe I am way off with this idea. 😉
Message 7 of 13
(4,419 Views)
Thanks Feroz. Nice little tool.

Did versions before 7.0 have a different mod bitset, or can I use docmod descriptions.vi subvi to build a tool for 6.1 and earlier versions.

Ed


Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
0 Kudos
Message 8 of 13
(4,419 Views)
altenbach wrote:

> I am very surprised that the LabVIEW version of a VI cannot be reached
> with a simple propery node. This seems like a very desirable
> information parameter.

No real surprise! When you open the VI refnum the VI is loaded and if
not in the current version it is converted and recompiled so it will
always have the same version as the LabVIEW version you are using.

> Just peeking inside a vi file, I found that a few bytes at offset 44
> show a relatively strong correlation with LabVIEW version back to 6.1
> on all VIs I have made. On some rare VIs picked up here on this board,
> the pattern does not match (my wild guess is either foreign version,
> student version, evaluation version, or similar, but who knows).

Knowing a little about
the LabVIEW resource file format, it is a highly
unreliable method. The differnt parts of LabVIEW VIs are saved in resource
lists similar to the way the Macintosh used to manage resources and offsets
into a file really tell nothing. It may be quite the same for a certain
LabVIEW version and newly created VIs, but it will change greately between
version and a lot of things can change the actual offsets.

Rolf Kalbermatter
Rolf Kalbermatter
My Blog
0 Kudos
Message 9 of 13
(4,217 Views)
As mentioned by others, looking at the "current changes" in any VI just opened, it shows:

(a) The fact that it was converted, e.g.:
"VI converted from a different version of LabVIEW"

(b) What the previous version was, e.g.
"The VI, last saved with LabVIEW 6.1, has been converted to version 7.0."

Obviously, information (b) is readily available internally. For completeness, it should be available programmatically, exposed via a VI property. For me, it's a "surprise" that it's not. 😉

In can think of many uses for this, especially for code maintenance, e.g.:

-- A tool that quickly shows name, last saved version, revision number, etc. of all VIs in memory.
-- A tool that searches a file system for duplicates, then lists them as
above.
-- A masscompiler that does not touch VIs that are more than one versions older than the current release.
-- etc.

I agree that the method I showed is probably flawed, but it would be nice to be able to write a little tool such as this without the need for jumps through flaming hoops.

--------------------------

Back to the original question of this thread. For future projects, I would recommend to just arrange the VIs into folders where the name contains a clue to the LabVIEW version, e.g.

/../customer1/application2/6.1/...

Remember, since the customer has his own LabVIEW version in this particluar scenario, he might independently upgrade for reasons unrelated to your application.
0 Kudos
Message 10 of 13
(4,217 Views)