LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Set Gain GigE Camera

Programatically Set Gain GigE Camera

LabWindowsCVI 2013
NI_IMAQdx 4.3
Camera Basler acA640-90gm

 

I've tried two different approaches for setting the raw gain programatically and neither appear to work.

 

I can set the raw gain just fine in NI-MAX, but can only see how to save a single camera configuration, typically "cam0". I can rename the one camera config, but there is still only one.

 

I can also save the icd file as another name in NI_MAX, and with this method, it looks like I am saving the config with another name, but I can only open the most recent one saved, and NIMAX only ever shows the most recent one saved.

 

The other method attempts to set the gain programatically from CVI with a call to imgGetCameraAttributeString (gSessionID, "RawGain", &gain, sizeof(gain)).  That  returns error 1074397163 "The passed in interface or session is invalid". I get the same error whether I do "int gain;" and pass "&gain", or "char gain[120} and pass "gain".

 

Thank you,

d

0 Kudos
Message 1 of 2
(4,444 Views)

Hello,

 

Are you trying to create more than one ICD file for the same camera? If so, I do not believe that is possible. You could create a configuration in MAX and then export it as a saved file which you could access later though.

 

When it comes to your error in CVI, have you tried to manually add a function prototype at the top of your project?

 

imgGetCameraAttributeString (SESSION_ID Session_ID, char *Attribute_String, char **Current_Value, unsigned long Current_value_string_size);

 

If that does not work, how did you define gSessionID before you called it?

Erin D.
0 Kudos
Message 2 of 2
(4,399 Views)