You can either let the vTool randomly allocate an available camera or define properties that a potential camera has to match in order to be selected.
Assigning Specific Cameras to a Camera vTool#
The Camera vTool randomly allocates a free camera if you haven't defined any specific camera properties. In single-camera designs, this allows you to get up and running quickly. If you want to assign a specific camera to a Camera vTool in multi-camera designs, do the following:
- Select the Camera vTool in the Workbench.
- Open the Features - All pane.
- List available cameras by clicking vTool > Device Enumeration Control > Device List Update > Execute.
- Browse the available cameras using the Device Selector parameter.
This allows you to review certain information about the individual cameras to help you pick the desired camera.
- When you have identified the desired camera, click Device Choose > Execute to assign that particular camera to the Camera vTool.
To specify further device properties that the camera that you want to assign has to match, use the Device Property * parameters in the vTool > Device Enumeration Control group.
More information on device information properties is available in the documentation of the CDeviceInfo class and the Pylon/Key namespace of the pylon C++ API. This gives you fine-grained control of the camera selection and ensures that the same recipe can be run on multiple computers with the correct cameras.
Basler recommends using the DeviceClass and UserDefinedName properties if multiple cameras are attached to a system. You need to set the camera's DeviceUserID parameter first before you can select a camera by using the UserDefinedName property.
Note that USB cameras need to be reset or power-cycled to be able to use a newly set DeviceUserID.
After assigning a camera to a Camera vTool, click the Lock Resources button () in the Workbench toolbar to establish an exclusive connection to the camera device assigned. You can now configure the camera in the Features - All pane.
Saving Camera Settings in a Recipe#
Camera settings aren’t saved automatically when saving a recipe because the camera devices assigned to a Camera vTool may not be connected at the time of saving the recipe or the settings of the camera device may have been changed by another program in the meantime.
Instead use the parameters in the Features - All pane under vTool > Configuration Set Persistence to save the settings of a camera device and accompanied settings after you have configured the parameters.
For initial camera device configuration, Basler recommends using the classic pylon Viewer features.
To save camera settings in a recipe:
- In the Features - All pane, open the Configuration Set Persistence category and set the Configuration Set Selector parameter to Camera to select the parameter set of the camera device.
- Click Configuration Set Fetch to fetch the settings from the camera device and store it in the Configuration Set Staged parameter.
Optional: You can inspect or manually modify the parameter settings by copying the text to a text editor and back into Configuration Set Staged.
In the text editor, you will see that each line of text contains the name and the value of a parameter separated by a tab or = character. Lines starting with # are treated as comments. A configuration set must start with the following line:
Alternatively, you can use user sets to store camera settings persistently.
Click Configuration Set Commit to apply the parameters and store the parameters in the recipe settings. This ensures that parameters are set automatically each time the lock resources operation is executed.
If a camera has already been allocated, the parameter settings are transferred immediately to the camera. If the transfer fails, the parameter settings will not be stored in Configuration Set Active. If no camera is allocated, the settings will be transferred to the camera when it is allocated. If this transfer fails, the recipe can't be started.
Some camera parameters, e.g., those in the Camera Instance configuration set, can only be changed while the camera is closed. In this case, the parameters stored in Configuration Set Active are transferred to the camera when it is allocated before opening the camera.
To clear parameter settings from the recipe, click Clear Data.
Returns the image grabbed by a camera. This output image can be used by any vTool accepting images as input.
- Data type: Image
- Image format: As configured on the camera