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

mv.impact.acquire.Device pDev = getTheDevicePointerFromSomewhere();
mv.impact.acquire.Method triggerSoftware = new mv.impact.acquire.Method();
// create a locator object to find a certain feature
mv.impact.acquire.DeviceComponentLocator locator = new mv.impact.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)
{
TDMR_ERROR result = (TDMR_ERROR)triggerSoftware.call(); // execute the command
if(result != TDMR_ERROR.DMR_NO_ERROR)
{
Console.WriteLine("ERROR: {0}", mv.impact.acquire.ImpactAcquireException.getErrorCodeAsString(result));
}
}
else
{
// oops... The feature is not offered by this device
}
bool bindComponent(Component access, String name)
Binds an access object to an internal driver object.
Definition ComponentLocatorBase.cs:77
A class to locate components within the driver.
Definition DeviceComponentLocator.cs:74
This class and its functions represent an actual device detected by this interface in the current sys...
Definition Device.cs:91
An base class for exceptions generated by Impact Acquire.
Definition Exceptions.cs:9
static String getErrorCodeAsString(int errorCode)
Returns a string representation of a error.
Definition Exceptions.cs:48
A class to call arbitrary driver functions.
Definition Method.cs:17
This namespace contains classes and functions belonging to the image acquisition module of this SDK.
Definition Enumerations.cs:2
Definition Enumerations.cs:2
Definition Enumerations.cs:2