Gocator Line Profile Sensors: User Manual
Tools and Native Drivers • 574
Procedures Description
To schedule a sensor to start after a delay (ticks or microseconds), pass GenTL/Sensor in
the first call to set_framegrabber_param, followed by the remaining calls to the
function as described in the previous example:
set_framegrabber_param(AcqHandle, ‘XMLSettings’, ‘GenTL/Sensor’)
To clear data buffers::
set_framegrabber_param(AcqHandle,'XmlCommand','GenTL/ClearData\n')
Generating Halcon Acquisition Code
Halcon lets you insert acquisition code into your code in the IDE.
To generate acquisition code:
1. In Halcon, in the Assistants menu, click Open New Image Acquisition.
2. In the dialog that opens, in the Code Generation tab, set Acquisition Mode to Asynchronous Acquisition.
3. Under Acquisition, click Insert Code to generate the code that will open the acquisition device.
To handle cases when the grab_image function times out while waiting for data, add a
try-catch statement around the grab_image function code.
After the example code is generated, you should add a catch instruction to bypass the acquisition
timeout event, and use the Go2GenTL_ParseData function to extract information from the returned
image.