background image

 

 

 

 

1/33 

Sentech GigE Vision Camera StGigE SDK 
Sample Guide Rev.1.00 

 
 

Sentech GigE Vision Camera 

StGigE SDK 

 

Sample Guide

 

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Sensor Technology Co., Ltd. 

Summary of Contents for GigE Vision

Page 1: ...1 33 Sentech GigE Vision Camera StGigE SDK Sample Guide Rev 1 00 Sentech GigE Vision Camera StGigE SDK Sample Guide Sensor Technology Co Ltd ...

Page 2: ...e 10 1 12 PvPlcAndGevEvents 11 1 13 PvPlcDelayerSample 12 1 14 PvPlcRescalerSample 12 1 15 PvRecoverySample 13 1 16 PvRGBFilterSample 13 1 17 PvSimpleUISample 14 1 18 PvStreamSample 14 1 19 NetCommandSample 15 1 20 StGEViewerSample 15 1 21 StGEMultiCameraSample 15 1 22 StGEOpenCVFacesDetectSample 16 1 23 StGEOpenCVSharpSample 16 2 The sample programs for the specific usages 17 2 1 Software trigger...

Page 3: ... This sample is the source code for the StGigE Player application StGigE Player application is used to connect and configure the GigE Vision camera 1 Introduction This sample help to understand how to use StGigE SDK 2 Prerequisite Please check the StGigE Player application before use this sample code It is necessary to understand and have the knowledge about C and Microsoft MFC foundation class 3 ...

Page 4: ... Images under Tools in the menu 3 11 LoadingThread cpp The source code file for the thread which is created the class of the asynchronous load from the pvcfg file and the connection procedure and pass the message to the ProgressDlg Please check ProgressDlg cpp 3 12 LogBuffer cpp The source code file for use the log events for Event Monitor dialog Please check EventMonitorDlg cpp 3 13 ParameterInfo...

Page 5: ...on 1 3 PvBufferWriterSample This sample shows how to use the PvBuffer and the PvBufferWriter classes 1 Introduction This sample shows how to Creates and allocates the buffer and obtains the image with the PvBuffer class Saves the buffer data to the bitmap format file with the PvBufferWriter class 2 Prerequisite When use this sample The camera has to connect to the NIC which is installed either the...

Page 6: ...ns excluding the image streaming and display thread are in the PvCamHeadSerialComLogSampleDlg 2 Prerequisite When use this sample The camera has to connect to the NIC which is installed either the eBUS Universal Pro or the Optimal driver before use this sample 3 Descriptions of the files 3 1 PvCamHeadSerialComLogSampleDlg cpp The source code file for the main application dialog The most of the eve...

Page 7: ...this sample 3 Descriptions of the files 3 1 PvConfigurationReaderSample cpp The source code file for the sample program of how to use the PvConfigurationReader and the PvConfigurationWriter classes Please check the comments in this source code for the information which is how to use these classes 1 6 PvCustomPipelineSample This sample shows how to use the PvPipeline class 1 Introduction This sampl...

Page 8: ... PvGenParameterArray class to control the settings of the camera 1 Introduction This sample shows how to Obtains the PC communication related settings with the PvGenParameterArray class Obtains the settings of the camera with the PvGenParameterArray class Obtains the image stream control settings with the PvGenParameterArray class Obtains and sets the PvGenParameter value with the PvGenParameter c...

Page 9: ... source code file for the sample program of how to use the PvDevice class Please check the comments in this source code for the information which is how to use this class 1 10 PvMulticastSlaveSample This sample shows how to use the PvPipeline class to use the multicast slave Please connects the camera as the multicast master with the multicasting master sample PvMulticastSample before use this sam...

Page 10: ...the image from the camera Statistics the data of obtain the image Stops the streaming 2 Prerequisite When use this sample The camera has to connect to the NIC which is installed either the eBUS Universal Pro or the Optimal driver before use this sample 3 Descriptions of the files 3 1 PvPipelineSample cpp The source code file for the sample program of how to use the PvPipeline class Please check th...

