Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

How to set Basler Aviator camera attributes?

Solved!
Go to solution

--Warning:  Vision Noob--

 

I'm working with a Basler Aviator 1600 via camera link.  I've been able to capture images using a camera file I created, but I'm having to go into Pylon and manually change the settings every time the camera power gets cycled.  I've seen lots of examples and comments about setting attributes using IMAQdx, but nothing about how to do it with a camera link camera.

 

From what I can gather, I should use the IMAQ Set Camera Attribute VI.  Unfortunately I can't find anything specifying the exact strings to enter for the attribute names I'm interested in.  (Gain, exposure time, white balance, etc.)  LV help says to refer to MAX for valid camera attributes.  MAX (presumably) gets the information from the camera file I created, so that's a dead end.  Basler's api documentation isn't any help.

 

Where can I find the information I need to set up the camera attributes at runtime?

0 Kudos
Message 1 of 4
(4,536 Views)
Solution
Accepted by topic author Daklu

Hi Daklu,

 

Using  IMAQ Set Camera Attribute VI only lets you set attributes that are added into the camera file. These attributes can be added using the Camera File Generator where you add the attributes and command/response serial strings. However, this method has limited functionality in that you'd have to manually add every feature you wish to access. You could also instead just use the IMAQ APIs for reading/writing serial commands directly and just use Basler's documented serial protocol to access features.

 

Another option would be to use Basler's own Pylon API. They provide wrappers in both C and .NET which you should be able to call from LabVIEW. You would use the IMAQ API for image acquisition while using the Pylon API to control the camera's settings.

 

Eric

0 Kudos
Message 2 of 4
(4,534 Views)

Thanks for the quick response Eric.  I'm starting to get a better idea of how all these parts fit together.

 

I'd prefer to use the Set Camera Attribute vi since it would be easier (I think) to change cameras in the future.  If I understand correctly, in principle I could switch to a different camera link camera without modifying the code--I'd just need to create a new camera file with identical attribute names and serial commands customized for the new camera, right?  The list of features I need to access is fairly small so there's not too much overhead there.

 

Are there any examples or white papers showing how to get from Basler's Binary Protocol Library document and their Aviator Register structure document to an attribute callable by the Set Camera Attribute vi?

0 Kudos
Message 3 of 4
(4,528 Views)

Hi Daklu,

 

You are correct to say that if you switch to a different camera link camera, then you will not have to modify the code.  You may have to change the resource if you have the camera named something different in MAX, but the Set Camera Attribute.vi will take information from MAX for that resource, which is linked to its camera file.  As mentioned by Eric, you can add the necessary attributes in the camera file generator.  All the serial commands that need to be sent to the camera should be in the manual for your Basler camera.  There are a few examples on the code exchange related to changing the attributes in LabVIEW, but as I mentioned, the Set Camera Attribute VI will reference the names that you created in the camera file.  I hope this helps!

 

Kim

Applications Engineer
National Instruments
0 Kudos
Message 4 of 4
(4,513 Views)