17/33
Sentech GigE Vision Camera StGigE SDK
Sample Guide Rev.1.00
2. The sample programs for the specific usages
2.1 Software trigger
2.1.1 Software trigger with PLC function
This sample shows how to generate the software trigger signal with the PLC function.
To generate the software trigger signal:
Input the signal from the PLC_ctrl0 to Q9 through I5.
Output the signal, which is generated by the Pulse Generator 0 at the rising edge of the input signal, to the
PG0_out(Timer 1 Out).
The trigger signal from the pg0_out through I4 through Q4 to the camera control FPGA.
Please check with iPORT.Reference.Programmable_Logic_Controller.pdf for more details of the PLC.
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 route for the PLC.
// Function for set up the PLC route for the software trigger.
BOOL SetupPLCRoute( PvDevice *pDevice )
{
PvGenBoolean* lPvGenBoolean;
BOOL bReval;
//Q4 = I7
bReval = SetupLUT( pDevice, 4, "PLC_I7","Or","Zero","Or","Zero","Or","Zero" );
if( !bReval ) return FALSE;
//Q9 = I5
bReval = SetupLUT( pDevice, 9, "PLC_I5","Or","Zero","Or","Zero","Or","Zero" );
if( !bReval ) return FALSE;
bReval = SetupSRB( pDevice, 5, "PLC_ctrl0" );
if( !bReval ) return FALSE;
bReval = SetupSRB( pDevice, 7, "Timer1Out" );
if( !bReval ) return FALSE;
return TRUE;
}
// Function for sets the LookupTable
BOOL SetupLUT( PvDevice *pDevice, int iQ,
PCHAR pText1,PCHAR pText2,PCHAR pText3,PCHAR pText4,PCHAR pText5,PCHAR pText6,PCHAR pText7
)
{
// *********************************************** //
// Route PLC_Ixx to Qxx //
// *********************************************** //