Page 11: ...if PLC_I4 PLC_ctrl1 3 2 PLC LUT setup PLC_Q7 I0 PLC_Interrupt PLC_Q17 I0 Counter increament signal PLC_Q3 I4 Counter reset 3 3 Enable PLC_Interrupt_FIFO0_Q7 and register PLC_Interrupt_FIFI0_IRQ_mask parameter to the PvGenEventSink Updates this parameter when the PLC interrupt happens After update the PvGenEventSink OnParameterUpdate callback function call 3 4 Setup as the rising edge of PLC_Q17 si...

Page 12: ...ore use this sample 3 Descriptions of the files 3 1 PvPlcDelayerSample cpp The source code file for emits 23 Hz signal wave pulse with Timer Pulse Generator 0 Delayer makes the delay for the input signal Please check the comments in this source code for the information which is how to use this class NOTE This sample is based on the Demonstrating the Rescaler tutorial in the Programmable Logic Cont...

Page 13: ...ion that obtains the image Please check the comments in this source code for the information which is how to use these classes Sentech GigE cameras do NOT have the DeviceReset function in this 1 16 PvRGBFilterSample This sample shows how to use the PVBufferConverter and the PvFilterRGB to convert the image This sample shows how to use the PvBufferWrite class to save the image into bitmap file 1 In...

Page 14: ...e The camera has to connect to the NIC which is installed either the eBUS Universal Pro or the Optimal driver before use this sample 3 Descriptions of the files 3 1 PvSimpleUISample cpp The source code file for the create UI application 1 18 PvStreamSample This sample shows how to connects the camera obtains and displays the image with the PvStream class 1 Introduction This sample shows how to Con...

Page 15: ...stand how to setup the camera with the GenICam command This sample help to understand how to setup the camera with the PVSerialPortIPEngine class 2 Prerequisite When use this sample Please use the Visual Studio 2008 VS9 Required to understand the C and the Microsoft MFC Please build to make the application to understand the operation 1 21 StGEMultiCameraSample This sample shows how to connect and ...

Page 16: ...stand the C and the Microsoft MFC Please build to make the application to understand the operation This sample made with OpenCV2 1 0 1 23 StGEOpenCVSharpSample This sample shows how to make the un sharp mask sample program with OpenCV Please download OpenCV than make the library to use it 1 Introduction This sample help to understand how to connects the camera and obtains the image This sample hel...

Page 17: ... 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_...

Page 18: ...xt3 if lResult IsOK return FALSE sprintf PLCText PLC_Q d_Operator1 iQ lPvGenEnum dynamic_cast PvGenEnum pDevice GetGenParameters Get PLCText if lPvGenEnum NULL return FALSE lResult lPvGenEnum SetValue pText4 if lResult IsOK return FALSE sprintf PLCText PLC_Q d_Variable2 iQ lPvGenEnum dynamic_cast PvGenEnum pDevice GetGenParameters Get PLCText if lPvGenEnum NULL return FALSE lResult lPvGenEnum SetV...

Page 19: ... 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 ...

Page 20: ...L return FALSE lResult lPvGenEnum SetValue bTrgMode if lResult IsOK return FALSE return TRUE D 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 PvGenEnum dynamic_cast PvGenEnum pDevice GetGenParameters Get TriggerMode if lPvGenEnum N...

Page 21: ...PvGenEnum dynamic_cast PvGenEnum pDevice GetGenParameters Get TriggerSoftwareSource if lPvGenEnum NULL return FALSE PvResult lResult lPvGenEnum SetValue iTriggerSoftwareSource return BOOL lResult IsOK H Input the trigger 1mseconds pulse input to the PLC_ctrl0 BOOL OneShotTrigger PvDevice pDeivce BOOL bResult bResult SetControlBit pDeivce 0 true if bResult return FALSE Sleep 1 1mS bResult SetContro...

Page 22: ...PvGenEnum 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 PvRe...

Page 23: ...ftwareSource 0 PLC 1 UserFPGA 2 Command BOOL SetTriggerSoftwareSource PvDevice pDevice int iTriggerSoftwareSource PvGenEnum lPvGenEnum dynamic_cast PvGenEnum pDevice GetGenParameters Get TriggerSoftwareSource if lPvGenEnum NULL return FALSE PvResult lResult lPvGenEnum SetValue iTriggerSoftwareSource return BOOL lResult IsOK G Input the trigger BOOL SetTriggerSoftware PvDevice pDevice PvGenCommand ...

