From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Programmatically set gain on Basler acA1920-155um with IMAQdx

Hi!

 

I'm writing acquisition software for a Basler USB camera (model #: Basler acA1920-155um). [Link to a programmer's manual below]: http://mlab.no/blog/wp-content/uploads/2009/06/basler_pylon_prog_guide_and_api_ref.pdf

 

User's manual: https://graftek.biz/system/files/2576/original/Basler_Ace_USB_3.0_Manual.pdf?1479057814


So far I've been successful acquiring images and setting camera attributes (triggering, exposure time, height & width, and so on) with IMAQdx in LabView.  To do this, I've been looking through the above manual and the NI-MAX XML file for the camera to get the attribute names and values, then using IMAQdx property nodes to set the attribute name and value. However, I'm struggling to set the gain. When attempting to adjust the gain, the camera gain does not change, though the code runs. (See attached screenshot for my attempt to set these IMAQdx attributes)

 

IMAQdx set camera gain.png

 

 

 

 

 

 

 

 

 

Some notes:

- As mentioned above, I'm able to set other camera attributes. This includes setting the Digital Shift attribute using CameraAttributes::AnalogControl::DigitalShift as the ActiveAttribute. 

- The camera supports gain values between 0.0 dB and 36.0 dB. Passing a number outside of this range causes an error.

- Varying the gain slider in NI-MAX, and also in the manufacturer's native software (Basler Pylon Viewer) works. The above code runs without errors, but doesn't seem to actually change anything.

 

 

 

Probably a silly question: do you have some ideas for what I could be doing wrong?

 

 

Thanks in advance!

 

 

UPDATE: I found a bug elsewhere in the VI; fixing this bug makes it work as it should. Problem solved!

0 Kudos
Message 1 of 1
(1,957 Views)