background image

 

GenICam_SDK.docx 

23 

csiCloseDataStream 

Close the data stream 

Syntax 

csiErr csiCloseDataStream(csiHandle dataStream) 

Parameters: 

In: dateStream 

A handle to the data stream to be closed. 

 

Out: None 

 

Return value: 

Returns csiSuccess or an error defined in the csiErr-Enum. 

Comment: 

Make sure to release all used buffers with 

csiReleaseImage

() and unregister all events with 

csiUnregisterEvent()

 

 before closing the data stream. Any buffer or event will be invalid after a call to this function. In addition, acquisition must be 
stopped before calling this function, se

csiStopAcquisition()

.  

 
 

csiRegisterEvent 

Register an event which will be signaled in the case the desired event is triggered 

Syntax 

csiErr csiRegisterEvent(csiHandle moduleHandle, csiEventType evtType, csiHandle* eventOut, csiModuleLevel module = 
 

CSI_DEVICE_MODULE) 

Parameters: 

In:   moduleHandle 

Handle to the module that is used to register an event. This can be either a device handle or a data 

 

 

 

stream handle.  

 

evtType  

The type of event that should be registered.  

 

 

module   

The module level where the event should be registered on.   

Out: eventOut 

A handle to the event that was registered. Use this handle to wait for events using the  

 

 

 

csiWaitForEvent()

 or 

csiGetNextImage()

 functions.

 

 

Return value: 

Returns csiSuccess or an error defined in the csiErr-Enum. 

Comment: 

 

 
 

csiWaitForEvent 

Wait for a desired event to happen 

Syntax 

csiErr csiWaitForEvent(csiHandle evt, uint64_t timeoutMilliseconds, csiEventData** evtDataOut) 

Parameters: 

In:  evt 

 

the handle of the event to wait for 

 

timeoutMilliseconds 

Timeout after the waiting stops if no event was received 

Out: evtDataOut 

the event data for further use. Se

csiEventData

In case of an error or timeout the output will be 

 

 

 

NULL, therefore please check the return value before using it. 

 

Return value: 

Returns csiSuccess or an error defined in the csiErr-Enum. 

Comment: 

After the event was registered with 

csiRegisterEvent() 

it is possible to actively wait for the event using this function. The 

waiting can be done asynchronously in a separate thread. This function must be called for each event separately. Please note 
that this function will return a more general representation of the event data (

csiEventData

). There exists also an event data 

structure for image data (

csiNewBufferEventData

) which contains more information on the image that was received.  

Note: 

Also see 

csiGetNextImage()

 which can be used as convenience function to wait for new image data events.

 

 
 

 

 

Содержание GEN I CAM-SDK

Страница 1: ...Chromasens GEN i CAM SDK Manual R03 2021 04 15 ...

Страница 2: ...9 3 4 Acquiring images 10 3 5 Examples 11 3 5 1 Build examples 11 4 List of SDK functions 12 4 1 Init Deinit functions 12 4 2 Connecting and closing a device 12 4 3 Getting and setting device parameters 15 4 4 Functions related to image acquisition 22 4 5 File transfer functions 26 4 6 Memory transfer functions 27 4 7 Helper functions 28 4 8 Enumerations 29 4 9 Structures 32 5 Installation 36 5 1 ...

Страница 3: ...or applications such as book and document scanners sorting systems and inspection systems for quality assurance monitoring Customers from all over the world of a wide range of industrial sectors have placed their trust in the experience of Chromasens in the field of industrial image processing 1 1 1Contact information Chromasens GmbH Max Stromeyer Str 116 78467 Konstanz Germany Phone 49 0 7531 876...

Страница 4: ... uint32_t numDevices double progress bool discoveryRunning Functions For example csiDiscoverDevices Searches for the devices currently connected to the system Syntax csiErr csiDiscoverDevices csiDiscoveryInfo discoveryInfoOut uint64_t timeoutMilliseconds csiDiscoveryInfoCallbackFunc discCallbackFunc NULL const char additionalSearchPaths NULL bool overrideSearchPath CSI_DEFAULT_PARAM_FALSE Paramete...

