buaagc

Basler 硬件触发介绍

Using a Hardware Acquisition Start Trigger
7.3.5.1 Introduction
If the Trigger Mode parameter for the acquisition start trigger is set to on and the Trigger Source
parameter is set to line 1, an externally generated electrical signal injected into physical input line
1 on the camera will act as the acquisition start trigger signal for the camera. This type of trigger
signal is generally referred to as a hardware trigger signal or as an external acquisition start trigger
signal (ExASTrig).
A rising edge or a falling edge of the ExASTrig signal can be used to trigger acquisition start. The
Trigger Activation parameter is used to select rising edge or falling edge triggering.
When the Trigger Mode parameter is set to on, the camera will initially be in a "waiting for acquisition
start trigger" acquisition status. It cannot react to frame start trigger signals when in this acquisition
status. When the appropriate ExASTrig signal is applied to line 1 (e.g, a rising edge of the signal for
rising edge triggering), the camera will exit the "waiting for acquisition start trigger" acquisition
status and will enter the "waiting for frame start trigger" acquisition status. It can then react to frame
start trigger signals. When the number of frame start trigger signals received by the camera is equal
to the current Acquisition Frame Count parameter setting, the camera will return to the "waiting for
acquisition start trigger" acquisition status. When a new ExASTrig signal is applied to line 1, the
camera will again exit from the "waiting for acquisition start trigger" acquisition status and enter the
"waiting for frame start trigger" acquisition status.
/////////////////////////////////////////以上介绍了外部触发的流程////////////////////////////////////
7.3.5.2 Setting the Parameters Related to Hardware Acquisition
Start Triggering and Applying a Hardware Trigger Signal
You can set all of the parameters needed to perform hardware acquisition start triggering from within
your application by using the Basler pylon API. The following code snippet illustrates using the API
to set the parameter values required to enable rising edge hardware acquisition start triggering with
line 1 as the trigger source:
// Set the acquisition mode to continuous(the acquisition mode must
// be set to continuous when acquisition start triggering is on)
Camera.AcquisitionMode.SetValue( AcquisitionMode_Continuous );
// Select the acquisition start trigger
Camera.TriggerSelector.SetValue( TriggerSelector_AcquisitionStart );
// Set the mode for the selected trigger
Camera.TriggerMode.SetValue( TriggerMode_On );
// Set the source for the selected trigger
Camera.TriggerSource.SetValue ( TriggerSource_Line1 );
// Set the activation mode for the selected trigger to rising edge
Camera.TriggerActivation.SetValue( TriggerActivation_RisingEdge );
// Set the acquisition frame count
Camera.AcquisitionFrameCount.SetValue( 5 );
// Execute an acquisition start command to prepare for frame acquisition
Camera.AcquisitionStart.Execute( );
while ( ! finished )
{
// Apply a rising edge of the externally generated electrical signal
// (ExASTrig signal) to input line 1 on the camera
// Perform the required functions to parameterize the frame start
// trigger, to trigger 5 frame starts, and to retrieve 5 frames here
}
Camera.AcquisitionStop.Execute( );

评论