Page 24: ...ionTimeout 2000 lResult lSystem Find if lResult IsOK printf PvSystem Find Error s n lResult GetCodeString else PvUInt32 lInterfaceCount lSystem GetInterfaceCount for PvUInt32 x 0 x lInterfaceCount x get pointer to each of interface PvInterface lInterface lSystem GetInterface x printf Interface i MAC Address s IP Address s Subnet Mask s n x lInterface GetMACAddress GetUnicode lInterface GetIPAddres...

Page 25: ... 255 0 Changes to the specified Subnet Mask lGateway 0 0 0 0 Changes to the specified Default Gateway Address BOOL ChangeDeviceInformation PvDeviceInfo lDeviceInfo PvString lIPAddress PvString lSubnetmask PvString lGateway PvDevice lDevice PvResult lResult lDevice SetIPConfiguration lDeviceInfo GetMACAddress lIPAddress lSubnetmask lGateway return BOOL lResult IsOK ...

Page 26: ...dynamic_cast PvGenInteger lGenDevice Get GevCurrentIPAddress if lPersistentIPBoolean return FALSE PvGenInteger lSubnetMaskParam dynamic_cast PvGenInteger lGenDevice Get GevCurrentSubnetMask if lSubnetMaskParam return FALSE PvGenInteger lGatewayParam dynamic_cast PvGenInteger lGenDevice Get GevCurrentDefaultGateway if lSubnetMaskParam return FALSE lResult lIPAddressParam GetValue lIPAddress if lRes...

Page 27: ...27 33 Sentech GigE Vision Camera StGigE SDK Sample Guide Rev 1 00 lResult lFlushGatewayParam SetValue lGateway if lResult IsFailure return FALSE return TRUE ...

Page 28: ...e printf d ParameterName s n i aName GetAscii Description p_pvPara GetDescription lStr printf Description s n lStr GetAscii Category p_pvPara GetCategory lStr printf Category s n lStr GetAscii Visibility p_pvPara GetVisibility lVisibility if lVisibility 0 lStr Beginner else if lVisibility 1 lStr Expert else if lVisibility 2 lStr Guru else lStr Invisible printf Visibility s n lStr GetAscii Type PvG...

Page 29: ...tryCount j const PvGenEnumEntry lEntry NULL lGenEnum GetEntryByIndex j lEntry lEntry GetName strValue printf Entry d s n j strValue GetAscii else if aType PvGenTypeBoolean 2 PvGenBoolean lGenBoolean dynamic_cast PvGenBoolean p_pvPara lResult lGenBoolean GetValue bValue if lResult IsOK printf Value d n bValue else if aType PvGenTypeString 3 PvGenString lGenString dynamic_cast PvGenString p_pvPara l...

Page 30: ...30 33 Sentech GigE Vision Camera StGigE SDK Sample Guide Rev 1 00 return TRUE ...

Page 31: ...lse lResult pPort Open pDevice PvIPEngineSerial1 return lResult IsOK SerialPort Close BOOL SerialPortClose PvSerialPortIPEngine pPort BOOL bReval TRUE if pPort IsOpened PvResult lResult pPort Close bReval lResult IsOK return bReval Data Send and Recieve BOOL SerialDataSendRev PvSerialPortIPEngine pPort PBYTE pbyteSend WORD wSendsize PBYTE pbyteRev WORD wRevsize PWORD pReadsize PvUInt32 aBytesWritt...

Page 32: ...eval return FALSE BYTE byteSend 0x02 0x00 0x30 0x01 0x00 0x03 printf SendData for int i 0 i sizeof byteSend i printf 02X byteSend i printf n n BYTE byteRcv 4 WORD wReadSize 0 bReval SerialDataSendRev lSerialPort byteSend 0 sizeof byteSend byteRcv 0 sizeof byteRcv wReadSize if bReval printf RcvData for int i 0 i wReadSize i printf 02X byteRcv i printf n n SerialPortClose lSerialPort return bReval ...

Page 33: ...ide Rev 1 00 Revision History Rev Date Changes Note 2 00 2012 11 05 New document Sensor Technology Co Ltd 7F Harada center building 9 17 Naka cho 4 chome Atsugi city Kanagawa 243 0018 Japan TEL 81 46 295 7061 FAX 81 46 295 7066 URL http www sentech co jp ...

Reviews: