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: 

Extract revision number from dynamically loaded .vi file using build LV .exe?

I am developing a testing framework, where the end-user will load .vi files dynamically (which perform the individual tests), thus being able to provide the end-user with new or updated tests .vi's.

 

I'd like to know which revision/version of a test .vi my end-users are using. Using the filedate/time of the .vi is not really an option, as these files are transferred by e-mail and this information gets lost when users save them to disk.

 

In the development environment I can use the 'revision number' property of the loaded test vi's (from: History -> Revision) , but retreiving this property of dynamically loaded .vi's doesn't worn when I have build my framework into an executable. (a '0' is shown instead of the revision number)

(See also: http://digital.ni.com/public.nsf/allkb/7F32386DC8E6150586256F4700648F19 )

The solution presented here (storing version information in an external file) doesn't meet my demands.

 

-Are there any other ways to read this "revision number" from a .vi file, that -do- work from run-time?

 

-If not: is there a specification of how this information is stored in .vi files, so I can extract it out the .vi myself?

(I've noticed the version byte/word is not consistently at the same offset in the .vi file)


0 Kudos
Message 1 of 14
(3,308 Views)

In the attached file I have created a Vi that extracts the file info using the appropriate Window's API. I usually use it with a exe file but if you are able to write the correct meta information into vi file I think it will be able to work also with the vi extention.

Try to use it and give me back your thoughs.

Ricky
Italian Developer engineer
www.www.selt-sistemi.com
0 Kudos
Message 2 of 14
(3,304 Views)

Hi Riccardo,

 

I'm at LV 2009 at the moment, cannot open the file here so I haven't yet checked it.

 

Will this extract the revision number from the vi or will it look at the file date/time (which, as i've stated won't work the way I need it to)?

0 Kudos
Message 3 of 14
(3,299 Views)

I'm sorry, here the LV2009 version.

 

Yes the VI is able to extract the Version of the file and also other information such as the owner, the company ond so on.

Ricky
Italian Developer engineer
www.www.selt-sistemi.com
0 Kudos
Message 4 of 14
(3,296 Views)

Hi,

 

I've tried your solution but unfortunately this doesn't return the .vi revision number.

It does return metadata for .exe files, but it cannot handle .vi files, as the format of this file is not native to Windows.

 

0 Kudos
Message 5 of 14
(3,291 Views)

 

Try this one.  it uses a property node to access the History >> Revision property.

Visualize the Solution

CLA

LabVIEW, LabVIEW FPGA
0 Kudos
Message 6 of 14
(3,282 Views)

You are using the right function (History>Revision Number) as I am using,

but it returns 0 for any .vi when this code is run as an .EXE (as described in my first post)

 

If you are running 2010 and .exe files made with this version work differently, please let me know.

0 Kudos
Message 7 of 14
(3,272 Views)

I have provided an example that (when you load a .vi) shows my issue:

-the History:Revision Number when run from within LabVIEW developing environment

- ' 0 '    when you create an .exe out of it.

0 Kudos
Message 8 of 14
(3,266 Views)

You could place a hidden control to hold the revision number. Then use aproperty mode to get the value dynamically.

Manually update the value and save as default then save the .vi. With a little work you could automate this to progammatically update the revision number.

 

Run Get Revision.vi and point to Revision Test.vi

Visualize the Solution

CLA

LabVIEW, LabVIEW FPGA
Download All
0 Kudos
Message 9 of 14
(3,260 Views)

Well, I did two functions that save and read the revision number of the VI file into the summary properties of the file. As everybody knows you can see the summary properties by clicking the file with the right button of the mouse and selecting the properties option menu, then selecting the summary tabs. Be carefull, before using the functions I did you have to download the DSOFile ActiveX control that is necessary to do the work.

Specifically I save the revision of a VI into the comments field of the summary properties. This because you can't access to every properties in a write mode.

 

Attached the two functions you need to solve your problems!

Keep me informed!

 

Here you can find more information about the ActiveX and you can also download it:

 http://support.microsoft.com/kb/224351

Ricky
Italian Developer engineer
www.www.selt-sistemi.com
Download All
0 Kudos
Message 10 of 14
(3,242 Views)