03-07-2019 09:01 AM
Hello all,
I manage different versions of CVI and various executables at the same time. So UIR incompatibilities is a problem. Is there a way to tell which version a specific UIR file is ? Either using command line tools (grep, hd...) or writing a small CVI program. Just for memory, here's the list of different UIR versions...
Solved! Go to Solution.
03-08-2019 06:04 PM
Hi gdargaud,
I'm not sure if there is a direct way to tell the version of CVI that was used to create a .uir file. However, you can save your .uir file to a text file by going to Options >> Save in Text Format... and it will save your user interface as a TUI file which can be loaded in and opened in any version of CVI. You can also open .uir files in the version of CVI that it was created in and any newer versions. Does this information help?
Best,
03-11-2019 05:41 AM
Well, I wanted to automate the search, for instance in an SVN repository to avoid having too recent versions commited. Doing a bit of reverse engineering, I found a "UIR Version" string near the end of every UIR file, it seems to be preceded by 6 bytes and a \v separator (0x0b), for instance:
00 13 00 7c 16 81 0e 0b U I R . V e r s i o n
But I can't match a version number with the content of those 6 values.
Anybody knows the structure of UIR files ?
03-17-2019 09:09 AM
This seems like a "secret" that should be public knowledge. Did you have any luck? I wonder if the bytes after that string correlate to the version ...
03-18-2019 04:22 PM
Hi gdargaud,
I recommend that you open a service request with National Instruments so that we can continue looking into this for you! There is not a simple way that I know of to get this information, but we can speak with you directly through the service request to learn more about your application and look into our options.
Open a Service Request with NI
Best,
03-20-2019 07:40 AM
I don't know if it's worth opening a service request or what form it would take (specifications of the UIR binary format !!!). What I did and will probably have to do again regularly: search for all *.uir files, drag and drop them onto an oldish CVI, 3 cases:
- if they open properly, close them
- if they fail with a too recent version, reopen them in CVI 2017 and [Save as] an older version
- if they fail but offer the possibility to try and open anyway, do so and overwrite.
03-20-2019 02:59 PM
Opening a newer version of UIR into an older CVI may cause memory corruption that will permanently damage your UIR when you save it.
Having your user interface files saved in text format will prevent memory corruptions. Plus, opening a newer TUI in an older version of CVI then save it back will prevent damaging the content of the TUI file.
If you still want to have all your user interface files saved as UIR, I recommend saving all you UIR into text format then re-open them in your older version of CVI and save them back as UIRs.
03-21-2019 03:58 AM
@gdargaud ha scritto:
I don't know if it's worth opening a service request or what form it would take (specifications of the UIR binary format !!!). What I did and will probably have to do again regularly: search for all *.uir files, drag and drop them onto an oldish CVI, 3 cases:
- if they open properly, close them
- if they fail with a too recent version, reopen them in CVI 2017 and [Save as] an older version
- if they fail but offer the possibility to try and open anyway, do so and overwrite.
I was wondering if part of the process could be automated by leveraging the ActiveX interface to CVI but it seems that some user interaction is still needed.
Specifically, CVI offers an ActiveX interface with which you can launch the IDE, load a project and perform some tasks on it like for example adding files to a project and/or opening a file in the proper editor. The task could then be reduced to launch the proper version of CVI and try opening one-by-one the UIR files you want to test against it, looking for errors in the process.
A quick attempt made by means of samples\activex\cvi\cvidemo sample project demonstrates that if you try opening a .UIR file newer than the IDE in execution you get the usual "more recent" error message, but unfortunately that error is handled by the instance of CVI you are handling via ActiveX and is not reported back to the caller. CVI_AppAddFileToProject also returns no error nor shows a warning popup in this case so it is of no help. Finally, the instrument does not offer a Save As... command to be used for item #3 in your list.
I just wanted to offer you an alternative way to perform your task but I'm not sure this can help you at all...
03-21-2019 04:37 AM
Razvan, dully noted. Anyway, why are there some many incompatible versions of UIR files ? It's not like new features get added all the time... And even if it were, it should be easy enough to return a warning: "this control style or this property is unknown"...
Roberto, ActiveX is one of the features of CVI (well, Windows programming actually) I've never wanted to delve into. I originally was looking for a way to 'grep' the files from a command line, looking for version numbers inside.
There is a version number at the start of .tui files, but it's always 102 in the hundreds of files I've checked, so it's probably not related to the version of CVI that created it.
04-04-2019 09:09 AM
Because UIR are binary files and because of the way their content is interpreted to creating controls, any new attribute added to any control will make the UIRs containing that control not compatible with an older UIR containing the same control. Because only UIR file has version, and UI controls does not, every new attribute for any control leads to creating a new version for UIR.
I recommend to use TUI files are text based because they cannot cause memory corruptions when loading a newer TUI in an older CVI.