04-04-2019 10:29 AM - edited 04-04-2019 10:58 AM
The answer is in the 39th and 40th bytes of the UIR file.
I created a blank user interface, saved it in various UIR formats, and ran Beyond Compare on the resulting files. These two bytes contain two ASCII digits that store a version number code:
32 33 = "23" = 2017
32 32 = "22" = 2013-2015
32 31 = "21" = 2012
32 30 = "20" = 2010
31 39 = "19" = 2009
31 38 = "18" = 8.5/9.0
31 37 = "17" = 8.0/8.1
31 36 = "16" = 7.1
A version code lower than 16 will cause the type to display as "Unknown UIR version" when the file is opened in CVI.
I've tested this with some of my existing UIR files from various projects and the pattern has held.
Just to be certain, I took one of my older UIR files and edited the code to "25". Sure enough, when I tried opening it I got an error message saying that the UIR file's version was newer than the CVI that I was running.
04-05-2019 04:22 AM - edited 04-05-2019 04:44 AM
Nice bit of sleuthing...
If you want to write a SVN hook or some such, you can use this to extract the 2 bytes with the version number:
dd bs=1 skip=38 count=2 status=none if=MyInterface.uir
And the following to obtain the version of CVI in a script:
dd bs=1 skip=38 count=2 status=none if=MyInterface.uir | sed -e "s/16/7.1/" -e "s/17/8.0-8.1/" -e "s/18/8.5-9.0/" -e "s/20/2010/" -e "s/19/2009/" -e "s/21/2012/" -e "s/22/2013-2015/" -e "s/23/2017/u
For instance the following will check and refuse a commit:
UIRS="IntA.uir IntB.uir IntC.uir IntD.uir" # UIRS="*.uir" # Use them all for i in $UIRS # Check version number of UIR files do V=$(dd bs=1 skip=38 count=2 status=none if="$i") VV=$(echo $V | sed -e "s/16/7.1/" -e "s/17/8.0-8.1/" -e "s/18/8.5-9.0/" -e "s/20/2010/" -e "s/19/2009/" -e "s/21/2012/" -e "s/22/2013-2015/" -e "s/23/2017/") if [ $V -gt 22 ]; then echo "Version number of $i ($VV) is TOO RECENT for Linux version (v2013 only): re-save, recompile and re-update" exit 1 fi done
04-05-2019 10:15 AM
If someone is interested, I tried with some old UIR files created with CVI 6 and I saw that 39th and 40th bytes are 31 35.
This should be "15" and I can successuflly open them with newer CVI (up to 2017).
With newer CVI it's impossible to save UIR files in a format older than 7.1 (but I can open them).
02-27-2023 01:40 PM
Confirmed - the feature is also present in LabWindows 2020.
32 34 = "24" = 2020
32 33 = "23" = 2017-2019
32 32 = "22" = 2013-2015
32 31 = "21" = 2012
32 30 = "20" = 2010
31 39 = "19" = 2009
31 38 = "18" = 8.5/9.0
31 37 = "17" = 8.0/8.1
31 36 = "16" = 7.1
31 35 = "15" = 6