22/33
Sentech GigE Vision Camera StGigE SDK
Sample Guide Rev.1.00
2.1.2 Software trigger with GenICam command
This sample shows how to generate the software trigger signal with the GenICam command.
A. Connects the camera, obtains the PvDevice then sets PvStream and PvPipeline.
Please check the sample program for GEVPlayerSample, PvSimpleUISample or PvstreamSample to make the
applications.
B. Sets the operation mode to the trigger mode.
// Sets the operation mode.
//bTriggerMode: Operation mode, True: Trigger mode, False: Free-run mode
BOOL SetTriggerMode( PvDevice *pDevice, BOOL bTriggerMode )
{
PvResult lResult;
PvGenEnum* lPvGenEnum=dynamic_cast<PvGenEnum *>(pDevice->GetGenParameters()->Get("TriggerMode"));
if( lPvGenEnum==NULL ) return FALSE;
if( bTriggerMode ){
lResult = lPvGenEnum->SetValue("On");
}
else
{
lResult = lPvGenEnum->SetValue("Off");
}
return (BOOL)lResult.IsOK();
}
C. Sets the exposure mode.
// Sets the exposure mode
//iExposureMode
:
0:Timed 1:TriggerWidth
BOOL SetExposureMode( PvDevice *pDevice, int iExposureMode )
{
PvGenEnum* lPvGenEnum=dynamic_cast<PvGenEnum *>(pDevice->GetGenParameters()->Get("ExposureMode"));
if( lPvGenEnum==NULL ) return FALSE;
PvResult lResult = lPvGenEnum->SetValue(iExposureMode);
return (BOOL)lResult.IsOK();
}
D. Sets the exposure time.
//iExposureTime
:
Min:0 Max:16777215
BOOL SetExposureMode( PvDevice *pDevice, int iExposureTime )
{
PvGenInteger* lPvGenInteger=dynamic_cast<PvGenInteger*>(pDevice->GetGenParameters()->Get("ExposureTimeRaw"));
if( lPvGenInteger==NULL ) return FALSE;
PvResult lResult = lPvGenInteger->SetValue(iExposureTime);
return (BOOL)lResult.IsOK();
}
E. Sets the "Software trigger" for the trigger source.
//iTriggerSource
:
0:Software 1:Hardware