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.
Solved! Go to Solution.
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,
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?
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).
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?
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.