EDT, Inc.
2019 April 29
15
VisionLink F-series
Example and Utility Applications
simple_take
Shows how to use the API to acquire images from a camera linked to the board and (optionally) save the images to files.
To add image acquisition to an application, EDT recommends starting with this example, which shows how to use the
ring buffer routines to improve performance by pipelining image acquisition and processing.
Several of the most useful options are...
-u
unit
The unit number, if multiple boards are installed; default is 0 (first board).
-c
channel
The channel, on multichannel boards; default is 0 (first channel).
-b
file
The base name of the file in which to save the image. If only one image is taken,
this is the filename; otherwise a two-digit number is appended to each file, starting
with 00. The appropriate suffix is automatically added.
-l
loopcount
The number of consecutive pictures you wish to take. The default is one.
-N
numbufs
The number of ring buffers
—
by default, one. (A
ring buffer
is a portion of host
memory preallocated for DMA and used in round-robin fashion.) A setting of four
optimizes pipelining
—
one ring buffer currently acquiring data, one ready for data,
one getting ready, and one backup.
For example, to acquire four images as fast as possible using four ring buffers, saving each to files named
picture00.bmp
through
picture03.bmp
, enter...
simple_take -N 4 -l 4 -b picture
simplest_take
The simplest example application, showing only how to open the device, acquire an image, check for timeouts, and
close the device. For simplicity, there is no optimization for pipelining, no processing or extended error checking.
simplest_take
reports a successful image acquisition, or any errors that occurred
—
useful for testing.
simple_sequence
Like
simple_take
but, instead of capturing and saving one file at a time, it captures a finite number of images (limited
to available memory) into memory and then writes them all out at once.
serial_cmd
Sends serial commands to a camera through the board, using calls to routines in the API. By default, the application
starts in command mode: the final argument to
serial_cmd
is the command to send to the camera. Delimit this
command with either single or double quotation marks, but be consistent. For example...
serial_cmd "MDE?"
If you omit the command argument, the application enters interactive mode, in which you can type one command per
line. To quit the application, enter Control-C.
Several of the most useful options are...
-u
unit
The unit number, if multiple boards are installed; default is 0 (first board).
-c
channel
The channel, on multichannel boards; default is 0 (first channel).
-x
Treats the command argument as a hexadecimal number, which is sent to the
camera without terminating nulls or carriage returns. The default is ASCII with a
terminating carriage return added.
For example (command mode usage)...
% serial_cmd "MDE?"
(Redlake "Query Mode" command)