Skip to content

IInterface Interface#

Provides convenient access to an interface.

Syntax#

C#

public interface IInterface : IDisposable

VB

Public Interface IInterface
    Inherits IDisposable

The IInterface type exposes the following members.

Properties#

NameDescription
Public propertyInterfaceInfo Provides access to interface information.
Public propertyIsOpen Indicates if interface object has been opened.
Public propertyParameters Returns the parameter collection of the interface for accessing all parameters. Example: interface.Parameters[PLInterface.InterfaceType].GetValue();
 

Methods#

NameDescription
Public methodClose Closes an interface.
Public methodEnumerateCameras Retrieves information about cameras connected to the interface.
Public methodOpen Opens an interface.
 

Events#

NameDescription
Public eventInterfaceClosed Occurs after the interface has been closed.
Public eventInterfaceClosing Occurs before the interface is closed.
Public eventInterfaceOpened Occurs after the interface has been opened successfully via Open().
Public eventInterfaceOpening Occurs before the interface is opened via Open().
 

Remarks#

An interface is used to represent a frame grabber board, a network card, etc. 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. The 'open' status of an interface instance won't change even if an attached camera is used, e.g., opened or closed.

IInterface.InterfaceClosed Event#

Occurs after the interface has been closed.

Syntax#

C#

event EventHandler<EventArgs> InterfaceClosed

VB

Event InterfaceClosed As EventHandler(Of EventArgs)

Value#

Type: System.EventHandler(EventArgs)

Remarks#

During the execution of this event, the interface is already closed.

If an event handler throws an exception, it will be ignored and the remaining handlers will be called.

This event is fired inside the lock of the interface instance.

IInterface.InterfaceClosing Event#

Occurs before the interface is closed.

Syntax#

C#

event EventHandler<EventArgs> InterfaceClosing

VB

Event InterfaceClosing As EventHandler(Of EventArgs)

Value#

Type: System.EventHandler(EventArgs)

Remarks#

If the interface is closed properly, the interface is still open during the execution of this event.

If an event handler throws an exception, it will be ignored and the remaining handlers will be called.

This event is fired inside the lock of the interface instance.

IInterface.InterfaceOpened Event#

Occurs after the interface has been opened successfully via Open().

Syntax#

C#

event EventHandler<EventArgs> InterfaceOpened

VB

Event InterfaceOpened As EventHandler(Of EventArgs)

Value#

Type: System.EventHandler(EventArgs)

Remarks#

During the execution of this event, the interface is already open.

If an event handler called by this event throws an exception, the interface will be closed and the exception will be propagated to the caller of Open(). No other handlers will be called.

This event is fired inside the lock of the interface instance.

IInterface.InterfaceOpening Event#

Occurs before the interface is opened via Open().

Syntax#

C#

event EventHandler<EventArgs> InterfaceOpening

VB

Event InterfaceOpening As EventHandler(Of EventArgs)

Value#

Type: System.EventHandler(EventArgs)

Remarks#

During the execution of this event, the interface is not yet open.

If an event handler called by this event throws an exception, it will be propagated to the caller of Open(). No other handlers will be called.

This event is fired inside the lock of the interface instance.

IInterface.Close Method#

Closes an interface.

Syntax#

C#

void Close()

VB

Sub Close

Remarks#

 

  • If the interface has been already closed, the function returns successfully.
  • The OnClose event is raised. If any event handler throws an exception it will be ignored and the next event handler will be called.
  • The interface is closed.
  • The OnClosed event is raised. If any event handler throws an exception it will be ignored and the next event handler will be called.
  Thread Safety: This method is synchronized with the lock of the interface object.

Error Safety: Does not throw exceptions.

IInterface.EnumerateCameras Method#

Retrieves information about cameras connected to the interface.

Syntax#

C#

List<ICameraInfo> EnumerateCameras()

VB

Function EnumerateCameras As List(Of ICameraInfo)

Return Value#

Type: List(ICameraInfo)
Returns a list of ICameraInfo objects, one for each camera found. The list is ordered by serial number.

Remarks#

The function queries for camera devices connected to the interface and returns a list of ICameraInfo objects describing the cameras. The returned information can be used to create a specific Camera object.

Thread Safety: This method is synchronized with the lock of the interface object.

Error Safety: Can throw exceptions.

IInterface.Open Method#

Opens an interface.

Syntax#

C#

IInterface Open()

VB

Function Open As IInterface

Return Value#

Type: IInterface
Returns a reference to the opened interface.

Remarks#

 

  • If the interface is already open, the function returns successfully.
  • The InterfaceOpening event is fired. The notification of event handlers stops in case any eventhandler throws an exception.
  • The the interface is opened.
  • The InterfaceOpened event is fired if the interface object has been opened successfully. The notification of event handlers stops in case any eventhandler throws an exception.
  Opening the interface may fail if the interface has been already opened by another instance.

Thread Safety: This method is synchronized with the lock of the interface object.

Error Safety: Can throw exceptions if the interface cannot be opened successfully or if any of the event handlers throws an exception.

IInterface.InterfaceInfo Property#

Provides access to interface information.

Syntax#

C#

IInterfaceInfo InterfaceInfo { get; }

VB

ReadOnly Property InterfaceInfo As IInterfaceInfo
    Get

Return Value#

Type: IInterfaceInfo
Returns information about the interface.

Remarks#

Returns the interface information collection containing detailed interface information, e.g. interface ID or interface type. This information can be read at all times regardless of whether the interface is open or closed.

Thread Safety: This method is synchronized with the lock of the interface object.

Error Safety: Does not throw exceptions when read. Can throw exceptions when set and the preconditions are not met.

IInterface.IsOpen Property#

Indicates if interface object has been opened.

Syntax#

C#

bool IsOpen { get; }

VB

ReadOnly Property IsOpen As Boolean
    Get

Return Value#

Type: Boolean
Returns true if interface object has been opened.

Remarks#

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

The interface object will not automatically close itself if the interface is disconnected, e.g., if the interface is physically removed from the PC.

Thread Safety: This method is synchronized with the lock of the interface object.

Error Safety: Does not throw exceptions.

IInterface.Parameters Property#

Returns the parameter collection of the interface for accessing all parameters. Example: interface.Parameters[PLInterface.InterfaceType].GetValue();

Syntax#

C#

IParameterCollection Parameters { get; }

VB

ReadOnly Property Parameters As IParameterCollection
    Get

Return Value#

Type: IParameterCollection
Returns the parameter collection of the interface.

Remarks#

You can use the parameter collection to configure the interface through parameters. You can access parameters by their name or predefined parameter lists. 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 which will have an empty parameter collection.

There is one predefined parameter list available: PLInterface For more information about the parameters, see the documentation for the parameter list.

Precondition for accessing the parameters:
The interface is opened.

You can access parameters by passing a key from a parameter list to the index operator, e.g. C#

interface.Parameters[PLInterface.InterfaceType].GetValue();

Thread Safety: This method is synchronized with the lock of the interface object.

Error Safety: Can throw exceptions, e.g. if the interface has not been opened