CreateEventFeature
Top  Previous  Next

Description

Creates a GenICam feature associated with a data field in the specified event.

[C++]
int
 CreateEventFeature (const char* name, const char* event, unsigned short type,  
         unsigned int 
offset, unsigned int length, const char* description = NULL);


Parameters
[C/C++]

[in] const char* name  
Name of the data field in the event. Must not be NULL or empty.  
 
[in] const char* event  
Name of the event.  
 
[in] unsigned short type  
Type of the feature to be created. Can be one of the following values:  
FEATURE_TYPE_UINTEGER - unsigned 32-bit integer feature, maps to a slider with value, minimum, maximum and increment  
FEATURE_TYPE_INTEGER - signed 32-bit integer feature, maps to a slider with value, min, maximum, increment and physical unit  
FEATURE_TYPE_INTEGER64 - signed 62-bit integer feature, maps to a slider with value, min, maximum, increment and physical unit  
FEATURE_TYPE_FLOAT - floating point 32-bit feature, maps to a slider with value, minimum, maximum and physical unit  
FEATURE_TYPE_STRING - string feature, maps to an edit box showing a string of text  
FEATURE_TYPE_BOOLEAN - boolean feature, maps to a check box  
FEATURE_TYPE_COMMAND - command feature, maps to a command button  
FEATURE_TYPE_ENUMERATION - enumeration feature, maps to dropdown box with a list of selectable items  
 
unsigned int offset  
[in] Integer value specifying the offset (in bytes) of the data field associated with the feature relative to the  
 
unsigned int length  
[in] Integer value specifying the length (in bytes) of the data field associated with the feature.  
 
const char* description  
[in] String containing the description of the feature.  
 

Return Values

S_OK  
Success  
E_FAIL  
Failure  
E_NOINTERFACE  
Event does not exist  
E_INVALIDARG  
Wrong feature type or access  
 
 
Example

This line of code adds the "ExposureTime" field to the "FrameStart" event:

m_pCamera->CreateEventFeature ("ExposureTime", "FrameStart", FEATURE_TYPE_FLOAT, 16, 4);  
 
As a result, the following code will be added to the XML file:

<Category Name="EventFrameStartData" NameSpace="Standard">  
    ..................................................  
<pFeature>EventFrameStartExposureTime</pFeature>  
</Category>  
 
<Float Name="EventFrameStartExposureTime">  
<pValue>regEventFrameStartExposureTime</pValue>  
</Float>  
<FloatReg Name="regEventFrameStartExposureTime" NameSpace="Custom">  
<Address>0x10</Address>  
<Length>4</Length>  
<AccessMode>RO</AccessMode>  
<pPort>EventFrameStartPort</pPort>  
<Endianess>BigEndian</Endianess>  
</FloatReg>  


Remarks


This method is used in conjunction with CreateEventCategory to automate the process of adding GenICam compliant events to the virtual camera. Per GenICam standard, each data field encapsulated in the event should be associated with a feature grouped under the event category. While CreateEventCategory can be used to create three standard data fields (Timestamp, ChannelID and FrameID), this method allows you to add additional data fields to the event.

Note that this method does not handle the event generation, but only adds event-related members to the camera's XML file. To send events to the network, use SendEvent, SendEvents, SendEventData.

The camera must be in the disconnected state in order for this method to work.