FG Camera Library  1.7.2.0 (2025-09-18)
Loading...
Searching...
No Matches
VisionSensor PV3

The VisionSensor PV3 is a compact programmable Linux camera based on a quad-core ARM Cortex-A57 (arm64 architecture). Unlike the VisionCam, it does not provide a "Real Time Communication Controller" (RTCC). Sensor trigger and the integrated LED are controlled by this libraray, while the digital I/Os are controlled by the VisionBox Interface Library.

The VisionSensor PV3 can also be connected to an I/O Expansion hardware which provides additional I/Os and the "Real Time Communication Controller".

Also take a look at the Sensors page for information about available sensors for each platform.

Trigger Modes

The function FG_set_trigger_mode() is used to configure one of the trigger modes:

  • Free-run
  • Software triggered
  • Hardware triggered

Example:

// Enable hardware trigger
@ FG_TRIGGER_MODE_HARDWARE
Hardware triggered mode.
Definition FG_CameraInterface.h:166
UINT32 DLL_FG_API FG_set_trigger_mode(enum eFG_TRIGGER_MODE trigger_mode)
Sets the trigger mode.
Definition FG_CameraInterface.cpp:849
Note
  • The default settings after initialization is software trigger mode.
  • The debounce setting for the digital inputs will also be applied for the trigger signal in hardware triggered mode. See VIB::DigitalInput::ConfigureDebounceTime() for adjustment of the debouncing time.

Hardware trigger

The VisionSensor PV3 provides the following special features for configuration of the trigger signal:

  • TriggerLine:
    Controls the trigger source and the edge sensitivity.
  • TriggerDivider:
    Decreases the frequency of the trigger events in hardware trigger mode. The divider counts trigger events based on the TriggerLine setting and triggers the sensor after reaching the specified value.
  • TriggerDelay:
    An additional time delay can be applied to the trigger output of the divider.
Property nameDescriptionVersion requirements
FPGALibrary
TriggerLineSelects the trigger signal in hardware triggered mode.
IN1 is not available when using FrameTriggerMode 2 and 3.
0: IN0, rising edge (default)
1: IN1, rising edge
2: IN0, falling edge
3: IN1, falling edge
4: IN0, rising and falling edge
5: IN1, rising and falling edge
6: IN0 + IN1, rising and falling edges
Additional values for the VisionSensor PV3 with I/O Expansion:
100...115: VIB::Multiplexer output line 0...15, rising edge
200...215: VIB::Multiplexer output line 0...15, falling edge
≥ 1.0.0.68 for values ≥ 2,
≥ 1.0.0.75 for values ≥ 100,
≥ 1.3.0.0
TriggerDivider
1...65536: divider value (default: 1)
≥ 1.0.0.68
TriggerDelay
0...6700000: delay value in micro-seconds (default: 0)
Note
  • The delay is also applied in software trigger mode.
  • TriggerDelay and FrameTriggerMode can't be used simultaneously.
  • Trigger events at the divider output during the delay period of the previous trigger event will be ignored. The next trigger signal can be applied as soon as the delay period has expired and the sensor exposure has started. But the exposure must have stopped before the delay period of the next tirgger expires.
≥ 1.0.0.85≥ 1.7.1.0

Example:

// Select input IN1, rising edge as sensor trigger:
FG_set_special_option("TriggerLine", 1);
// Divide incoming trigger signal by 10:
FG_set_special_option("TriggerDivider", 10);
UINT32 DLL_FG_API FG_set_special_option(const char *option, INT64 arg)
Configures a special camera property.
Definition FG_CameraInterface.cpp:972

If the sensor is used in Line scan / multi-scan mode, an additional frame trigger signal can be configured using the special feature FrameTriggerMode.

Controlling the integrated LED and exposure signal output

The operating mode of the integrated LED unit and the exposure output signal can be controlled by software:

  • If the integrated LED is enabled, the LED turns on during the integration period of the sensor. The image brightness can only be changed by adjusting the integration time with FG_set_shutter_time().
  • The exposure signal of the sensor can be copied to a digital OUT wire. This allows synchronization of an external lighting unit. The output signal can be selected with the special feature StrobeOutput.

