Interface Class#
Inheritance Hierarchy#
System.Object
Basler.Pylon.Interface
Syntax#
C#
VB
The Interface type exposes the following members.
Constructors#
Name | Description | |
---|---|---|
Interface | Creates a specific interface using information given in the interfaceInfo parameter. |
Properties#
Name | Description | |
---|---|---|
InterfaceInfo | Provides access to interface information. | |
IsOpen | Indicates if interface object has been opened. | |
Parameters | Returns the parameter collection of the interface for accessing all parameters. Example: interface.Parameters[PLInterface.InterfaceType].GetValue(); |
Methods#
Name | Description | |
---|---|---|
Close | Closes an interface. | |
Dispose | Releases all resources used by the Interface | |
EnumerateCameras | Retrieves information about cameras connected to the interface. | |
Open | Opens an interface. |
Events#
Name | Description | |
---|---|---|
InterfaceClosed | Occurs after the interface has been closed. | |
InterfaceClosing | Occurs before the interface is closed. | |
InterfaceOpened | Occurs after the interface has been opened successfully via Open(). | |
InterfaceOpening | 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.
Interface.InterfaceClosed Event#
Occurs after the interface has been closed.
Syntax#
C#
VB
Value#
Type: System.EventHandler(EventArgs)
Implements#
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.
Interface.InterfaceClosing Event#
Occurs before the interface is closed.
Syntax#
C#
VB
Value#
Type: System.EventHandler(EventArgs)
Implements#
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.
Interface.InterfaceOpened Event#
Occurs after the interface has been opened successfully via Open().
Syntax#
C#
VB
Value#
Type: System.EventHandler(EventArgs)
Implements#
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.
Interface.InterfaceOpening Event#
Occurs before the interface is opened via Open().
Syntax#
C#
VB
Value#
Type: System.EventHandler(EventArgs)
Implements#
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.
Interface.Close Method#
Closes an interface.
Syntax#
C#
VB
Implements#
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.
Error Safety: Does not throw exceptions.
Interface.Dispose Method#
Releases all resources used by the Interface
Syntax#
C#
VB
Interface.EnumerateCameras Method#
Retrieves information about cameras connected to the interface.
Syntax#
C#
VB
Return Value#
Type: List(ICameraInfo)
Returns a list of ICameraInfo objects, one for each camera found. The list is ordered by serial number.
Implements#
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.
Interface.Open Method#
Opens an interface.
Syntax#
C#
VB
Return Value#
Type: IInterface
Returns a reference to the opened interface.
Implements#
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.
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.
Interface Constructor#
Creates a specific interface using information given in the interfaceInfo parameter.
Syntax#
C#
VB
Parameters#
- interfaceInfo
- Type: Basler.Pylon.IInterfaceInfo
Contains the exact properties of the interface to be created. You can retrieve interface infos by calling Enumerate()
Remarks#
Use this constructor to create a specific interface using information returned by Enumerate(). If no interface is found, an exception is thrown.
Error Safety:Can throw exceptions.
Interface.InterfaceInfo Property#
Provides access to interface information.
Syntax#
C#
VB
Return Value#
Type: IInterfaceInfo
Returns information about the interface.
Implements#
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.
Interface.IsOpen Property#
Indicates if interface object has been opened.
Syntax#
C#
VB
Return Value#
Type: Boolean
Returns true if interface object has been opened.
Implements#
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.
Interface.Parameters Property#
Returns the parameter collection of the interface for accessing all parameters. Example: interface.Parameters[PLInterface.InterfaceType].GetValue();
Syntax#
C#
VB
Return Value#
Type: IParameterCollection
Returns the parameter collection of the interface.
Implements#
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#
Thread Safety: This method is synchronized with the lock of the interface object.
Error Safety: Does not throw exceptions.