Страница 5: ... CCM Color conversion matrix The CCM supports the conversion from for example RGB to sRGB or any user defined conversion Corona II LED illumination Chromasens product DSNU Dark signal non uniformity Irregularity in the dark image GenICam Generic interface for cameras Generic programming interface for industrial cameras administered by the European Machine Vision Association www emva org CTI Common...

Страница 6: ...NU Photo response non uniformity Difference in sensitivity of the individual pixels ROI Region of interest RS485 ANSI standard defining the electrical characteristics of drivers and receivers for use in serial communications systems SFNC Standard Feature Naming Convention Document of the GenICam standard which provides feature names for common camera features VSync Vertical synchronization Frame s...

Страница 7: ... Chromasens Gen I Cam SDK is to provide a user friendly and easy way to handle all Chromasens cameras regardless of the physical interface Requirements Supported operating systems Windows Windows 10 Version 2 Linux Ubuntu 18 X Supported compiler Visual Studio 2015 GCC ...

Страница 8: ...ed again 3 2 Connecting to a camera The use of the Chromasens Gen I CAM SDK enables the user to use different transport layers and interfaces for the available devices Depending on the requirements for your application these transport layers can be selected during the device discovery process It is possible to use the standard search paths for the already installed transport layers These paths are...

Страница 9: ...y name minimum and maximum values etc This function is especially useful if you do not know the valid thresholds of a parameter Please be careful when treating string features You must not exceed the maximum length This can also be retrieved with the function csiGetFeatureParameter The parameter maximumStringLength of the csiFeatureParameter structure will indicate the maximum string length to set...

Страница 10: ...mages can be used 1 Using Events Events must be registered by the csiRegisterEvent function prior to the usage of the event 2 Directly calling the csiGetNextImage function Independent of these two ways the Acquisition from the device must be started first by calling csiStartAcquisition If enough images have been processed this needs to be stopped again by calling csiStopAcquisition After a receive...

Страница 11: ... csgenicam examples feature_iteration 3 5 1Build examples To build the examples requires CMake version v3 14 and a build environment The steps to build the examples are the same for both Windows and Linux 1 Open the CMake GUI and select the examples root directory as the source folder of your project Where is the source code 2 Next select a directory where to generate the project files should be s...

Страница 12: ...vailable transport layers Syntax csiErr csiDiscoverDevices csiDiscoveryInfo discoveryInfoOut uint64_t timeoutMilliseconds csiDiscoveryInfoCallbackFunc discCallbackFunc NULL const char additionalSearchPaths NULL bool overrideSearchPath false Parameters In timeoutMilliseconds The time until when a response from a device needs to be received when doing a discovery discCallbackFunc Pointer to a callba...

Страница 13: ...um Comment The SDK uses the environment variable GENICAM_GENTL64_PATH to search for available transport layers This function allows to request the number of transport layers available through that environment variable csiGetTLProducerInfoByIndex Returns additional information about a transport layer Syntax CSI_DLL_EXPORT csiErr csiGetTLProducerInfoByIndex csiTLProducerInfos tlProducerInfos int32_t...

Страница 14: ...e acquired CSI_DEV_MODE_CONTROL Camera parameters can be read and written Read access by another process to the device is still possible Out deviceHandleOut Handle to the device This handle needs to be used to any successive call Return value Returns csiSuccess or an error defined in the csiErr Enum Comment Depending on the used transport layer it might be necessary to use a longer timeout Please ...

Страница 15: ... an error defined in the csiErr Enum Comment csiSetFeatureBool Set a boolean feature on the device Syntax csiErr csiSetFeatureBool csiHandle device const char parameterName bool value csiModuleLevel module CSI_DEVICE_MODULE Parameters In device Handle provided by the csiOpenDevice function parameterName name Not the display name of the feature to set value Boolean value to set the feature to true ...

Страница 16: ...nDevice function parameterName name Not the display name of the feature to get module Module for which the parameter should be get Please use the enum csiModuleLevel to select Determines if the parameter should be retrieved from the device transport layer interface stream or buffer module Out valueOut Pointer to a double value where the current value of the feature will be written to Return value ...

