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)
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)
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.
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)?
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.
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.
Try this one. it uses a property node to access the History >> Revision property.
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.
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.
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
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: