10-19-2009 10:44 AM
I am using the IMAQ C API in the program I am writing. I would like to enable users to modify camera attributes from my program rather than through MAX. To do this I understand that I will have to parse the IID file to determine which camera file is being used with that interface and port (which should be very easy), and then I'll need to parse the ICD file to know what attributes are available and their associated names, ranged, etc, and the associated serial command. While not impossible, parsing the ICD is not trivial due nesting and other issues.
Has anyone written a parser for these files? This seems like something the IMAQ API should expose but unfortunately it doesn't.
Thanks,
-Josh
10-20-2009 03:18 AM
Hi, Josh,
In general you don't need to deal with *.icd files, because you can Get/Set camera attributes with IMAQ C API as well:
Only few attributes (for example, bit depth) can't be set through API, so you will need to modify it direct in icd, but its very rare case.
Andrey.
10-20-2009 07:01 AM - edited 10-20-2009 07:06 AM
Thank you Andrey for that information. Unfortunately I want to do something more complicated. I have several cameras that use the Camera Link serial interface for setting various camera attributes such as integration time, polarity, test patterns, trigger mode/source, analog video(zoom, row/column start), time stamping, and many others. Each of these have their own Attribute tag in the ICD file. I need to read the attribute name, the type (list, integer), the various options or integer min/max/increment, and most importantly the associated serial command contained in the Action(Serial) tag. Below is an example attribute from my ICD file.
Attribute (Polarity) {
Value (List) {
Name (White hot) {
Action (Serial) {
Command (POLARITY:WHITEHOT\r)
Response ()
}
}
Name (Black hot) {
Action (Serial) {
Command (POLARITY:BLACKHOT\r)
Response ()
}
}
Default (White hot)
Current (White hot)
}
}
Edit: An important fact I neglected to emphasize is that at run-time I do not know what attributes are available. Some cameras might not have any attributes, at other times the user may wish to add a new attribute/serial command to the ICD using Camera File Generator, restart my program, and then adjust the attributes during execution. Also, I believe the imgGetAttribute and imgSetAttribute functions don't work with arbitrary manufacturer defined camera attributes,but only the Analog/Color/Device/Image/Session/Status attributes defined in the help file, enums prefixed with IMG_ATTR_*.