Machine Vision

Showing results for 
Search instead for 
Did you mean: 

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?



0 Kudos
Message 1 of 4

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



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);



Message 3 of 4

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.



0 Kudos
Message 4 of 4