Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

iid file structure in IMAQ 4.0 changed

I have LabVIEW based applications that use the iid files in order to determine (and change) the active icd file being used.  The new version of IMAQ 4.0 has caused my applications to not be compatible with the IMAQ 4.0 because it is incorrectly parsing the iid files (see attached files).  The strange thing is that the header of the iid files says that the type and the version are the same (Type=1, Version=15) even though they are not the same structure.  This makes it difficult to determine the expected structure of the iid files.  Is this a bug (that will be fixed)?

Sidenote, fortunately I locate the IMAQ\Data dir using a registry call so it still finds the correct IMAQ\Data location (IMAQ 4.0 iid and icd files are now in the C:\Documents and Settings\All Users\Documents\National Instruments\NI-IMAQ\Data dir).

Bruce

P.S.  Why can't I attach iid files?  It gives a invalid file extension for an attachment error.

Download All
0 Kudos
Message 1 of 7
(2,595 Views)
Hi BruceMoyer,
I'm actually seeing the same thing on my system.

I have IMAQ 4.0.0 installed on my system (from Vision Acquisition Software 8.5.1) and my default IID file for my PCI-1409 looks like your old file. However, when I right-clicked my interface in MAX and chose "Save As", the new IID file it generated had the same format as your new file. I'm not sure why they're like that, but I imagine the format is flexible enough to allow both types of inputs (i.e., the stuff the "old" file doesn't have is all optional). I don't think this is a bug, but I can look into it.

Since all the major headers for the file are enclosed by square brackets, like [NIIMAQ_HEADER], is it possible for you to only read what you expect to find from the old format and then skip to the next header and read what you are expecting there?
0 Kudos
Message 2 of 7
(2,567 Views)
Vijay,
 
Thanks for taking a look at this.  This isn't a major hurdle for me to overcome in software, it just makes it difficult for people/customers who are trying to use my application because when they go to IMAQ 4.0 the application stops working.  I'm currently in the process of making the fixes to be able to handle the file format change (my previous versions used a ini file parser to automatically put all of the iid file data into a cluster and these extra lines confuses it, causing an error).  My new version will probably specifically ask for all info in the iid file to build the cluster (I also need to modify the values and then write them back to the iid file).   If you have a better way to modify iid files please let me know.
 
Thanks,
Bruce
0 Kudos
Message 3 of 7
(2,559 Views)
Hello Bruce,

This is actually a known issue for the IMAQ 4.0 driver. The interface files are made up of headers (single word on a line) and key/value pairs (two "words" seperated by '='). IMAQ 4.0 has a bug where it misinterprets key/value pairs with empty strings (such as Channel0 = "") as headers (such as [PORT0]).  The side affect of this is that everytime you switch interface files it will save the new "headers" down.  You'll notice that the keys with empty strings now appear on their own lines without values (since they've been mis-interpreted as headers instead of a key/value pair).

Fortunately this doesn't effect the functionality of interface files for the average user because the extra sections are effectively ignored.

The expected format of the iid file is the old style that you attached.  I hope the explanation of the problem helps your parsing.  As far as limiting the changes to your parsing here's what I would suggest:
Write a pre-parsing step that destroys the extra sections in the interface files. 
Our format goes [header]\nkey=value\n\n[header], etc. 
I would look for a [header], find the first empty line (\n and that's it), delete every line that follows until another [header] is found. 
This will remove the sections so that your current ini parser will work.

That's just my suggestion to allow you to use your current ini parser and reduce your code churn/risk. Going forward this issue will be fixed and in practice you'll only be deleting sections from IMAQ 4.0 interface files.

If you ever generate interface files, stick to the old format and everything will still work as expected.

This issue is fixed in our current development builds and will be included in our next release, IMAQ 4.1.

Thanks,
Ryan F.
0 Kudos
Message 4 of 7
(2,545 Views)

Thanks for the info, I'll try to implement these suggestions, but I guess until my new version or IMAQ 4.1 gets released, I'll have to have our customers avoid using IMAQ 4.0 with this software.

Thanks,

Bruce M.

0 Kudos
Message 5 of 7
(2,539 Views)
Ryan,
 
Here's a VI that implements your suggestions.  As long as the user doesn't put extra linefeeds in the iid file I should be fine.
 
Bruce
0 Kudos
Message 6 of 7
(2,515 Views)
Bruce,

Looks great!
I think it's a low chance that anyone would put extra linefeeds in the iid files.  It's not a common use-case to manually edit interface files.

Thanks for posting your solution here to help other people with this question.

Ryan F.
0 Kudos
Message 7 of 7
(2,509 Views)