Skip to content

Pylon::CInstantInterface#

Provides convenient access to an interface. More…

#include <pylon/InstantInterface.h>

Inherits from T, Pylon::IInterface, Pylon::IDeviceFactory

Public Functions#

Name
CInstantInterface(const Pylon::CInfoBase & info)
Constructor.
~CInstantInterface()
Destructor.
virtual void Open()
Opens the attached Pylon interface.
virtual bool IsOpen() const
Checks if the interface is open.
virtual void Close()
Closes an interface.
virtual const CInterfaceInfo & GetInterfaceInfo() const
Returns the interface info object storing information like the Interface ID property.
virtual GenApi::INodeMap * GetNodeMap()
Returns the GenApi node map used for accessing parameters provided by the interface.
virtual int EnumerateDevices(DeviceInfoList_t & list, bool addToList =false)
Retrieves a list of available devices.
virtual int EnumerateDevices(DeviceInfoList_t & list, const DeviceInfoList_t & filter, bool addToList =false)
Retrieves a list of available devices filtered by given properties, usable for looking for specific devices.
virtual IPylonDevice * CreateDevice(const CDeviceInfo & di)
Creates a camera object from a device info object.
virtual IPylonDevice * CreateFirstDevice(const CDeviceInfo & di =CDeviceInfo())
virtual IPylonDevice * CreateDevice(const CDeviceInfo & di, const StringList_t & InjectedXmlStrings)
virtual IPylonDevice * CreateFirstDevice(const CDeviceInfo & di, const StringList_t & InjectedXmlStrings)
virtual IPylonDevice * CreateDevice(const String_t & s)
virtual void DestroyDevice(IPylonDevice * pDevice)
Destroys a device.
virtual bool IsDeviceAccessible(const CDeviceInfo & deviceInfo, AccessModeSet mode =Control, EDeviceAccessiblityInfo * pAccessibilityInfo =NULL)
This method can be used to check if a camera device can be created and opened.

Detailed Description#

template <typename T >
class Pylon::CInstantInterface;

Provides convenient access to an interface.

Note Currently, this object type is mainly used for the pylon GenTL Consumer Transport Layer, e.g., for CoaXPress. All other pylon transport layers currently return one default interface.

An interface is used to represent a frame grabber board, a network card, etc.

  • Establishes a single access point for accessing interface functionality.
  • Handles Pylon interface lifetime.
  • Handles opening and closing of a Pylon interface automatically.

Public Functions Documentation#

function CInstantInterface#

inline CInstantInterface(
    const Pylon::CInfoBase & info
)

Constructor.

Error Safety:

May throw an exception if the passed argument cannot be used to create an interface object.

Creates a CInstantInterface object from a CDeviceInfo or CInterfaceInfo object.

The following steps are taken:

  • The DeviceClass property is used to create the transport layer.
  • If the DeviceClass property is not available, the TlType property is used to create the first matching transport layer.
  • If the DeviceClass and TlType properties are not be available, an error will be thrown.
  • If the provided argument is of CInterfaceInfo type, this is used to create the interface.
  • If the provided argument is of CDeviceInfo type, use the InterfaceID property to create the interface.
  • If the above steps fail, the first interface is created.

function ~CInstantInterface#

inline ~CInstantInterface()

Destructor.

All created objects are destroyed correctly.

function Open#

inline virtual void Open()

Opens the attached Pylon interface.

Postcondition:

  • The interface is opened.
  • The nodemap and parameters are available and accessable.

Error Safety:

May throw C++ exceptions.

Reimplements: Pylon::IInterface::Open

This call is neccessary to work with all parameters.

function IsOpen#

inline virtual bool IsOpen() const

Checks if the interface is open.

Return: Returns true if the interface is open.

Note The 'open' status of an interface instance won't change even if an attached camera is used, e.g., opened or closed.

Error Safety:

May throw C++ exceptions.

Reimplements: Pylon::IInterface::IsOpen

function Close#

inline virtual void Close()

Closes an interface.

Postcondition:

  • The interface is closed.
  • Any previously acquired objects and references have been deleted and must not be used any longer.

Error Safety:

May throw C++ exceptions.

Reimplements: Pylon::IInterface::Close

function GetInterfaceInfo#

inline virtual const CInterfaceInfo & GetInterfaceInfo() const

Returns the interface info object storing information like the Interface ID property.

Return: A reference to the interface info object.

Error Safety:

May throw C++ exceptions.

Reimplements: Pylon::IInterface::GetInterfaceInfo

This information is available at all times regardless of whether the interface is open or closed.

function GetNodeMap#

inline virtual GenApi::INodeMap * GetNodeMap()

Returns the GenApi node map used for accessing parameters provided by the interface.

Return: Returns the GenApi node map used for accessing parameters provided by the interface. If no parameters are available, NULL is returned.

Note

  • The default interface object does not provide a node map.
  • Interfaces will only provide a nodemap after calling Open().

Error Safety:

May throw C++ exceptions.

Reimplements: Pylon::IInterface::GetNodeMap

function EnumerateDevices#

inline virtual int EnumerateDevices(
    DeviceInfoList_t & list,
    bool addToList =false
)

Retrieves a list of available devices.

Parameters:

  • list List to be filled with device info objects.
  • addToList If true, the devices found will be appended to the list instead of deleting the list. Only newly discovered devices are sorted and not the entire list.

Return: Number of devices found.

Error Safety:

May throw C++ exceptions.

Reimplements: Pylon::IDeviceFactory::EnumerateDevices

The list contains Pylon::CDeviceInfo objects used for the device creation and is ordered by device class and serial number using the operator Pylon::CDeviceInfo::operator<(). By default, the list will be cleared before the device discovery is started.

function EnumerateDevices#

inline virtual int EnumerateDevices(
    DeviceInfoList_t & list,
    const DeviceInfoList_t & filter,
    bool addToList =false
)

Retrieves a list of available devices filtered by given properties, usable for looking for specific devices.

Parameters:

  • list List to be filled with device info objects.
  • filter A list of device info objects with user-provided properties that a device can match.
  • addToList If true, the devices found will be appended to the list instead of deleting the list. Only newly discovered devices are sorted and not the entire list.

Return: Number of devices found.

Error Safety:

May throw C++ exceptions.

Reimplements: Pylon::IDeviceFactory::EnumerateDevices

The list contains Pylon::CDeviceInfo objects used for the device creation and is ordered by device class and serial number using the operator Pylon::CDeviceInfo::operator<(). By default, the list will be cleared before the device discovery is started. The filter list can contain a list of device info objects containing properties a device must have, e.g., the user-provided name or the serial number. A device is returned if it matches the properties of any of the device info objects on the filter list. If the device class property is set in the filter device info objects, the search is limited to the required transport layers.

function CreateDevice#

inline virtual IPylonDevice * CreateDevice(
    const CDeviceInfo & di
)

Creates a camera object from a device info object.

Parameters:

  • di Device info object containing all information needed to identify exactly one device.

Error Safety:

May throw C++ exceptions.

Reimplements: Pylon::IDeviceFactory::CreateDevice

This method accepts either a device info object from a device enumeration or a user-provided device info object. User-provided device info objects can be preset with properties required for a device, e.g. the user-provided name or the serial number. The implementation tries to find a matching camera by using device enumeration. When the device class property is set, the search is limited to the required transport layer.

If the device creation fails, a GenApi::GenericException will be thrown.

function CreateFirstDevice#

inline virtual IPylonDevice * CreateFirstDevice(
    const CDeviceInfo & di =CDeviceInfo()
)

Error Safety:

May throw C++ exceptions.

Reimplements: Pylon::IDeviceFactory::CreateFirstDevice

If multiple devices match the provided properties, the first device found is created. The order in which the devices are found can vary from call to call.

function CreateDevice#

inline virtual IPylonDevice * CreateDevice(
    const CDeviceInfo & di,
    const StringList_t & InjectedXmlStrings
)

Error Safety:

May throw C++ exceptions.

Reimplements: Pylon::IDeviceFactory::CreateDevice

Creates a camera object from a device info object, injecting additional GenICam XML definition strings. Currently only one injected xml string is supported.

function CreateFirstDevice#

inline virtual IPylonDevice * CreateFirstDevice(
    const CDeviceInfo & di,
    const StringList_t & InjectedXmlStrings
)

Error Safety:

May throw C++ exceptions.

Reimplements: Pylon::IDeviceFactory::CreateFirstDevice

Creates the first found camera device matching the provided properties, injecting additional GenICam XML definition strings. Currently only one injected xml string is supported.

function CreateDevice#

inline virtual IPylonDevice * CreateDevice(
    const String_t & s
)

Error Safety:

May throw C++ exceptions.

Reimplements: Pylon::IDeviceFactory::CreateDevice

This method is deprecated. Use CreateDevice and pass a CDeviceInfo object containing the full name as a property. Example: IPylonDevice* device = TlFactory.CreateDevice( CDeviceInfo().SetFullName( fullname)); creates a device that matches its full name (i.e., as returned by CDeviceInfo::GetFullName).

function DestroyDevice#

inline virtual void DestroyDevice(
    IPylonDevice * pDevice
)

Destroys a device.

Note Never try to delete a pointer to a camera device by calling free or delete. Always use the DestroyDevice method.

Error Safety:

May throw C++ exceptions.

Reimplements: Pylon::IDeviceFactory::DestroyDevice

function IsDeviceAccessible#

inline virtual bool IsDeviceAccessible(
    const CDeviceInfo & deviceInfo,
    AccessModeSet mode =Control,
    EDeviceAccessiblityInfo * pAccessibilityInfo =NULL
)

This method can be used to check if a camera device can be created and opened.

Parameters:

  • deviceInfo Properties to find/identify the camera device to check.
  • mode Used for defining how a device is accessed. The use of the mode information is transport layer-specific.

  • For CameraLink, and USB devices, the mode information is ignored.

  • For GigE devices, the Exclusive and Control flags are used for defining how a device is accessed. Other mode information is ignored.
  • For devices of any type that are accessed via the GenICam GenTL transport layer, the mode is ignored.
  • pAccessibilityInfo Optional parameter that provides more information about whether a device is accessible or not.

Return: True if device can be opened with provided access mode.

Precondition: The deviceInfo object properties specify exactly one device. This is the case when the device info object has been obtained using device enumeration.

Error Safety:

Throws a C++ exception, if the preconditions are not met.

Error Safety:

May throw C++ exceptions.

Reimplements: Pylon::IDeviceFactory::IsDeviceAccessible

This method accepts either a device info object from a device enumeration or a user-provided device info object. User-provided device info objects can be preset with properties required for a device, e.g. the user-provided name or the serial number. The implementation tries to find a matching camera by using device enumeration. When the device class property is set, see DeviceClass.h header file, the search is limited to the required transport layer. For more information, see [Applying a Filter when Enumerating Cameras].