The function interface class provides access to most of the devices executable functions, while most of the settings (e.g. the exposure time or the trigger mode) are implemented as properties (see e.g. mv.impact.acquire.Property for details).
Getting the first image might e.g. look like that:
static void Main(string[] args)
{
{
Console.WriteLine("No device found! Unable to continue! Press any key to end the program.");
Console.Read();
Environment.Exit(1);
}
Console.WriteLine("Initialising device {0}. This might take some time...", pDev.serial.read());
try
{
}
catch (ImpactAcquireException e)
{
Console.WriteLine("An error occurred while opening the device " + pDev.serial +
"(error code: " + e.Message + "). Press any key to end the application...");
Console.ReadLine();
Environment.Exit(1);
}
fi.imageRequestSingle();
{
if ((result = (TDMR_ERROR)fi.acquisitionStart()) !=
TDMR_ERROR.DMR_NO_ERROR)
{
Console.WriteLine("'FunctionInterface.acquisitionStart' returned with an unexpected result: {0}({1})", result, ImpactAcquireException.getErrorCodeAsString(result));
}
}
int requestNr = fi.imageRequestWaitFor(-1);
if (!fi.isRequestNrValid(requestNr))
{
Console.WriteLine("imageRequestWaitFor failed ({0}, {1}), timeout value too small? Press any key to end the application...", requestNr, ImpactAcquireException.getErrorCodeAsString(requestNr));
Console.ReadLine();
Environment.Exit(1);
}
if (!pRequest->isOK())
{
Console.WriteLine("Error: {0}", pRequest.requestResult.readS());
Environment.Exit(1);
}
fi.imageRequestUnlock(requestNr);
}
Grants access to devices that can be operated by this software interface.
Definition DeviceManager.cs:157
static Device getDevice(int index)
Returns a pointer to a mv.impact.acquire.Device object.
Definition DeviceManager.cs:438
static int deviceCount
Returns the number of devices currently present in the system.
Definition DeviceManager.cs:1064
void open()
Opens a device.
Definition Device.cs:209
T read()
Reads a value from a property.
Definition EnumPropertyI.cs:342
The function interface to devices supported by this interface.
Definition FunctionInterface.cs:21
Contains information about a captured buffer.
Definition Request.cs:77
readonly PropertyI imageWidth
An integer property (read-only) containing the width of the image in pixels.
Definition Request.cs:1693
TDMR_ERROR
Errors reported by the device manager.
Definition mvDriverBaseEnums.cs:2375
TAcquisitionStartStopBehaviour
Defines valid modes for acquisition start/stop behaviour.
Definition mvDriverBaseEnums.cs:76
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
This sample contains everything the user needs to do to capture one image including all initialization work and error handling for every source of error one can think of.