The settings made in the tab cards Source, Connection, and Parameters can be distilled to program lines that perform the desired image acquisition in your current program. The fields in this tab card specify the code generation details. You can preview the code lines in the panel Code Preview. This panel can be toggled between hidden and displayed state by clicking the button next to the panel label.
The settings of this section are available if images are acquired from an image acquisition interface.
Control Flow: The initialization code for the selected image acquisition interface is always generated (setting Initialize Only). It opens a connection to the specified image acquisition device, and sets all changed parameters. You can also generate code to acquire a single image (setting Acquire Single Image), or to acquire images in a loop (setting Acquire Images in Loop).
Acquisition Mode: You can switch between synchronous and asynchronous acquisition. The latter runs in the background and is recommended for continuous acquisition.
This section defines the variable names that are used in the generated code.
Connection Handle: Variable storing the acquisition handle. The image acquisition interface is accessed by this name. Set to AcqHandle in the example below.
Image Object: Variable used for the acquired images. Set to Image in the example below.
The following variables have to be specified if Source is set to Image File(s) and multiple files are specified:
Loop Counter: Variable storing the loop index.
Image Files: Variable for storing the image names as a tuple.
Insert Code: The actual code is inserted at the IC.
* Code generated by Image Acquisition 01
open_framegrabber ('GigEVision', 1, 1, 0, 0, 0, 0, 'progressive', 8, 'gray', \
-1, 'false', 'default', '003053095003_Basler_scA160014gc', \
0, -1, AcqHandle)
grab_image_start (AcqHandle, -1)
while (true)
grab_image_async (Image, AcqHandle, -1)
* Do something
endwhile
close_framegrabber (AcqHandle)