Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

Can I access camera file functions programmatically?

I work with a number of cameras from various companies, and receive MAX camera files for each of these cameras from our distributor. I only recently noticed that one can create attributes and specify a corresponding serial command/response format. Is it possible to read/write these attributes with IMAQ functions in C code? If this is the case, it would save me from having to write a new set of serial communication functions for every new camera we use - I could just make all of the often-used attributes use the same name. Is this possible?

 

Thanks!

0 Kudos
Message 1 of 4
(1,061 Views)

It is possible, all you have to do is edit the file in C. Here are some LabVIEW and CVI examples. Hope that helps!

John B.
Embedded Networks R&D
National Instruments
Certified LabVIEW Developer
0 Kudos
Message 2 of 4
(1,054 Views)

Hi,

 

I'm not sure the example John pointed you to are what you want... the text appears to indicate they are for editing the camera file programatically. If you want to interact with the camera commands stored in the camera file, these are the entrypoints you should examine in the IMAQ.h header:

 

USER_FUNC imgGetCameraAttributeNumeric(SESSION_ID sid, const Int8* attributeString,double *currentValueNumeric);

USER_FUNC imgSetCameraAttributeNumeric(SESSION_ID sid, const Int8* attributeString,double newValueNumeric);

USER_FUNC imgGetCameraAttributeString(SESSION_ID sid, const Int8* attributeString,Int8* currentValueString,uInt32 sizeofCurrentValueString);

USER_FUNC imgSetCameraAttributeString(SESSION_ID sid, const Int8* attributeString,Int8* newValueString);

 

Eric

Message 3 of 4
(1,051 Views)

Ah - I will have to give these a shot. You are correct - I am trying to execute the commands in the attributes from C, not edit the camera file from C.

 

Thanks!

0 Kudos
Message 4 of 4
(1,047 Views)