19/33
Sentech GigE Vision Camera StGigE SDK
Sample Guide Rev.1.00
BOOL SetupSRB( PvDevice *pDevice, int iI, PCHAR pText )
{
// ********************************************* //
// Setup PLC_Ix as PLC_??
// ********************************************* //
BOOL bReval=TRUE;
PvResult lResult;
char PLCText[64];
sprintf( PLCText, "PLC_I%d", iI );
PvGenEnum* lPvGenEnum = dynamic_cast<PvGenEnum *>(pDevice->GetGenParameters()->Get( PLCText ) );
if(lPvGenEnum !=NULL)
{
lResult = lPvGenEnum->SetValue( pText );
if( !lResult.IsOK() )
bReval=FALSE;
}
else
{
bReval=FALSE;
}
return bReval;
}
C. Sets the pulse generator.
// Function for set up the pulse generator.
//----------------------------------------------------------
//durationOfHigh: Time for the High status of the pulse
//durationOfLow: Time for the Low status of the pulse
//bTrgMode : Trigger mode, True: Continuously False: Single pulse
//pulseScale: Unit for the pulse. Sets the 1 for 30 nseconds, sets for 10,000 for 30 useconds.
//----------------------------------------------------------
BOOL SetPalseGenerator( int index, PvDevice *pDevice, int durationOfHigh, int durationOfLow, BOOL
bTrgMode, int pulseScale )
{
char PLCText[64];
PvGenEnum* lPvGenEnum;
PvGenInteger* lPvGenInteger;
PvResult lResult;
sprintf( PLCText, "TimerSelector" );
lPvGenEnum = dynamic_cast<PvGenEnum *>(pDevice->GetGenParameters()->Get( PLCText) );
if(lPvGenEnum==NULL) return FALSE;
lResult = lPvGenEnum->SetValue(index);
if( !lResult.IsOK() ) return FALSE;
sprintf( PLCText, "TimerDurationRaw" );
lPvGenInteger = dynamic_cast<PvGenInteger *>(pDevice->GetGenParameters()->Get( PLCText ) );
if(lPvGenInteger==NULL) return FALSE;
lResult = lPvGenInteger->SetValue( durationOfHigh );