CreateAdvancedFeature
Top  Previous  Next

Description

Creates a custom GenICam feature with advanced functionality.

[C++]
int
 CreateAdvancedFeature (const char* type, const char* name, const char* category, 
    unsigned short
 namespace = FEATURE_NAMESPACE_CUSTOM);


Parameters
[C/C++]

[in] const char* type  
String indicating the type of the feature, such as "SwissKnife", "Converter", "ConfRom".  
 
[in] const char* name  
Name of the feature to be created. Must not be NULL or empty.  
 
[in] const char* category  
GenICam category under which the feature will be created. This parameter should be either "Root" or the name of the existing category created via CreateCategory.  

[in] unsigned short namespace  
Namespace to which the feature will belong. Can be one of the following values:  
FEATURE_NAMESPACE_STANDARD - feature will be created with the "Standard" namespace tag (recommended for features which follow the GenICam SFNC specifications).  
FEATURE_NAMESPACE_CUSTOM - feature will be created with the "Custom" namespace tag (recommended for features with proprietary names).  
 

Return Values

S_OK  
Success  
E_FAIL  
Failure  
E_NOINTERFACE  
Category does not exist  
 
 
Example

This fragment of code creates an advanced feature "MaxFrameRate" of the SwissKnife type, then adds several elements and attributes to it.

CreateCustomFeature("SwissKnife", "MaxFrameRate", "");  
 
SetFeatureElement("MaxFrameRate", "pVariable", "regPayloadSize", true);  
SetFeatureElement("MaxFrameRate", "pVariable", "regExposureTime", true);  
SetFeatureElement("MaxFrameRate", "pVariable", "regMultiplierFPS", true);  
SetFeatureElement("MaxFrameRate", "Formula", "( (1000000000 / 8 / PS < 1000000 / ET) ? (1000000000 / 8 / PS) * MUL : (1000000 / ET) * MUL)", true);  
 
CreateElementAttribute("MaxFrameRate", "pVariable", "regPayloadSize", "Name", "PS");  
CreateElementAttribute("MaxFrameRate", "pVariable", "regExposureTime", "Name", "ET");  
CreateElementAttribute("MaxFrameRate", "pVariable", "regMultiplierFPS", "Name", "MUL");  

As a result, the following feature description will appear in the camera XML file::

<SwissKnife Name="MaxFrameRate" NameSpace="Custom">
<pVariable Name="PS">regPayloadSize</pVariable>
<pVariable Name="ET">regExposureTime</pVariable>
<pVariable Name="MUL">regMultiplierFPS</pVariable>
<Formula>( (1000000000 / 8 / PS &lt; 1000000 / ET) ? (1000000000 / 8 / PS) * MUL : (1000000 / ET) * MUL)</Formula>
</SwissKnife>


Remarks


Use this method to create features of advanced types not covered by CreateFeature. Advanced types of features include "SwissKnife", "IntSwissKnife", "Converter", "IntConverter", "ConfRom", "TextDesc", "IntKey". A creation of an advanced feature is typically followed by setting up its elements and attributes with SetFeatureElement and CreateElementAttribute.
.
The use of this method requires an advanced knowledge of the GenICam standard and XML syntax. For more information please refer to the description of the GenICam standard available at www.genicam.org
.

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

It is recommended to change the version of your virtual camera device each time you modify the set of features (see SetDeviceInfo). If this is not done, a client GigE Vision application may use a copy of an old XML information file from its cache folder and remain unaware of your changes. If you do not want to use the device version control, make sure to locate an XML cache folder of your client application and delete an XML file in it each time the set of features of the virtual camera has been modified. This should be done on each computer running the client software.