Страница 17: ...iHandle device const char parameterName const char value csiModuleLevel module CSI_DEVICE_MODULE Parameters In device Handle provided by the csiOpenDevice function parameterName name Not the display name of the feature to set value pointer to a character array which contains the string to set module Module for which the parameter should be set Please use the enum csiModuleLevel to select Determine...

Страница 18: ...rrent value of the feature will be written to length Current length of the retrieved data Return value Returns csiSuccess or an error defined in the csiErr Enum Comment To avoid unexpected behavior it is recommended to retrieve the maximum buffer length before getting it from the device This can be achieved by using the function csiGetFeatureParameter This function will provide all necessary infor...

Страница 19: ...e Module for which the feature tree should be iterated Please use the enum csiModuleLevel to select Determines if the feature tree on the device transport layer interface stream or buffer module should be used Out featureNameOut name of the retrieved feature type type of the retrieved feature Return value Returns csiSuccess or an error defined in the csiErr Enum Comment If starting from the very b...

Страница 20: ... use the enum csiModuleLevel to select Determines if the parameter should be retrieved from the device transport layer interface stream or buffer module Out featureParamOut Name of the enumeration of the requested index Return value Returns csiSuccess or an error defined in the csiErr Enum Comment The enumeration string will be given in the csiFeatureParameter structure valueStr csiGetFeatureEnumE...

Страница 21: ... const char featureName void userObj csiUnRegisterInvalidateCB Unregister an invalidation callback function from a specific feature Syntax csiErr csiUnRegisterInvalidateCB csiHandle device const char featureName csiModuleLevel module CSI_DEVICE_MODULE Parameters In device Handle provided by the csiOpenDevice function featureName Name of the feature to unregister the callback from module Module for...

Страница 22: ...ned by csiGetNumberOfDataStreams Out dataStreamInfoOut Information about the selected data stream given by the dsIndex parameter or NULL if the data stream is not found See documentation on csiDataStreamInfo for more information Return value Returns csiSuccess or an error defined in the csiErr Enum Comment csiCreateDataStream Create a data stream to receive images Syntax csiErr csiCreateDataStream...

Страница 23: ...was registered Use this handle to wait for events using the csiWaitForEvent or csiGetNextImage functions Return value Returns csiSuccess or an error defined in the csiErr Enum Comment csiWaitForEvent Wait for a desired event to happen Syntax csiErr csiWaitForEvent csiHandle evt uint64_t timeoutMilliseconds csiEventData evtDataOut Parameters In evt the handle of the event to wait for timeoutMillise...

Страница 24: ...ll be canceled csiStartAcquisition Start the acquisition on the device and created data streams Syntax csiErr csiStartAcquisition csiHandle device csiAcquisitionMode mode Parameters In device Handle provided by the csiOpenDevice function mode Acquisition mode as defined in csiAcquisitionMode Out None Return value Returns csiSuccess or an error defined in the csiErr Enum Comment This function will ...

Страница 25: ...ssing buffer from the device Syntax csiErr csiReleaseImage csiHandle dataStream csiNewBufferEventData bufferInfo Parameters In dataStream the handle to the data stream this buffer belongs to This handle is also part of the csiNewBufferEventData structure bufferInfo Pointer to the buffer event data that was previously received from csiWaitForEvent or csiGetNextImage Out None Return value Returns cs...

Страница 26: ...by the csiOpenDevice function filename Full path of the fule to be uploaded filetype Type of the update file as returned from csiGetUpdateFileType timeOutMilliSeconds Timeout for the update procedure in milliseconds Note An update process might take several minutes depending on the type of file please choose a timeout of at least a few minutes here linstener Optional callback function that will be...

Страница 27: ...ame time the number of bytes to read from the address Out Return value Returns csiSuccess or an error defined in the csiErr Enum Comment csiWriteMemory Write memory to a register address on the device Syntax csiErr csiWriteMemory csiHandle device uint64_t address const char buffer size_t sizeBytes Parameters In device Handle provided by the csiOpenDevice function address Address of the register on...

