Impact Acquire SDK C++
Locating And Using Methods

Method objects (ICommand nodes in GenICam) can be bound in exactly the same way however special care must be taken as their names contain information about the argument list of the method:

Device* pDev = getTheDevicePointerFromSomewhere();
Method triggerSoftware;
// create a locator object that can iterate and find a driver feature
DeviceComponentLocator locator(pDev, dltSetting, "Base");
// find the feature and bind it to the method object. Here it is crucial to notice that the exact name
// of a method object in mvIMPACT_Acquire is constructed from the actual feature name, the return type
// of the method and the arguments expected by the method (optional). More information about this topic
// can be found in the documentation of the 'Method' object.
locator.bindComponent( triggerSoftware, "TriggerSoftware@i" );
// '@i' indicates, that calling this function will return an integer
// (the result of the function call, which is either 0 or a negative value in case of an error)
// and takes no parameters
// now the method is ready to use when available:
if( triggerSoftware.isValid() )
{
int result = triggerSoftware.call(); // execute the command
if( result != DMR_NO_ERROR )
{
cout << "ERROR: " << ImpactAcquireException::getErrorCodeAsString( result ) << endl;
}
}
else
{
// oops... The feature is not offered by this device
}