Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

IMAQdx problem with camera attibute

I just upgraded to IMAQdx for my prosilica EC650 firewire camera, and I am having problems with the new way to change the camera parameters using the property node.  I am attaching an example that shows my problem.  If I take out the property node it takes a picture just fine.  If I try to read or write a camera attribute such as gain it says:
 
Error -1074360305 occurred at Property Node (arg 2) in IMAQdx attribute problem.vi
 
Possible reason(s):
NI-IMAQdx: (Hex 0xBFF6900F) Attribute not supported by the camera. 
 
I tried Brightness atribute and it gives the same error.  I am able to change the attributes using MAX.  I tried to follow the example in the RELEASE NOTES NI Vision Acquistion Software PDF file.  Can anyone see what the problem is?  I liked they way IEEE 1394 driver has the enumerated list of attributes so I could see what their was available, is their a way to do this instead of using a string every time?  Also is their a labview VI example for the way Event structures are used with IMAQdx?  I used occurances before to see if the frame was done, and I am not very familier using event structures?  Thanks in advance for any help.
 
Kevin Baker
0 Kudos
Message 1 of 9
(7,379 Views)
Kevin--

      I'll go ahead and look into this a bit and see if I can figure anything out.  Expect a reply on this thread either later today or tommorow morning.  Thanks.

-John H
Applications Engineer
National Instruments
http://www.ni.com/support
0 Kudos
Message 2 of 9
(7,352 Views)
Kevin

Instead of using string "Gain", try using "Gain::Value" or "CameraAttributes::Gain::Value". As shown in MAX, each FireWire camera attribute has a current Value and Mode. So for Gain, the following strings are recommended:

CameraAttributes::Gain::Mode
CameraAttributes::Gain::Value

This new method of using strings instead of enum ring is necessary to provide support for GigE Vision cameras. GigE Vision cameras may contain dynamic attributes that are not known at design time time. You can obtain a complete list of the supported active attribute strings using IMAQdx Enumerate Attributes.vi. See the Grab and Attributes Setup.vi example shipping with NI-IMAQdx for complete usage demonstration.

Regarding the event structure usage, see Low-Level Grab Async.vi example. The example waits for a FrameDone event before copying and displaying the image.

Hope this helps,

Johann









0 Kudos
Message 3 of 9
(7,339 Views)
 

Thanks Johann.  Someone should replace that string in the release notes PDF file with "CameraAttributes::Brightness::Value", instead of just Brightness.  It looked like that just "Brightness:Value" would work also.  I downloaded the IMAQdx from http://digital.ni.com/softlib.nsf/websearch/161B95F09A55347F862571EF00549358?opendocument&node=132060_US, and it should be registered since we have a site licence.  I can't seem to find the have the  Low-Level Grab Async.vi example, or the Grab and Attributes Setup.vi.  I can find an .exe file @ this location: C:\Program Files\National Instruments\NI-IMAQdx\Examples\MSVC\Low-Level Grab Async?  Thanks again.

Kevin Baker

0 Kudos
Message 4 of 9
(7,326 Views)

Kevin

The LabVIEW examples are installed into the following library:

C:\Program Files\National Instruments\LabVIEW 8.2\examples\IMAQ\IMAQdx Examples.llb

Open the examples directly or use the Example Finder to locate the examples.

Johann

0 Kudos
Message 5 of 9
(7,322 Views)
I have problem with attributes also. But in CVI.
the function:
IMAQdxGetAttribute (sessionID, IMAQdxAttributeVendorName, IMAQdxValueTypeString, Vendor);

will stop the program with FATAL RUN-TIME ERROR:
The program has caused a 'General protection' fault at 00B1:7C9378AE.

The same situation is with getting attribute "Shutter::Mode".
But with the commands:
IMAQdxSetAttribute (sessionID, "Shutter::Mode", IMAQdxValueTypeString, "Relative");
IMAQdxSetAttribute (sessionID, "Shutter::Value", IMAQdxValueTypeU32, ES);

I can set both parameters.

Where can I find solution of this problem?

0 Kudos
Message 6 of 9
(7,225 Views)
I forgot to write, that it is possible to get non/string attributes (such as Serial Number or "Shutter::Value") but all of string attributes which I tested make problems.
0 Kudos
Message 7 of 9
(7,222 Views)

What does your Vendor variable look like? Based on your code, I would expect the following snippet to work:

char Vendor[IMAQDX_MAX_API_STRING_LENGTH];
IMAQdxGetAttribute (sessionID, IMAQdxAttributeVendorName, IMAQdxValueTypeString, &Vendor);

Looking at the header file NIIMAQdx.h, we see the following:

IMAQdxError NI_FUNC IMAQdxGetAttribute(IMAQdxSession id, const char* name, IMAQdxValueType type, void* value);
IMAQdxError NI_FUNCC IMAQdxSetAttribute(IMAQdxSession id, const char* name, IMAQdxValueType type, ...);

The important distinction is that GetAttribute is passed by reference as a pointer (void*), whereas SetAtttribute is passed by value as a variable argument list (...) . This applies to all value types. Here is another example for shutter value:

uInt32 ES;
IMAQdxGetAttribute (sessionID, "Shutter::Value", IMAQdxValueTypeU32, &ES);
IMAQdxSetAttribute (sessionID, "Shutter::Value", IMAQdxValueTypeU32, ES);

Hope this helps,


Johann S

0 Kudos
Message 8 of 9
(7,192 Views)
Thank you very much. Your message helped me. The problem was in the declaration:
char    vendor[IMAQDX_MAX_API_STRING_LENGTH];
I used only
char    vendor[50];
and that maked problem.

Thank again

Lukas
0 Kudos
Message 9 of 9
(7,185 Views)