CreateEvent
Top  Previous  Next

Description

Creates a GenICam event sub-category with related features, registers and ports.

[C++]
int
 CreateEvent (unsigned int msgId, const char* name, const char* parentCategory, 
    bool
 evTimestamp, bool evChannelId, bool evFrameId);


Parameters
[C/C++]
 
[in] unsigned int msgID  
Integer value specifying the numerical ID of the event.  
 
[in] const char* name  
Name of the event to be created. Should not be NULL or empty.  
 
[in] const char* parentCategory  
Parent category under which the event sub-category will be created. The category must be created by a prior call to CreateEventCategory.  

[in] bool evTimestamp  
If TRUE, the event will contain the Timestamp feature.  

[in] bool evChannelID  
If TRUE, the event will contain the ChannelID feature.  

[in] bool evFrameID  
If TRUE, the event will contain the FrameID feature.  

Return Values


S_OK  
Success  
E_FAIL  
Failure  
E_NOINTERFACE  
Parent category does not exist  
 

Example


The following line of code creates the "AcquisitionTrigger" event sub-category in the "EventControl" category and adds related features, registers and ports.

m_pCamera->CreateEventCategory ("EventControl");  
m_pCamera->CreateEvent (0x8e94, "AcquisitionTrigger", "EventControl", True, False, False);  
 
As a result, the following code will be added to the XML file:
 
      <Enumeration Name="EventSelector" NameSpace="Standard">
<EnumEntry Name="AcquisitionTrigger">
<Value>0</Value>
       </EnumEntry>
       <pValue>regEventSelector</pValue>
   </Enumeration>
 
<Category Name="EventAcquisitionTriggerData" NameSpace="Standard">  
<pFeature>EventAcquisitionTrigger</pFeature>  
<pFeature>EventAcquisitionTriggerTimestamp</pFeature>  
</Category>  
 
<IntReg Name="regEventAcquisitionTrigger">  
<Address>0x1014C</Address>  
<Length>4</Length>  
<AccessMode>RO</AccessMode>  
<pPort>Device</pPort>  
<Sign>Unsigned</Sign>  
<Endianess>BigEndian</Endianess>  
</IntReg>  
 
<IntReg Name="regEventAcquisitionTriggerTimestamp">  
<Address>0x8</Address>  
<Length>8</Length>  
<AccessMode>RO</AccessMode>  
<pPort>EventAcquisitionTriggerPort</pPort>  
<Sign>Unsigned</Sign>  
<Endianess>BigEndian</Endianess>  
</IntReg>  
 
<Port Name="EventAcquisitionTriggerPort">  
<EventID>8e94</EventID>  
</Port>  


Remarks


This method automates the process of adding GenICam compliant events to the virtual camera. Per GenICam standard, for each event there should be a sub-category grouping all data members related to the particular event. In the example above a single call to CreateEvent creates the EventAcquisitionTriggerData sub-category, adds EventAcquisitionTrigger and EventAcquisitionTriggerTimestamp features to it, maps them to available registers and ports and adds a corresponding entry into the EventSelector feature..

Calls to CreateEvent should be preceded by a call to CreateEventCategory. To add additional data fields to the event, use CreateEventFeature.

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.