LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Programatically modify camera file

Hi,
I'm using a camera under IMAQdx (I've assumed IMAQ is largely obsolete - at least for new development), and I'm having trouble with programatically modifying the camera file.
 
I've dug up some examples on how this is done here: http://sine.ni.com/devzone/cda/epd/p/id/1212
but they seem to be a bit obsolete, and certainly full of errors in pathnames and file formats.
 
I know my camera and interface files exist at  ..\Documents and Settings\All Users\Documents\National Instruments\NI-IMAQdx\data
 
I have this specific question:
How do you locate the camera files using registry keys? 
The keys for IMAQdx reference an NIIMAQPATH which is somewhere in Program Files - not correct. The keys for "IMAQ for Windows 95/NT" (used in the old examples) reference an NIIMAQPATH which points to the IMAQ data, rather than the IMAQdx data. So none of the registry keys is completely useful for IMAQdx camera data.
 
How does MAX get to the config files?
I'm really hoping nobody's going to ask me to use a hardcoded path, as that is a recipe for disaster on installed systems - which leads me to another question:
How does all this get set up when you package the application?  I've been assuming the packaging will include the same registry keys, and the same camera file locations. Pretty hard to develop applications if this is not the case.
 
Does anybody have any more up-to-date help on this stuff? I'm finding it quite frustrating that something so necessary is so hard to find here  😞
 
regards,
RichLamb
0 Kudos
Message 1 of 5
(3,630 Views)
Dear RichLamb,

The NI-IMAQ driver and the NI-IMAQdx driver are both current drivers. NI-IMAQ is the driver used for all of our framegrabbers (CameraLink, parallel digital, analog), while IMAQdx is the driver for interfacing to FireWire (IEEE 1394) or GigE cameras. Both of these drivers are packaged together in the same download under the name Vision Acquisition Software:

Vision Acquisition Software 8.6 - Windows 2000/Vista x64/Vista x86/XP
http://joule.ni.com/nidu/cds/view/p/id/1099/lang/en

What type of camera are you using?

Normally people do not modify the camera file used with the IMAQdx driver because the camera files are supplied by the FireWire or GigE Vision camera firmware upon plugging the camera in. Once the camera file is loaded from the camera, the user typically modifies parameters specified in the camera file for that particular camera session using property nodes in LabVIEW, or read and write attribute methods in supported text based languages.

If you have a camera that uses the IMAQ driver, then the type of camera file and reasons for modifying it will be different depending on what camera bus you are using (CameraLink, parallel digital, analog).

Either way, most applications can be written such that you only modify attributes already exposed in the camera file. Why are you looking to programmatically modify a camera file, and by using registry keys?

The camera files used by National Instruments drivers used to be located in the Program Files»National Instruments»... directory prior to Vision Acquisition Software version 8.2.3. It was moved to the Documents and Settings»All Users»Shared Documents»... directory to allow all Windows user accounts to access the files. You can see more details on the exact paths here:

Where Do I Place My Camera File Once I Download It?
http://digital.ni.com/public.nsf/allkb/FDA97BE2452830CF86256DBA007A70D8?OpenDocument

When you packages vision applications, the required IMAQ driver (and thus MAX as well) are packaged with it, and then you just reference a camera interface (cam0, cam1, ect...) in your application. This camera interface will be specified in the camera interface file (.iid file). You can find more on the specifics of how the driver uses the .iid and .icd files from the IMAQ and IMAQdx help files.

Best Regards,

~Nate


Message 2 of 5
(3,604 Views)

To clarify, I use a GigE camera (Prosilica GC1350) so I understand from what you say that IMAQdx applies to me rather than IMAQ.

There's no mystery as to where my camera file resides: I know where it is. I'm trying to find where it is via the installation data (registry keys) but none of these point to the right place. NI provides examples of how to use the registry keys to find and modify the camera file, but they do not seem to apply to IMAQdx.

As to why? I'm using a separate application to configure camera attributes and video metrics - these updates must persist and so it's perfectly reasonable to update the camera file which is where NI designed them to live. The alternative is that I create my own config file, write values in there from the configuration app, read them out again in the main app and then apply them. A very messy long way to duplicate the NI functionality.

If the NI functionality was complete I would happily use it. I'm beginning to think it's a bit rough-and-ready but I didn't want to assume that.

The simplest way to fix it is to write a registry hack that corrects the path to the camera file, and install this with the application. It's ugly, but as I say, the NI functionality does not appear to be very polished so I have no choice (?)

regards,

RichLamb

0 Kudos
Message 3 of 5
(3,590 Views)
Dear RichLamb,

I was able to find the registry keys pointing to the data folder where the IMAQdx camera files reside. The 3 locations were:

HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\niimaqdxk\Parameters
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet003\Services\niimaqdxk\Parameters

and I think more importantly:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\niimaqdxk\Parameters

NOTE for all viewers:
I strongly recommend backing up your registry before making any changes.

You are correct that IMAQdx does not provide extensive low-level access to make permanent modifications to camera files. The driver includes the ability to write and read camera file parameters for a specific camera session, but they are not saved beyond that sessions existance. Here is the explaination given in the IMAQdx Help:

"NI-IMAQdx supports the GigE Vision 1.0 specification and the IEEE 1394 Trade Association IIDC 1.31 register specification for industrial cameras. Most of the intricacies of register-level programming are abstracted by the driver. The driver is responsible for manipulating camera features and activating/deactivating the video data stream.

Some cameras implement additional registers that are not contained in the IIDC 1.31 or GigE Vision 1.0 specifications. These advanced camera features are not natively supported by the camera driver. To use these advanced features, you must use the low-level, register-level access tools to communicate with the camera."

The NI-IMAQdx software provides the following register-level primitives.
  • Read Register—Reads 32-bits of data from a specified memory location.
  • Write Register—Writes 32-bits of data to a specified memory location.
  • Read Memory—Reads an array of bytes from a specified memory location and range.
  • Write Memory—Writes an array of bytes to a specified memory location.
I hope this information helps,

~Nate

Message 4 of 5
(3,567 Views)

Thanks Nate; that registry key will do the trick for me.

For reference, I'm definitely not planning on doing any register-level programming in the camera. I'm more than happy to use the MAX configurator and it's system of configuration data logged in files - just that it needs to be clarified (by NI) how it is implemented and how to interface to it. What exists currently is a bit messy and inconsistent, and the only examples are misleading.

The unique camera data is saved in the camera files - there's no real need to go to register-level that I can see. It's also explained in the help under how the attributes are modified in LabVIEW: you use a property node and supply the name of the attribute as well as the value; since cameras have distinct properties that cannot reasonably be coded into the property nodes. This works pretty well.

(or perhaps they could; if the LabVIEW implementation was to read an xml configuration file for the camera in question - but I digress).

0 Kudos
Message 5 of 5
(3,556 Views)