Impact Acquire SDK Java
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:

mvIMPACT.acquire.Device pDev = getTheDevicePointerFromSomewhere();
mvIMPACT.acquire.Method triggerSoftware = new mvIMPACT.acquire.Method();
// create a locator object to find a certain feature
mvIMPACT.acquire.DeviceComponentLocator locator = new mvIMPACT.acquire.DeviceComponentLocator( pDev, TDeviceListType.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() )
{
final int result = triggerSoftware.call(); // execute the command
if( result != TDMR_ERROR.DMR_NO_ERROR )
{
System.out.println( String.format( "ERROR: %s", mvIMPACT.acquire.ImpactAcquireException.getErrorCodeAsString( result ) ) );
}
}
else
{
// oops... The feature is not offered by this device
}