Use the special feature StrobeMode to control usage of the exposure signal.

Strobe modes
StrobeModeIntegrated LEDDigital output OUT<i>
0 EnabledControlled by VIB::DigitalOutput
1 OffSensor exposure signal
2 (default)OffControlled by VIB::DigitalOutput
3 EnabledSensor exposure signal
Special features for strobe
Property nameDescriptionLibrary
StrobeModeSets the operating mode for the integrated LED and the exposure signal for replacing the physical mode switch.
-1...3: strobe mode (default: 2)
≥ 1.2.0.0
StrobeOutputSelects the digital output line for the external exposure signal.
0...<i>: index of digital output signal OUT<i> (default: 0)
≥ 1.2.3.0

Example:

// Enable the integrated LED and exposure signal on digital output:
FG_set_special_option("StrobeMode", 3);
// Select output OUT1 for the exposure signal:
FG_set_special_option("StrobeOutput", 1);
Note
The maximum LED strobe time gets automatically limited to a duty cycle of 25% for protection of the hardware. For example: when using a frame rate of 60 fps, the LED strobe time will be dynamically limited to 4.17 ms if the exposure time setting is longer. The external strobe signal on digital outputs will not be limited.

LED current

The LED current can be adjusted for the following hardware:

  • Multi-channel LED illumination unit
  • Adjustable ring light

The LED current is controlled by the following special feature:

Property nameDescriptionVersion requirements
FPGALibrary
LedCurrentLED current in percent, the minimum value depends on the LED hardware
x...100
Default value for multi-channel LED illumination unit: 100
Default value for adjustable ring light: 28 (similar to non-adjustable model)
≥ 1.0.0.70 (for adjustable ring light only)≥ 1.4.0.0
LedDutyCycleReturns the maximum usable duty cycle in percent (read-only)
Multi-channel LED illumination unit: the content of the pointer argument must be initialized with the LED channel.
-≥ 1.7.0.0

Sequencer

A sequencer can be used to apply different settings to subsequent sensor frames:

  • Trigger mode: enable or disable sensor trigger
  • Control flash parameters for the multi-channel LED illumination unit

The sequencer is configured using special features as follows:

  • Configure the number of sequencer steps with SequencerStepCount
  • For each sequencer step:
    • Select the step with SequencerStep
    • Configure the selected step parameters

The sequencer is controlled by the following special features:

Special features for the sequencer
Property nameDescriptionVersion requirements
FPGALibrary
SequencerStepCountNumber of active Sequencer steps
1...4 (default: 1)
≥ 1.0.0.70≥ 1.4.0.0
SequencerStepSelected Sequencer step index for using the following special options:
SequencerTriggerMode, SequencerFlashTime, SequencerFlashEnable
0...(SequencerStepCount - 1) (default: 0)
SequencerTriggerModeTrigger mode for the selected Sequencer step. This setting is ignored in free run mode:
0: disable sensor trigger for this step, acquire image when the sensor is ready
1: enable sensor trigger for this step (default)
SequencerFlashEnableLED illumination unit: a bit field for selecting active LED channels for the selected Sequencer step.
0x0...0xf (default: 0x3 - channel 0+1 for step 0, else 0x0)
SequencerFlashTimeLED illumination unit: strobe duration for the selected Sequencer step in micro-seconds.
1...16384 (default: 100)

Correlation between acquired images and the used sequencer step can be done in two ways:

  • By using remainder of the frame number FG_IMAGE::image_number divided by the number of sequencer steps. The frame number will also be incremented if frames are lost when the acquisition queue is empty.
  • Use the Line scan / multi-scan mode to accumulate multiple sensor scans into one image. Use FG_set_scan_param() and set the parameter image_scan_count to the number of sequencer steps. The resulting image will contain the sensor images for all steps after each other.
Note
The number of sequencer steps should be configured before starting image acquisition with FG_append_image() to ensure the correlation.

Sequencer trigger mode setting

The trigger mode can be used to enable or disable the sensor trigger for each sequencer step.

The trigger is activated by default for all steps, so the sensor will wait for a trigger signal (hardware or software trigger). If the trigger mode is disabled for a sequencer step, the sensor will start acquisition as soon as the previous sensor exposure and readout has completed.