Страница 28: ... an error defined in the csiErr Enum Comment csiGetErrorDescription Returns a human readable description of an error code Syntax csiErr csiGetErrorDescription csiErr error char bufferOut size_t bufferSize Parameters In error error code to retrieve the text for bufferSize size of the provided text buffer Out bufferOut char buffer where the error text will be written to Return value Returns csiSucce...

Страница 29: ...control mode read write other application might still be able to open it in read mode csiDeviceAccessStatus Defines the current access status of a device as returned from device discovery Definition typedef enum csiDeviceAccessStatus CSI_DEV_ACCESS_STATUS_UNKNOWN 0x00 CSI_DEV_ACCESS_STATUS_READWRITE 0x01 CSI_DEV_ACCESS_STATUS_READONLY 0x02 CSI_DEV_ACCESS_STATUS_NOACCESS 0x03 CSI_DEV_ACCESS_STATUS_...

Страница 30: ...typedef enum csiModuleLevel CSI_UNKNOWN_MODULE CSI_TRANSPORTLAYER_MODULE CSI_INTERFACE_MODULE CSI_DEVICE_MODULE CSI_LOCAL_DEVICE_MODULE CSI_STREAM_MODULE CSI_BUFFER_MODULE csiModuleLevel Elements CSI_UNKNOWN_MODULE Unknown module level CSI_TRANSPORTLAYER_MODULE Transport layer module System module CSI_INTERFACE_MODULE Interface module CSI_DEVICE_MODULE Device module CSI_LOCAL_DEVICE_MODULE Local d...

Страница 31: ...n is not available csiTimeout A timeout occurred csiAborted A pending operation was aborted csiFileOperationFailure There was an error during file operation see log for more information csiFileOperationFatalError There was a fatal error during file operation see log for more information csiNoAccess Access denied e g when trying to write a read only feature csiWrongBufferSize A given buffer was too...

Страница 32: ...ion int64_t valueInt Value of the feature in case of integer feature type int64_t incrementInt Possible increment for the feature value in case of integer feature type int64_t minimumInt Minimum for the feature value in case of integer feature type int64_t maximumInt Maximum for the feature value in case of integer feature type double valueFlt Value of the feature in case of floating point feature...

Страница 33: ... Progress information text Struct name csiTLProducerInfos Variable type Element name Description char transportLayerName Name of a transport layer char transportLayerDisplayName Display name of a transport layer for GUI representation char transportLayerType Type of the transport layer as string char transportLayerPath Full path to the transport layer library file cti file char transportLayerID Un...

Страница 34: ...his is always CSI_EVT_NEWIMAGEDATA for this type of event csiHandle sender Sender of the event a stream handle csiModuleLevel senderType Type of the sender this is always CSI_STREAM_MODULE for this type of event char tl_rawEventData Raw data pointer to the event data as it was sent by the producer This is just the raw data of the event which contains information about the type of event itself and ...

Страница 35: ...quisition uint64_t framesAcquired Total number of frames acquired in current acquisition uint64_t networkPacketsOK For GigE Vision The number of network packets received without errors uint64_t networkPacketsError For GigE Vision The number of network packets sent with an error ...

Страница 36: ...e CSGenICam cmake GCT The camera configuration and acquisition application with graphical interface Locations installation root bin gct exe SDK Examples Example source code C that shows the basic usage of the SDK Locations C Users Public Documents Chromasens GCT2 examples Documentation Documentation of the SDK Location installation root doc GenTL Producers Optional GenTL producers for Windows syst...

Страница 37: ...es to the system environment 5 2 3Installer Contents The software package is grouped into the following components SDK The programming interface and library for customer applications Locations usr lib libcsi so usr include csi csi h usr share CSGenICam cmake GCT The camera configuration and acquisition application with graphical interface Locations usr bin gct SDK Examples Example source code C th...

Страница 38: ...GenICam_SDK docx 38 Chromasens GmbH Max Stromeyer Straße 116 Phone 49 7531 876 0 www chromasens de 78467 Konstanz Fax 49 7531 876 303 info chromasens de Germany March 2021 Copyright by Chromasens GmbH ...

Отзывы: