Machine Vision

Showing results for 
Search instead for 
Did you mean: 

How change aquisition settings on GigE camera in VBAI

Go to solution

I have a line scan application where I need to control the line rate as a function of machine speed.  I am using Vision Builder (Vbai) 2009 and I have Labview, but not the Vision Developement Module.  I am using a Labview VI for the custom User Interface.  The camera is a Basler Runner RUL2048-30GM GigE linescan camera.  I have created a Labview VI that writes the line rate and it works, however when Vbai runs the Acquire Image GigE step it ignores whatever I wrote to the camera and uses the settings that are set up in the Aquire Image step itself. 


I tried to create an Image Acquisition VI in labview, but when I run it in Vbai, there is no output image to process.


How do I

a) make the "canned" GigE Aquire Image not overwrite certain perameters or

b) aquire an image in Labview and "pass" it on to Vbai for processing


It seems to me that the ability to control the camera parameters from the UI is a basic function, but I cannot seem to figure out how to make it work.  Any help would be appreciated.  Thanks.

0 Kudos
Message 1 of 8

If you have a slider or some other numeric control on the custom UI, you can have the acquisition line rate use the value of this control. To do this, in the IMAQdx acquisition step go to the Line Rate Attribute in the tree and you can associate it with a previous result of the same data type by using the pull down for the Value instead of typing in a constant. So just select the Custom UI Numeric Value for the line rate value to use.


In a future release of Vision Builder AI, we plan to seperate out the acquisition from setting attributes so there will be a seperate step to read/write attributes, but for now the acquisition and setting attributes is integrated in the same step. When opening your inspection in a future release that has this new step, we will automatically create a Read/Write Attribute step for you to mantain the same functionality.


Hope this helps,


0 Kudos
Message 2 of 8

Thanks.  That worked for the Line Rate.  I also want to control the size of the image (#pixels, # lines) but there is no pull down on those attributes.  Is this a Vbai issue or a Basler issue?  Do you know a way to control these attributes?


0 Kudos
Message 3 of 8
These are not currently settable with previous results since they cannot be set while the acquisition is in progress (The FAQ of the step describes this in more detail). In the next version of VBAI, when we break out the reading/writing of camera attributes, you'll be able to do this because the read/write attribute step will allow you to choose if you want to stop the acquisition before writing attributes.
0 Kudos
Message 4 of 8
Is there any way to set it - even when the camera is not active?  I understand the part about not writing it while the camera is taking pictures, but does that mean it cannot be set at all?  For my application, the #lines would be a "Recipe" perameter that would be set at the beginning of the inspection and would not change until a different product was selected.  Is there a way to accomplish this?  If not, do you have any idea when that ability will be available?
0 Kudos
Message 5 of 8

No easy way to set the acq size and have it be variable in VBAI 2009. Once the inspection is saved, it saves the camera atttributes as part of the step and since they are constants, there's not really a good way to change it. If you know ahead of time what it should be, you could save different inspections with different acquisition sizes, but I don't think this is what you want. There could be a way to do it with a Run LabVIEW step, but this is more complicated and the new version of VBAI will make this much easier (should be available early next year). If you need a quick fix and can't wait for the next version, I can help make a simple VI that can acquire images from camera and initialize the acquisition with a variable image size (requires you aren't trying to use the normal IMAQdx acquisition step).



0 Kudos
Message 6 of 8

Early next year sounds fine.  We have many other parts of the application that we can work on until the image size becomes critical.


As far as the multiple inspections, I assume you are refering to the Select Inspection process.  Before we realized that the Acq step was overwriting the camera attributes, we did try to use the Select Inspection to switch between a script with a LabView VI to write the Line rate to the camera and then back to the main Image Acq & Inspection script.  We were able to switch from the Acq & Inspect script to the Line rate one, but whenever we tried to switch back, it would give us an error that the file could not be opened and we needed to go to Tools>>Options and set up the configuration.  I tested the same code using files that had simulations instead of Acq steps and it worked fine.  Is there something about switching to files with Acq steps that we need to do to make the Select Inspection work?

0 Kudos
Message 7 of 8
Accepted by topic author CW_Edge
08-27-2015 04:09 PM

There should be no problem switching between inspections that have acquisition steps. It sounds like you had an inspection that set the line rate using a Run LabVIEW VI and I would bet that the session didn't get cleaned up correctly in the VI you ran so when you switched to an inspection that tried to use that camera, the camera was still in use from the LabVIEW that didn't close the session correctly. I would recommend using standard VBAI steps to interact with cameras and then this won't be a problem.  When the new step comes out, this will be much easier/cleaner to solve in VBAI.




0 Kudos
Message 8 of 8