Example:

The following example configures the sequencer to capture three frames for each trigger event:

// number of sequencer steps: 3
FG_set_special_option("SequencerStepCount", 3);
// disable trigger for steps 1 and 2 (trigger for step 0 stays active)
FG_set_special_option("SequencerStep", 1);
FG_set_special_option("SequencerTriggerMode", 0);
FG_set_special_option("SequencerStep", 2);
FG_set_special_option("SequencerTriggerMode", 0);

In free-run mode, the sequencer trigger mode setting affects the acquisition as follows:

  • If the trigger is active for a step, the sensor will be triggered according to the FrameRate / ScanPeriod setting.
  • If the trigger is disabled for a step, the sensor will be triggered as soon as possible.

Sequencer LED illumination unit settings

The following LED parameters can be changed for each sequencer step when using the multi-channel LED illumination unit:

  • SequencerFlashTime: controls the LED flash duration
  • SequencerFlashEnable: a bit field controlling the active LED channels
Note
  • The LED current (option LedCurrent) is the same for all LED channels and for all sequencer steps.
  • The actual LED current may be limited to less than 100 percent if multiple LED channels are used simultaneously in any sequencer step. Read the current value back to get the actual value.
  • The maximum allowed duty cycle is calculated by the library for each LED channel to protect against hardware damage.

Example:

// number of sequencer steps: 3
FG_set_special_option("SequencerStepCount", 3);
// configure step 0
FG_set_special_option("SequencerStep", 0);
FG_set_special_option("SequencerFlashEnable", 0x3); // enable LED channel 0 and 1
FG_set_special_option("SequencerFlashTime", 400); // 400 micro-seconds
// configure step 1
FG_set_special_option("SequencerStep", 1);
FG_set_special_option("SequencerFlashEnable", 0x4); // enable LED channel 2
FG_set_special_option("SequencerFlashTime", 1000); // 1000 micro-seconds
// configure step 2
FG_set_special_option("SequencerStep", 2);
FG_set_special_option("SequencerFlashEnable", 0x8); // enable LED channel 3
FG_set_special_option("SequencerFlashTime", 200); // 200 micro-seconds

Liquid Lens

The optional Liquid Lens hardware is controlled by the special feature Focus:

Property nameDescriptionLibrary
FocusDAC value controlling the Liquid Lens focus:
0...255 (default: 128)
≥ 1.7.0.0

Example:

FG_set_special_option("Focus", 100);
Note
  • Lower values increase the working distance, higher values reduce the working distance.
  • The working distance also depends on the temperature of the Liquid Lens. Therefore, the value has to be adjusted repeatedly.
  • FG_get_special_option() returns the value -1 if the Liquid Lens is not detected.

Line scan / multi-scan mode

With Line scan mode or multi-scan mode, multiple frames of the selected sensor region will be concatenated into one larger destination image.

This mode provides the following benefits:

  • Suitable for line scan applications when using a small AOI height at high frame rates.
  • Reduces the risk of loosing sensor frames, because the image buffers can be much bigger.
  • Lowers the number of interactions with the driver which reduces the acquisition overhead.
  • An additional frame trigger signal can be used to start aquisition of multiple frames for one image.
  • Usable for correlation between acquired images and sequencer step when using the Sequencer.
Note
  • Support requires FPGA version ≥ 1.0.0.68.
  • When implementign line scan applications, a sensor scan height greater than one can be useful to increase the effective line rate. For example, an AOI size of 1920 x 4 and a scan rate of 10 kHz results in an effective line rate of 40 kHz. The effective line rate has to match the object speed to avoid image distortions. This can be achieved by using a rotational encoder as the trigger source for example.
  • The exposure time needs to be short enough to avoid in-motion unsharpness. Exposure should not exceed the reciprocal of the effective line rate.

Activating line scan mode

Line scan mode is enabled by configuring the AOI with FG_set_scan_param() instead of FG_set_aoi(). The parameter image_scan_count specifies the number of sensor frames that will be concatenated into the larger destination image. A value of 1 disables line scan mode.

Example:

The following example configures a scan AOI of 1024 x 4 at the sensor's center location:

UINT32 sensor_width, sensor_height;
UINT32 scan_x, scan_y, scan_width, scan_height, image_scan_count;
UINT32 image_width, image_height;
eFG_PIXEL_TYPE pixel_type;
// read the default values to get the sensor size:
FG_get_scan_param(NULL, NULL, &sensor_width, &sensor_height, NULL, &pixel_type);
// the sensor AOI size:
scan_width = 1024;
scan_height = 4;
// set x/y offsets to the sensor's center:
scan_x = (sensor_width - scan_width) / 2;
scan_y = (sensor_height - scan_height) / 2;
// use a scan count of 250 which results in an image height of 1000 lines:
image_scan_count = 250;
// configure AOI for line scan mode:
FG_set_scan_param(scan_x, scan_y, scan_width, scan_height, image_scan_count, pixel_type);
// calculate the image size (same as FG_get_image_size())
image_width = scan_width;
image_height = image_scan_count * scan_height;
@ FG_CAMERA_TYPE_X_X_IMAGO_Vxx_AUTO
IMAGO VisionCam/Sensor (automatic)
Definition FG_CameraInterface.h:54
eFG_PIXEL_TYPE
The data format for storing images in memory, see FG_set_scan_param() and FG_set_aoi()
Definition FG_CameraInterface.h:132
UINT32 DLL_FG_API FG_install_camera(enum eFG_CAMERA_TYPE camera_type,...)
Opens and initializes the camera.
Definition FG_CameraInterface.cpp:278
UINT32 DLL_FG_API FG_set_scan_param(UINT32 scan_x, UINT32 scan_y, UINT32 scan_width, UINT32 scan_height, UINT32 image_scan_count, enum eFG_PIXEL_TYPE pixel_type)
Sets the area of interest and output format.
Definition FG_CameraInterface.cpp:774
UINT32 DLL_FG_API FG_get_scan_param(UINT32 *scan_x, UINT32 *scan_y, UINT32 *scan_width, UINT32 *scan_height, UINT32 *image_scan_count, enum eFG_PIXEL_TYPE *pixel_type)
Returns the area of interest and the output format.
Definition FG_CameraInterface.cpp:788
Note
  • FG_get_aoi() returns the sensor scan AOI in line scan mode, the image height can be obtained with FG_get_image_size().
  • It's possible to change the AOI position after the aquisition has started.

Sensor trigger

In line scan mode with hardware or software trigger enabled, each trigger event will start acquisition of one sensor frame containing the configured sensor scan height number of lines. Multiple trigger events are required before the image is complete and returned to the user.

The trigger input, edge sensitivity and a trigger divider can be controlled to adapt the the trigger signal to the desired scan rate, see Hardware trigger.

The scan height acts like a trigger multiplier for the effective line rate.

Frame trigger

In line scan mode, an additional frame trigger can be used to start acquisition of an image. The trigger can be software based or hardware based using the digital input signal IN1. Frame trigger works independently from the sensor trigger mode. An additional frame start delay is also available.

The frame trigger is configured using the following special features:

Special features for frame trigger in line scan mode
Property nameDescriptionVersion requirements
FPGALibrary
FrameTriggerModeSets the frame trigger mode, used for starting frames in line scan mode.
0: Don't use frame trigger, frames are captured continuously (default)
1: Frames are software triggered by using the special option FrameTrigger
2: Use rising edge on input IN1
3: Use falling edge on input IN1
Additional values for the VisionSensor PV3 with I/O Expansion:
100...115: VIB::Multiplexer output line 0...15, rising edge
200...215: VIB::Multiplexer output line 0...15, falling edge
≥ 1.0.0.68≥ 1.2.9.0
FrameTriggerDelayFrame start delay after receiving the frame trigger. The number determines how many sensor trigger events are ignored after each frame trigger.
0...65535 (default: 0)
FrameTriggerTriggers a frame in software controlled frame trigger mode (write only).
Only the value 0 is valid.
Note
Frame trigger mode and the TriggerDelay option can't be used simultaneously.

Example:

// Setup hardware based frame trigger using rising edge on IN1:
FG_set_special_option("FrameTriggerMode", 2);
// Delay frame start by 100 sensor scan frames
FG_set_special_option("FrameTriggerDelay", 100);