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();
mvIMPACT.acquire.DeviceComponentLocator locator = new mvIMPACT.acquire.DeviceComponentLocator( pDev, TDeviceListType.dltSetting, "Base" );
locator.bindComponent( triggerSoftware, "TriggerSoftware@i" );
if( triggerSoftware.isValid() )
{
final int result = triggerSoftware.call();
if( result != TDMR_ERROR.DMR_NO_ERROR )
{
System.out.println( String.format( "ERROR: %s", mvIMPACT.acquire.ImpactAcquireException.getErrorCodeAsString( result ) ) );
}
}
else
{
}