eBUS SDK .NET API
  • Getting Started
    • Getting started with the eBUS SDK .NET API
    • Configuring Your IDE
    • Receiving Data from a GigE Vision or USB3 Vision Transmitter
    • Sample Applications
    • GigE Vision Device Communication Parameters
    • USB3 Vision Device Communication Parameters
    • PvStream USB3 Vision Parameters
    • PvStream GigE Vision Parameters
  • eBUS SDK .NET API Reference
    • API Overview
    • eBUSDotNet
    • eBUSDotNetReceive
    • eBUSDotNetEdge
Search Results for

    Show / Hide Table of Contents
      • IPvDeviceAdapter
      • IPvDeviceAdapterSwigInterface
      • IUpdaterObserver
      • OnAcquisitionStateChanged
      • OnBufferCreated
      • OnBufferDeleted
      • OnBufferDisplay
      • OnBufferDone
      • OnBufferLog
      • OnBufferRetrieved
      • OnBufferTextOverlay
      • OnBufferTooSmall
      • OnCmdLinkRead
      • OnCmdLinkReadSafe
      • OnCmdLinkWrite
      • OnCmdLinkWriteSafe
      • OnEvent
      • OnEventGenICam
      • OnEventSafe
      • OnLinkDisconnectedHandler
      • OnLinkReconnectedHandler
      • OnReset
      • OnStart
      • OnStop
      • PvAccessType
      • PvAcquisitionState
      • PvAcquisitionStateEventSink
      • PvAcquisitionStateManager
      • PvActionAckStatusEnum
      • PvBayerFilterType
      • PvBiColorFilterType
      • PvBufferConverter
      • PvBufferConverterRGBFilter
      • PvBufferFormatType
      • PvBufferWriter
      • PvCameraBridge
      • PvCameraBridgeEventSink
      • PvCameraBridgeType
      • PvConfigurationReader
      • PvConfigurationWriter
      • PvDataReceiverType
      • PvDevice
      • PvDeviceAdapter
      • PvDeviceEventSink
      • PvDeviceEventSinkSwigInterface
      • PvDeviceGEV
      • PvDeviceI2CBus
      • PvDevicePleoraProtocol
      • PvDeviceSPIBus
      • PvDeviceSerial
      • PvDeviceSerialPort
      • PvDeviceSerialPortEchoSink
      • PvDeviceU3V
      • PvDisplayThread
      • PvGenFUUpdater
      • PvParity
      • PvPipeline
      • PvPipelineEventSink
      • PvProperty
      • PvPropertyList
      • PvSerialPortConfiguration
      • PvStream
      • PvStreamEventSink
      • PvStreamGEV
      • PvStreamInfo
      • PvStreamRTP
      • PvStreamType
      • PvStreamU3V
      • PvThreadPriority
      • PvTruesenseConverter
      • SWIGTYPE_p_IPvDeviceEventSink
      • SWIGTYPE_p_PvDeinterlacingType
      • SWIGTYPE_p_PvSessionInfoSDP
      • SWIGTYPE_p_PvStringList
      • SWIGTYPE_p_PvTapGeometryEnum
      • SWIGTYPE_p_bool
      • SWIGTYPE_p_double
      • eBUSDotNetReceive

    Class PvDeviceSerialPort

    Provides access the a serial port on a Pleora GigE Vision or USB3 Vision device.

    Inheritance
    object
    PvDeviceSerialPort
    Implements
    IDisposable
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: eBUSDotNetReceive
    Assembly: eBUSDotNetReceive.dll
    Syntax
    public class PvDeviceSerialPort : IDisposable
    Remarks

    PvDeviceSerialPort uses a proprietary serial communication protocol on top of GigE Vision's GVCP or USB3 Vision's GenCP protocol. It does not support non-Pleora devices.

    Use of the PvDeviceSerialPort class to directly access the camera head 
    will interfere with the synchronization between the device and the camera 
    head. Avoid accessing device features linked to the 
    camera head while using the PvDeviceSerialPort class to interact with the camera head.
    
    <h2>How to use this class</h2>
    
    
    <b>To use a serial port:</b>
        - Connect to a device using any of the PvDevice::Connect methods.
        - Open a serial port to the device using PvDeviceSerialPort::Open.
        - Write to the serial port using PvSerialPort::Write.
        - Read from the serial port using PvSerialPort::Read.
        - Finally close the serial port using PvDeviceSerialPort::Close.
    
    <b>To check if a device supports a specific serial port:</b>
        - Connect to a device using any of the PvDevice::Connect methods.
        - Use the PvDeviceSerialPort::IsSupported static method.
    
    For a simple example illustrating how to use PvDeviceSerialPort, refer to the sample entitled DeviceSerialPort.
    

    Constructors

    View Source

    PvDeviceSerialPort()

    Constructor.

    Declaration
    public PvDeviceSerialPort()

    Fields

    View Source

    swigCMemOwn

    Determines who is responsible for deleting the underlying C++ object.

    Declaration
    protected bool swigCMemOwn
    Field Value
    Type Description
    bool

    Properties

    View Source

    BytesReceived

    Gets the total number of bytes received through the serial port.

    Declaration
    public ulong BytesReceived { get; }
    Property Value
    Type Description
    ulong
    View Source

    BytesSent

    Gets the total number of bytes sent through the serial port.

    Declaration
    public ulong BytesSent { get; }
    Property Value
    Type Description
    ulong
    View Source

    IsOpened

    Gets whether the serial port is currently opened.

    Declaration
    public bool IsOpened { get; }
    Property Value
    Type Description
    bool

    Methods

    View Source

    Close()

    Closes the serial port.

    Declaration
    public PvResult Close()
    Returns
    Type Description
    PvResult

    Includes:

    • #PvResult::Code::OK
    • #PvResult::Code::NOT_CONNECTED if the port was already closed
    View Source

    Dispose()

    Dispose.

    Declaration
    public void Dispose()
    View Source

    Dispose(bool)

    Dispose

    Declaration
    protected virtual void Dispose(bool disposing)
    Parameters
    Type Name Description
    bool disposing
    View Source

    ~PvDeviceSerialPort()

    Destructor.

    Declaration
    protected ~PvDeviceSerialPort()
    View Source

    FlushRxBuffer()

    Empties the read buffer.

    Declaration
    public PvResult FlushRxBuffer()
    Returns
    Type Description
    PvResult

    Includes:

    • #PvResult::Code::OK
    View Source

    GetRxBufferSize(out uint)

    Returns the current capacity of the receive buffer.

    Declaration
    public PvResult GetRxBufferSize(out uint aSize)
    Parameters
    Type Name Description
    uint aSize

    Current capacity of the receive buffer.

    Returns
    Type Description
    PvResult

    Includes:

    • #PvResult::Code::OK
    View Source

    GetRxBytesReady(out uint)

    Returns the number of bytes in the read buffer.

    Declaration
    public PvResult GetRxBytesReady(out uint aBytes)
    Parameters
    Type Name Description
    uint aBytes

    Number of bytes currently queued in the receive buffer.

    Returns
    Type Description
    PvResult

    Includes:

    • #PvResult::Code::OK
    View Source

    GetWriteProgress(out uint, out uint)

    Gets the progress of an ongoing write operation.

    Declaration
    public PvResult GetWriteProgress(out uint aWritten, out uint aTotal)
    Parameters
    Type Name Description
    uint aWritten

    How many bytes have been written up to now.

    uint aTotal

    Total number of bytes to write.

    Returns
    Type Description
    PvResult

    Includes:

    • #PvResult::Code::OK
    • #PvResult::Code::STATE_ERROR if no write operation has been performed yet.
    View Source

    IsSupported(IPvDeviceAdapterSwigInterface, PvDeviceSerial)

    Tests if a specific serial port is supported on a device.

    Declaration
    public static bool IsSupported(IPvDeviceAdapterSwigInterface aDevice, PvDeviceSerial aPort)
    Parameters
    Type Name Description
    IPvDeviceAdapterSwigInterface aDevice

    Pointer to a #PvDevice object. The device must be connected.

    PvDeviceSerial aPort

    #PvDeviceSerial enumeration value representing the device's serial port.

    Returns
    Type Description
    bool

    True if supported.

    View Source

    NotifyReadComplete()

    Method used to trigger a OnReadComplete event to PvDeviceSerialPortEchoSink subscribers.

    Declaration
    public PvResult NotifyReadComplete()
    Returns
    Type Description
    PvResult

    Includes:

    • #PvResult::Code::OK
    View Source

    Open(IPvDeviceAdapterSwigInterface, PvDeviceSerial)

    Opens the serial port.

    Declaration
    public PvResult Open(IPvDeviceAdapterSwigInterface aDevice, PvDeviceSerial aPort)
    Parameters
    Type Name Description
    IPvDeviceAdapterSwigInterface aDevice

    Pointer to a #PvDevice object. The device must be connected prior to opening a serial port.

    PvDeviceSerial aPort

    #PvDeviceSerial enumeration value representing the device's serial port to open.

    Returns
    Type Description
    PvResult

    Includes:

    • #PvResult::Code::OK
    • #PvResult::Code::INVALID_PARAMETER if aDevice is NULL.
    • #PvResult::Code::NOT_CONNECTED if the device is not connected.
    • #PvResult::Code::NOT_SUPPORTED if the port is not supported by the device.
    View Source

    Read(byte*, uint, out uint)

    Reads from the serial port.

    Declaration
    public PvResult Read(byte* aBuffer, uint aBufferSize, out uint aBytesRead)
    Parameters
    Type Name Description
    byte* aBuffer

    Pointer to the buffer where the received bytes are written to.

    uint aBufferSize

    Size of the buffer or maximum number of bytes that are read from the serial port.

    uint aBytesRead

    Number of bytes read from the serial port.

    Returns
    Type Description
    PvResult

    Includes:

    • #PvResult::Code::OK
    • #PvResult::Code::NOT_CONNECTED if the port is not opened or the associated #PvDevice is no longer connected.
    • #PvResult::Code::TIMEOUT if no data is available aTimeout ms after calling this method.
    View Source

    Read(byte*, uint, out uint, uint)

    Reads from the serial port.

    Declaration
    public PvResult Read(byte* aBuffer, uint aBufferSize, out uint aBytesRead, uint aTimeout)
    Parameters
    Type Name Description
    byte* aBuffer

    Pointer to the buffer where the received bytes are written to.

    uint aBufferSize

    Size of the buffer or maximum number of bytes that are read from the serial port.

    uint aBytesRead

    Number of bytes read from the serial port.

    uint aTimeout

    Time to wait for new bytes, in ms.

    Returns
    Type Description
    PvResult

    Includes:

    • #PvResult::Code::OK
    • #PvResult::Code::NOT_CONNECTED if the port is not opened or the associated #PvDevice is no longer connected.
    • #PvResult::Code::TIMEOUT if no data is available aTimeout ms after calling this method.
    View Source

    RegisterEchoSink(PvDeviceSerialPortEchoSink)

    Registers an echo sink for all device serial communication in the process.

    Declaration
    public static PvResult RegisterEchoSink(PvDeviceSerialPortEchoSink aSink)
    Parameters
    Type Name Description
    PvDeviceSerialPortEchoSink aSink

    pointer to an object of a class inheriting PvDeviceSerialPortEchoSink.

    Returns
    Type Description
    PvResult

    Includes:

    • #PvResult::Code::OK
    • #PvResult::Code::INVALID_PARAMETER if aSink is NULL
    • #PvResult::Code::NOT_SUPPORTED if aSink is already registered
    View Source

    ResetStatistics()

    Resets the port statistics.

    Declaration
    public void ResetStatistics()
    View Source

    SetRxBufferSize(uint)

    Sets the capacity of the receive buffer. The receive buffer needs to be big enough to buffer all incoming bytes before the user calls #Read Resizing the receive buffer flushes all data in that buffer.

    Declaration
    public PvResult SetRxBufferSize(uint aSize)
    Parameters
    Type Name Description
    uint aSize

    New capacity for the receive buffer.

    Returns
    Type Description
    PvResult

    Includes:

    • #PvResult::Code::OK
    See Also
    GetRxBufferSize(out uint)
    View Source

    UnregisterEchoSink(PvDeviceSerialPortEchoSink)

    Unregisters an echo sink for all device serial communication in the process.

    Declaration
    public static PvResult UnregisterEchoSink(PvDeviceSerialPortEchoSink aSink)
    Parameters
    Type Name Description
    PvDeviceSerialPortEchoSink aSink

    pointer to the object of a class inheriting PvDeviceSerialPortEchoSink to unregister.

    Returns
    Type Description
    PvResult

    Includes:

    • #PvResult::Code::OK
    • #PvResult::Code::INVALID_PARAMETER if aSink is NULL
    • #PvResult::Code::NOT_FOUND if the object was not previously registered
    View Source

    Write(byte[], uint, out uint)

    Writes data to the serial port.

    Declaration
    public PvResult Write(byte[] aBuffer, uint aSize, out uint aBytesWritten)
    Parameters
    Type Name Description
    byte[] aBuffer

    Pointer to the buffer containing the bytes to write on the serial port.

    uint aSize

    Number of bytes contained in the buffer of data to write on the serial port.

    uint aBytesWritten

    Number of bytes successfully written on the serial port.

    Returns
    Type Description
    PvResult

    Includes:

    • #PvResult::Code::OK
    • #PvResult::Code::NOT_CONNECTED if the port is not opened or the associated #PvDevice is no longer connected.
    • #PvResult::Code::GENERIC_ERROR if not all bytes could be written to the serial port.

    Implements

    IDisposable
    • View Source
    In this article
    Back to top Generated by DocFX