Impact Acquire SDK .NET
DeviceManager Class Reference

Grants access to devices that can be operated by this software interface. More...

Static Public Member Functions

static Device getDevice (int index)
 Returns a pointer to a mv.impact.acquire.Device object.
 
static Device getDeviceByFamily (String family)
 Tries to locate a device via the family name.
 
static Device getDeviceByFamily (String family, int devNr)
 Tries to locate a device via the family name.
 
static Device getDeviceByFamily (String family, int devNr, char wildcard)
 Tries to locate a device via the family name.
 
static Device getDeviceByProduct (String product)
 Tries to locate a device via the product name.
 
static Device getDeviceByProduct (String product, int devNr)
 Tries to locate a device via the product name.
 
static Device getDeviceByProduct (String product, int devNr, char wildcard)
 Tries to locate a device via the product name.
 
static Device getDeviceByProductAndID (String product)
 Tries to locate a device via the product name and the device ID.
 
static Device getDeviceByProductAndID (String product, int devID)
 Tries to locate a device via the product name and the device ID.
 
static Device getDeviceByProductAndID (String product, int devID, char wildcard)
 Tries to locate a device via the product name and the device ID.
 
static Device getDeviceByProductAndID (String product, String devID)
 Tries to locate a device via the product name and the device ID.
 
static Device getDeviceByProductAndID (String product, String devID, char wildcard)
 Tries to locate a device via the product name and the device ID.
 
static Device getDeviceBySerial (String serial)
 Tries to locate a device via the serial number.
 
static Device getDeviceBySerial (String serial, int devNr)
 Tries to locate a device via the serial number.
 
static Device getDeviceBySerial (String serial, int devNr, char wildcard)
 Tries to locate a device via the serial number.
 
static String getVersionAsString (TLibraryQuery libraryQuery)
 Returns a string containing the version number of the specified library.
 
static void updateDeviceList ()
 Updates the internal device list.
 

Properties

static uint changedCount [get]
 Returns the current changed counter for the device list.
 
static int deviceCount [get]
 Returns the number of devices currently present in the system.
 
static ReadOnlyCollection< DevicedeviceList [get]
 Returns a list of all devices currently detected by the device manager.
 
static ComponentList internalHandle [get]
 Returns the internal handle to the device manager.
 
static bool isDotNETBitmapSupportAvailable [get]
 

Detailed Description

Grants access to devices that can be operated by this software interface.

This class will grant access to any device installed on/in the current system. Whenever somewhere in the code a mv.impact.acquire.DeviceManager instance is created it can be used to access any device currently supported and available.

This is the only class which is allowed to create instances of the class mv.impact.acquire.Device, which are needed to access a certain device.

If a device is installed in the system but an appropriate driver has not been installed, this class will NOT list these devices.

As a result of this every program written by the use of this interface will create an instance of mv.impact.acquire.DeviceManager before performing any other operations which uses objects or functions from this interface.

During the construction of a mv.impact.acquire.DeviceManager object the system will be scanned for supported devices and once the instance has been created the object will provide an up to date list of devices whenever the user asks for it. Some devices when plugged into the system after the device manager has been created might require an explicit update of the device list. This can be triggered by an application by calling mv.impact.acquire.DeviceManager.updateDeviceList().

This class also provides various functions to find a particular device in the system. Devices can e.g. be found by family or by serial number.

Note
There always has to be at least one instance of the DeviceManager when the user still works with Device objects, as when the last instance to this object is destroyed all remaining Device objects will be closed automatically!
Attention
NEVER try to explicitly delete an instance of mv.impact.acquire.Device! You did not allocate it and the result will be a crash! The mv.impact.acquire.DeviceManager will take care of all resources for you.
Note
A mv.impact.acquire.DeviceManager object will initially return pointers to mv.impact.acquire.Device objects, which all seem to be closed. However one or more of the devices might have been opened by another instance of the device manager running in a different process. In that case the attempt to open a device, which seems to be closed will raise an exception with the error code mv.impact.acquire.TDMR_ERROR.DMR_DRV_ALREADY_IN_USE, which MUST be handled by the user.

EXAMPLE CODE:

//-----------------------------------------------------------------------------
public void obtainDevicePointers( void )
//-----------------------------------------------------------------------------
{
// show all devices
for( int i=0; i<devCount; i++ )
{
Console.WriteLine("Dev {0}: {1}", i, DeviceManager.getDevice(i).serial.read());
}
// try to find a device using a special criteria
// ( some of these calls will fail!!! )
// will fail as the string is not complete and does
// NOT terminate with a wildcard.
// might work if there are at least two devices with
// a matching serial number in the system.
// might work if there is at least one device whose type
// specifying string starts with 'SampleDevi'.
// will fail as the string is not complete and does NOT
// terminate with the user defined wildcard.
pDev = DeviceManager.getDeviceByProduct( "SampleD*", 0, '$' );
// will work if there is a device whose product name
// starts with 'SamplePro' and which has
// been assigned the specified device ID.
pDev = DeviceManager.getDeviceByProductAndID( "SamplePro*", 66, '*' );
// will work if there is at least one device with a serial
// number starting with 'SD00' in the system.
// will return a pointer to the first device detected thus
// this call will work if there is at least one device in the
// current system that is supported by this interface
if( !pDev )
{
cout << "Error! No valid device found" << endl;
return 0;
}
// from here it will be save to work with the pointer returned
// by device manager.
// THE NEXT LINE WILL TRY TO OPEN THE DEVICE! This can fail if the device
// is already running in a different process!
try
{
FunctionInterface func(pDev);
// do some work
}
catch(ImpactAcquireException e)
{
// failed to open the device...
}
}
//-----------------------------------------------------------------------------
public void showDeviceManagerOperation( void )
//-----------------------------------------------------------------------------
{
Device pDev = null;
{
// will return a pointer to the first device detected thus
// this call will work if there is at least one device in the
// current system that is supported by this interface
pDev = DeviceManager.getDeviceBySerial( "*" );
if( pDev == null )
{
Console.WriteLine( "Error! No valid device found" );
return;
}
// from here it will be save to work with the pointer returned
// by device manager.
// THE NEXT LINE WILL TRY TO OPEN THE DEVICE! This can fail if the device
// is already running in a different process!
try
{
FunctionInterface func = new FunctionInterface(pDev);
// do some work
}
catch(ImpactAcquireException e)
{
// failed to open the device...
}
Statistics s = new Statistics(pDev); // this will still work
}
}
Grants access to devices that can be operated by this software interface.
Definition DeviceManager.cs:157
static Device getDeviceByProductAndID(String product)
Tries to locate a device via the product name and the device ID.
Definition DeviceManager.cs:832
static Device getDeviceByProduct(String product)
Tries to locate a device via the product name.
Definition DeviceManager.cs:707
static Device getDevice(int index)
Returns a pointer to a mv.impact.acquire.Device object.
Definition DeviceManager.cs:438
static Device getDeviceByFamily(String family)
Tries to locate a device via the family name.
Definition DeviceManager.cs:587
static Device getDeviceBySerial(String serial)
Tries to locate a device via the serial number.
Definition DeviceManager.cs:474
static int deviceCount
Returns the number of devices currently present in the system.
Definition DeviceManager.cs:1064
This class and its functions represent an actual device detected by this interface in the current sys...
Definition Device.cs:91
A template class to represent 32 bit integer properties and 32 bit enumerated integer properties.
Definition EnumPropertyI.cs:61
T read()
Reads a value from a property.
Definition EnumPropertyI.cs:342
Examples
ContinuousCaptureAllDevices.cs, and ContinuousSaveImage.cs.

Member Function Documentation

◆ getDevice()

static Device getDevice ( int index)
inlinestatic

Returns a pointer to a mv.impact.acquire.Device object.

Returns a pointer to a mv.impact.acquire.Device object specifying the device found at the given index in the device managers internal list.

See also
mv.impact.acquire.DeviceManager.deviceCount,
mv.impact.acquire.DeviceManager.getDeviceBySerial,
mv.impact.acquire.DeviceManager.getDeviceByFamily,
mv.impact.acquire.DeviceManager.getDeviceByProduct
Returns
  • A pointer to the device if index specifies a valid value.
  • an exception will be raised otherwise.
Parameters
[in]indexThe index of the device to be returned.
Examples
ContinuousSaveImage.cs.

◆ getDeviceByFamily() [1/3]

static Device getDeviceByFamily ( String family)
inlinestatic

Tries to locate a device via the family name.

This function tries to find a device by its family (or parts of this family name). The user can specify only parts of the family name and a wildcard. The mv.impact.acquire.DeviceManager object will then try to find the device that matches these parameters in its current list. The family is the most general method of searching for a device apart from 'any device'. E.g. for a device the family name might be 'SampleDevice'

Examples

// this will return a pointer to the second 'SampleDevice'
// device found or null if there are no 2 'SampleDevice'
// devices in the system
getDeviceByFamily( "SampleD*", 1, '*' );
// will return a pointer to the first device belonging
// to the 'SampleDevice' family if present or 0.
getDeviceByFamily( "SampleDevice" );
// will return the first recognized device in the system
getDeviceByFamily( "*", 0, '*' );
See also
mv.impact.acquire.DeviceManager.getDeviceBySerial,
mv.impact.acquire.DeviceManager.getDeviceByProduct,
mv.impact.acquire.DeviceManager.getDeviceByProductAndID
Returns
  • A pointer to the device if found.
  • An invalid pointer or reference otherwise.
Parameters
[in]familyThe full family name of the requested device or known parts of it and wildcard characters.

◆ getDeviceByFamily() [2/3]

static Device getDeviceByFamily ( String family,
int devNr )
inlinestatic

Tries to locate a device via the family name.

This function tries to find a device by its family (or parts of this family name). The user can specify only parts of the family name and a wildcard. The mv.impact.acquire.DeviceManager object will then try to find the device that matches these parameters in its current list. The family is the most general method of searching for a device apart from 'any device'. E.g. for a device the family name might be 'SampleDevice'

Examples

// this will return a pointer to the second 'SampleDevice'
// device found or null if there are no 2 'SampleDevice'
// devices in the system
getDeviceByFamily( "SampleD*", 1, '*' );
// will return a pointer to the first device belonging
// to the 'SampleDevice' family if present or 0.
getDeviceByFamily( "SampleDevice" );
// will return the first recognized device in the system
getDeviceByFamily( "*", 0, '*' );
See also
mv.impact.acquire.DeviceManager.getDeviceBySerial,
mv.impact.acquire.DeviceManager.getDeviceByProduct,
mv.impact.acquire.DeviceManager.getDeviceByProductAndID
Returns
  • A pointer to the device if found.
  • An invalid pointer or reference otherwise.
Parameters
[in]familyThe full family name of the requested device or known parts of it and wildcard characters.
[in]devNrThe number of the device to return (if there is more than one candidate).

◆ getDeviceByFamily() [3/3]

static Device getDeviceByFamily ( String family,
int devNr,
char wildcard )
inlinestatic

Tries to locate a device via the family name.

This function tries to find a device by its family (or parts of this family name). The user can specify only parts of the family name and a wildcard. The mv.impact.acquire.DeviceManager object will then try to find the device that matches these parameters in its current list. The family is the most general method of searching for a device apart from 'any device'. E.g. for a device the family name might be 'SampleDevice'

Examples

// this will return a pointer to the second 'SampleDevice'
// device found or null if there are no 2 'SampleDevice'
// devices in the system
getDeviceByFamily( "SampleD*", 1, '*' );
// will return a pointer to the first device belonging
// to the 'SampleDevice' family if present or 0.
getDeviceByFamily( "SampleDevice" );
// will return the first recognized device in the system
getDeviceByFamily( "*", 0, '*' );
See also
mv.impact.acquire.DeviceManager.getDeviceBySerial,
mv.impact.acquire.DeviceManager.getDeviceByProduct,
mv.impact.acquire.DeviceManager.getDeviceByProductAndID
Returns
  • A pointer to the device if found.
  • An invalid pointer or reference otherwise.
Parameters
[in]familyThe full family name of the requested device or known parts of it and wildcard characters.
[in]devNrThe number of the device to return (if there is more than one candidate).
[in]wildcardThe character to ignore in family.

◆ getDeviceByProduct() [1/3]

static Device getDeviceByProduct ( String product)
inlinestatic

Tries to locate a device via the product name.

This function tries to find a device by its product name (or parts of it). The user can specify only parts of the name and a wildcard. The mv.impact.acquire.DeviceManager object will then try to find the device that matches these parameters in its current list. The product name is a bit more specific than the family name, but less specific than the serial. For the 'SampleDevice' for example there might be different product names for different device types. This might e.g. be 'SampleDevice-G' for a grey version of the sample device and 'SampleDevice-C' for the color version of the sample device.

Examples

// this will return a pointer to the second sample
// device of type 'G' found or null if there aren't
// two devices of this type in the system
getDeviceByProduct( "SampleDevice-G", 1 );
// will return a pointer to the first device whose
// product string starts with 'SampleDev' or null if
// no such device can be found.
getDeviceByProduct( "SampleDev*", 0, '*' );
// will return the first recognized device in the system
getDeviceByProduct( "*", 0, '*' );
See also
mv.impact.acquire.DeviceManager.getDeviceBySerial,
mv.impact.acquire.DeviceManager.getDeviceByFamily,
mv.impact.acquire.DeviceManager.getDeviceByProductAndID
Returns
  • A pointer to the device if found.
  • An invalid pointer or reference otherwise.
Parameters
[in]productThe full product name of the requested device or known parts of it and wildcard characters.

◆ getDeviceByProduct() [2/3]

static Device getDeviceByProduct ( String product,
int devNr )
inlinestatic

Tries to locate a device via the product name.

This function tries to find a device by its product name (or parts of it). The user can specify only parts of the name and a wildcard. The mv.impact.acquire.DeviceManager object will then try to find the device that matches these parameters in its current list. The product name is a bit more specific than the family name, but less specific than the serial. For the 'SampleDevice' for example there might be different product names for different device types. This might e.g. be 'SampleDevice-G' for a grey version of the sample device and 'SampleDevice-C' for the color version of the sample device.

Examples

// this will return a pointer to the second sample
// device of type 'G' found or null if there aren't
// two devices of this type in the system
getDeviceByProduct( "SampleDevice-G", 1 );
// will return a pointer to the first device whose
// product string starts with 'SampleDev' or null if
// no such device can be found.
getDeviceByProduct( "SampleDev*", 0, '*' );
// will return the first recognized device in the system
getDeviceByProduct( "*", 0, '*' );
See also
mv.impact.acquire.DeviceManager.getDeviceBySerial,
mv.impact.acquire.DeviceManager.getDeviceByFamily,
mv.impact.acquire.DeviceManager.getDeviceByProductAndID
Returns
  • A pointer to the device if found.
  • An invalid pointer or reference otherwise.
Parameters
[in]productThe full product name of the requested device or known parts of it and wildcard characters.
[in]devNrThe number of the device to return (if there is more than one candidate).

◆ getDeviceByProduct() [3/3]

static Device getDeviceByProduct ( String product,
int devNr,
char wildcard )
inlinestatic

Tries to locate a device via the product name.

This function tries to find a device by its product name (or parts of it). The user can specify only parts of the name and a wildcard. The mv.impact.acquire.DeviceManager object will then try to find the device that matches these parameters in its current list. The product name is a bit more specific than the family name, but less specific than the serial. For the 'SampleDevice' for example there might be different product names for different device types. This might e.g. be 'SampleDevice-G' for a grey version of the sample device and 'SampleDevice-C' for the color version of the sample device.

Examples

// this will return a pointer to the second sample
// device of type 'G' found or null if there aren't
// two devices of this type in the system
getDeviceByProduct( "SampleDevice-G", 1 );
// will return a pointer to the first device whose
// product string starts with 'SampleDev' or null if
// no such device can be found.
getDeviceByProduct( "SampleDev*", 0, '*' );
// will return the first recognized device in the system
getDeviceByProduct( "*", 0, '*' );
See also
mv.impact.acquire.DeviceManager.getDeviceBySerial,
mv.impact.acquire.DeviceManager.getDeviceByFamily,
mv.impact.acquire.DeviceManager.getDeviceByProductAndID
Returns
  • A pointer to the device if found.
  • An invalid pointer or reference otherwise.
Parameters
[in]productThe full product name of the requested device or known parts of it and wildcard characters.
[in]devNrThe number of the device to return (if there is more than one candidate).
[in]wildcardThe character to ignore in product.

◆ getDeviceByProductAndID() [1/5]

static Device getDeviceByProductAndID ( String product)
inlinestatic

Tries to locate a device via the product name and the device ID.

This function behaves like mv.impact.acquire.DeviceManager.getDeviceByProduct except that the second parameter now is interpreted as the device ID.

Examples

// this will return a pointer to the sample device of
// type 'G' which has been assigned a device ID of '1'
// or null if there is no sample device with this ID in the system.
getDeviceByProductAndID( "SampleDevice-G", 1 );
// will return a pointer to the device whose product string
// starts with 'SampleDev' and whose device ID has been set
// to '0' or null if no such device can be found.
getDeviceByProductAndID( "SampleDev*", 0, '*' );
// will return the first recognized device with an assigned
// device ID of '0' in the system.
getDeviceByProductAndID( "*", 0 );
See also
mv.impact.acquire.Device.deviceID,
mv.impact.acquire.DeviceManager.getDeviceByFamily,
mv.impact.acquire.DeviceManager.getDeviceByProduct,
mv.impact.acquire.DeviceManager.getDeviceBySerial,
mv.impact.acquire.Device.setID
Returns
  • A pointer to the device if found.
  • An invalid pointer or reference otherwise.
Parameters
[in]productThe full product name of the requested device or known parts of it and wildcard characters.

◆ getDeviceByProductAndID() [2/5]

static Device getDeviceByProductAndID ( String product,
int devID )
inlinestatic

Tries to locate a device via the product name and the device ID.

This function behaves like mv.impact.acquire.DeviceManager.getDeviceByProduct except that the second parameter now is interpreted as the device ID.

Examples

// this will return a pointer to the sample device of
// type 'G' which has been assigned a device ID of '1'
// or null if there is no sample device with this ID in the system.
getDeviceByProductAndID( "SampleDevice-G", 1 );
// will return a pointer to the device whose product string
// starts with 'SampleDev' and whose device ID has been set
// to '0' or null if no such device can be found.
getDeviceByProductAndID( "SampleDev*", 0, '*' );
// will return the first recognized device with an assigned
// device ID of '0' in the system.
getDeviceByProductAndID( "*", 0 );
See also
mv.impact.acquire.Device.deviceID,
mv.impact.acquire.DeviceManager.getDeviceByFamily,
mv.impact.acquire.DeviceManager.getDeviceByProduct,
mv.impact.acquire.DeviceManager.getDeviceBySerial,
mv.impact.acquire.Device.setID
Returns
  • A pointer to the device if found.
  • An invalid pointer or reference otherwise.
Parameters
[in]productThe full product name of the requested device or known parts of it and wildcard characters.
[in]devIDThe ID associated with this device.

◆ getDeviceByProductAndID() [3/5]

static Device getDeviceByProductAndID ( String product,
int devID,
char wildcard )
inlinestatic

Tries to locate a device via the product name and the device ID.

This function behaves like mv.impact.acquire.DeviceManager.getDeviceByProduct except that the second parameter now is interpreted as the device ID.

Examples

// this will return a pointer to the sample device of
// type 'G' which has been assigned a device ID of '1'
// or null if there is no sample device with this ID in the system.
getDeviceByProductAndID( "SampleDevice-G", 1 );
// will return a pointer to the device whose product string
// starts with 'SampleDev' and whose device ID has been set
// to '0' or null if no such device can be found.
getDeviceByProductAndID( "SampleDev*", 0, '*' );
// will return the first recognized device with an assigned
// device ID of '0' in the system.
getDeviceByProductAndID( "*", 0 );
See also
mv.impact.acquire.Device.deviceID,
mv.impact.acquire.DeviceManager.getDeviceByFamily,
mv.impact.acquire.DeviceManager.getDeviceByProduct,
mv.impact.acquire.DeviceManager.getDeviceBySerial,
mv.impact.acquire.Device.setID
Returns
  • A pointer to the device if found.
  • An invalid pointer or reference otherwise.
Parameters
[in]productThe full product name of the requested device or known parts of it and wildcard characters.
[in]devIDThe ID associated with this device.
[in]wildcardThe character to ignore in product.

◆ getDeviceByProductAndID() [4/5]

static Device getDeviceByProductAndID ( String product,
String devID )
inlinestatic

Tries to locate a device via the product name and the device ID.

This function can be used to locate devices with a certain string identifier that has previously been written into a devices non-volatile memory. E.g. GenICam devices may support the DeviceUserID feature to assign a certain user defined name. A user defined name might be useful e.g. to access a device with a certain function without the need to worry about which device is it. You could e.g. have a barcodeReadingDevice and a monitorCamera. This function behaves like mv.impact.acquire.DeviceManager.getDeviceByProduct except that the second parameter now is interpreted as the device ID.

Examples

// this will return a pointer to the sample device of
// type 'G' which has been assigned a device ID of 'abc'
// or null if there is no sample device with this ID in the system.
getDeviceByProductAndID( "SampleDevice-G", "abc" );
// will return a pointer to the device whose product string
// starts with 'SampleDev' and whose device ID has been set
// to 'def' or null if no such device can be found.
getDeviceByProductAndID( "SampleDev*", "def", '*' );
// will return the first recognized device with an assigned
// device ID of 'anyString' in the system.
getDeviceByProductAndID( "*", "anyString" );
See also
mv.impact.acquire.Device.deviceID,
mv.impact.acquire.DeviceManager.getDeviceByFamily,
mv.impact.acquire.DeviceManager.getDeviceByProduct,
mv.impact.acquire.DeviceManager.getDeviceBySerial,
mv.impact.acquire.Device.setID
Returns
  • A pointer to the device if found.
  • an invalid pointer or reference otherwise.
Parameters
[in]productThe full product name of the requested device or known parts of it and wildcard characters.
[in]devIDThe device ID associated with this device.

◆ getDeviceByProductAndID() [5/5]

static Device getDeviceByProductAndID ( String product,
String devID,
char wildcard )
inlinestatic

Tries to locate a device via the product name and the device ID.

This function behaves like mv.impact.acquire.DeviceManager.getDeviceByProduct except that the second parameter now is interpreted as the device ID.

Examples

// this will return a pointer to the sample device of
// type 'G' which has been assigned a device ID of 'abc'
// or null if there is no sample device with this ID in the system.
getDeviceByProductAndID( "SampleDevice-G", "abc" );
// will return a pointer to the device whose product string
// starts with 'SampleDev' and whose device ID has been set
// to 'def' or null if no such device can be found.
getDeviceByProductAndID( "SampleDev*", "def", '*' );
// will return the first recognized device with an assigned
// device ID of 'anyString' in the system.
getDeviceByProductAndID( "*", "anyString" );
See also
mv.impact.acquire.Device.deviceID,
mv.impact.acquire.DeviceManager.getDeviceByFamily,
mv.impact.acquire.DeviceManager.getDeviceByProduct,
mv.impact.acquire.DeviceManager.getDeviceBySerial,
mv.impact.acquire.Device.setID
Returns
  • A pointer to the device if found.
  • an invalid pointer or reference otherwise.
Parameters
[in]productThe full product name of the requested device or known parts of it and wildcard characters.
[in]devIDThe device ID associated with this device.
[in]wildcardThe character to ignore in product.

◆ getDeviceBySerial() [1/3]

static Device getDeviceBySerial ( String serial)
inlinestatic

Tries to locate a device via the serial number.

This function tries to find a device by its serial number (or parts of this number). The user can specify only parts of the serial number and a wildcard. The mv.impact.acquire.DeviceManager object will then try to find that matches these parameters in its current list.

Examples

// this will return a pointer to the second device with
// a serial number starting with 'SD' device found or 0
// if there are no 2 sample devices in the system
getDeviceBySerial( "SD*******", 1, '*' );
// will return a pointer to the device with the serial
// number SD000001 if present or 0
getDeviceBySerial( "SD0000001" );
// will return a pointer to the first device in the system
getDeviceBySerial( "*", 0, '*' );
See also
mv.impact.acquire.DeviceManager.getDeviceByFamily,
mv.impact.acquire.DeviceManager.getDeviceByProduct,
mv.impact.acquire.DeviceManager.getDeviceByProductAndID
Returns
  • A pointer to the device if found.
  • An invalid pointer or reference otherwise.
Parameters
[in]serialThe full serial number or the known parts of the serial number and wildcard characters.

◆ getDeviceBySerial() [2/3]

static Device getDeviceBySerial ( String serial,
int devNr )
inlinestatic

Tries to locate a device via the serial number.

This function tries to find a device by its serial number (or parts of this number). The user can specify only parts of the serial number and a wildcard. The mv.impact.acquire.DeviceManager object will then try to find that matches these parameters in its current list.

Examples

// this will return a pointer to the second device with
// a serial number starting with 'SD' device found or 0
// if there are no 2 sample devices in the system
getDeviceBySerial( "SD*******", 1, '*' );
// will return a pointer to the device with the serial
// number SD000001 if present or 0
getDeviceBySerial( "SD0000001" );
// will return a pointer to the first device in the system
getDeviceBySerial( "*", 0, '*' );
See also
mv.impact.acquire.DeviceManager.getDeviceByFamily,
mv.impact.acquire.DeviceManager.getDeviceByProduct,
mv.impact.acquire.DeviceManager.getDeviceByProductAndID
Returns
  • A pointer to the device if found.
  • An invalid pointer or reference otherwise.
Parameters
[in]serialThe full serial number or the known parts of the serial number and wildcard characters.
[in]devNrThe number of the device to return (if there is more than one candidate).

◆ getDeviceBySerial() [3/3]

static Device getDeviceBySerial ( String serial,
int devNr,
char wildcard )
inlinestatic

Tries to locate a device via the serial number.

This function tries to find a device by its serial number (or parts of this number). The user can specify only parts of the serial number and a wildcard. The mv.impact.acquire.DeviceManager object will then try to find that matches these parameters in its current list.

Examples

// this will return a pointer to the second device with
// a serial number starting with 'SD' device found or 0
// if there are no 2 sample devices in the system
getDeviceBySerial( "SD*******", 1, '*' );
// will return a pointer to the device with the serial
// number SD000001 if present or 0
getDeviceBySerial( "SD0000001" );
// will return a pointer to the first device in the system
getDeviceBySerial( "*", 0, '*' );
See also
mv.impact.acquire.DeviceManager.getDeviceByFamily,
mv.impact.acquire.DeviceManager.getDeviceByProduct,
mv.impact.acquire.DeviceManager.getDeviceByProductAndID
Returns
  • A pointer to the device if found.
  • An invalid pointer or reference otherwise.
Parameters
[in]serialThe full serial number or the known parts of the serial number and wildcard characters.
[in]devNrThe number of the device to return (if there is more than one candidate).
[in]wildcardThe character to ignore in serial.

◆ getVersionAsString()

static String getVersionAsString ( TLibraryQuery libraryQuery)
inlinestatic

Returns a string containing the version number of the specified library.

This function returns a string containing the version number of the specified library.

The format of the string will be MAJOR.MINOR.RELEASE.BUILD.

Since
2.1.2
Returns
A pointer to an internal version string.
Parameters
[in]libraryQuerySpecifies the library to query information from.

◆ updateDeviceList()

static void updateDeviceList ( )
inlinestatic

Updates the internal device list.

Most devices can't appear out of nowhere. For example a PCI device is either connected to the current system when the device manager is initialised or not but it will never appear at runtime after this instance of mv.impact.acquire.DeviceManager has been created.

However certain device classes (e.g. network devices) might be connected to the system AFTER the device manager has been initialised. Some will announce themselves like e.g. USB devices, which will send a message to every application interested while others like e.g. network devices wont. In order not to pollute the network or bus with constant rescan messages no polling is done inside the driver. the user should call this function instead when looking for new devices. This can either be done in reasonable intervals or after it is known that a new device has been connected to the system.

If new devices have been detected a subsequent call to mv.impact.acquire.DeviceManager.deviceCount will result in a higher value when compared to a previous call and mv.impact.acquire.DeviceManager.changedCount will contain a different value as well then (however this could also happen because a certain device related property did change its state).

Note
As long as a certain instance of a device manager is active, the devices once detected will NOT disappear from the list of devices even if they have been unplugged from the system. So the list of devices can only grow, but never gets shorter again until either the process terminates or the last instance of this class went out of scope. If a device has been unplugged, its mv.impact.acquire.Device.state property will change. If the application is interested in getting an instant notification when a device has been disconnected a callback can be registered on this property. How to do this is explained here: Callback.cs

Property Documentation

◆ changedCount

uint changedCount
staticget

Returns the current changed counter for the device list.

This is a useful function to find out if the device list has been changed in any way. Such a change might be the appearance of a new USB device or a state change of any other device (e.g. when a USB device has been unplugged). Thus this function can be called periodically in order to maintain lists in GUI application for example. To find out the actual number of devices call mv.impact.acquire.DeviceManager.deviceCount.

Returns
The current changed counter for the device list.

◆ deviceCount

int deviceCount
staticget

Returns the number of devices currently present in the system.

This function returns the number of devices currently detected in the system. A device once connected to the system while the device manager was running will remain in its list even if it's unplugged (then only its state will change). To detect changes in the mv.impact.acquire.DeviceManager objects list call the function mv.impact.acquire.DeviceManager.changedCount.

Returns
The number of devices detected in the current system.
Examples
ContinuousCaptureAllDevices.cs, and ContinuousSaveImage.cs.

◆ deviceList

ReadOnlyCollection<Device> deviceList
staticget

Returns a list of all devices currently detected by the device manager.

To detect some devices(non P'n'P hardware) at runtime that have been connected to the system AFTER the device manager has been created the function mv.impact.acquire.DeviceManager.updateDeviceList() must be called.

Returns
A list of all devices currently detected by the device manager.
Examples
ContinuousCaptureAllDevices.cs.

◆ internalHandle

ComponentList internalHandle
staticget

Returns the internal handle to the device manager.

◆ isDotNETBitmapSupportAvailable

bool isDotNETBitmapSupportAvailable
staticgetpackage