|
BitFlow.NET
Source code documentation of the BitFlow .NET interface.
|
C# Wrapper class around the clAllSerial functions. More...
Public Types | |
| enum | ErrorCodes { CL_ERR_NO_ERR = ManagedCLErrors.CLErrNoErr, CL_ERR_TIMEOUT = ManagedCLErrors.CLErrTimeout } |
Error codes used in CLAllSerial.
| |
| enum | BFCLErrorCodes { BF_OK = ManagedBFCLReturnCodes.BFCLOk, BFCL_WARN_SIG_CANCEL = ManagedBFCLReturnCodes.BFCLWarnSigCancel } |
Error codes used by the BFSerial library.
| |
| enum | Versions { CL_DLL_VERSION_NO_VERSION = 1, CL_DLL_VERSION_1_0 = 2, CL_DLL_VERSION_1_1 = 3 } |
Camera link versions.
| |
| enum | BaudRates { CL_BAUDRATE_9600 = ManagedCLBaudRate.CLBaudRate9600, CL_BAUDRATE_19200 = ManagedCLBaudRate.CLBaudRate19200, CL_BAUDRATE_38400 = ManagedCLBaudRate.CLBaudRate38400, CL_BAUDRATE_57600 = ManagedCLBaudRate.CLBaudRate57600, CL_BAUDRATE_115200 = ManagedCLBaudRate.CLBaudRate115200, CL_BAUDRATE_230400 = ManagedCLBaudRate.CLBaudRate230400, CL_BAUDRATE_460800 = ManagedCLBaudRate.CLBaudRate460800, CL_BAUDRATE_921600 = ManagedCLBaudRate.CLBaudRate921600 } |
Camera link baud rates.
| |
| enum | DataBits { DataBits_5 = ManagedCLDataBits.CLDataBits5, DataBits_6 = ManagedCLDataBits.CLDataBits6, DataBits_7 = ManagedCLDataBits.CLDataBits7, DataBits_8 = ManagedCLDataBits.CLDataBits8 } |
Camera link data bits. This is the number of bits for each character received or transmitted.
| |
| enum | Parity { ParityEven = ManagedCLParity.CLParityEven, ParityOdd = ManagedCLParity.CLParityOdd, ParityNone = ManagedCLParity.CLParityNone } |
Specifies the parity to be used if any. The parity can be set to one of the following:
| |
| enum | StopBits { StopBits_1 = ManagedCLStopBits.CLStopBits1, StopBits_15 = ManagedCLStopBits.CLStopBits15, StopBits_2 = ManagedCLStopBits.CLStopBits2 } |
Specifies the number of stop bits transmitted and received in each serial character. The number of stop bits can be set to one of the following:
| |
Public Member Functions | |
| void | SerialInit (uint SerialIndex) |
| Initializes the device referred to by serialIndex. Only CL boards are considered a serial device. More... | |
| void | BFSerialInit (uint BoardIndex) |
| Alternate initializer, initializing from a BitFlow board index, rather than from the CLSerial port index, which may or may not directly correspond. More... | |
| void | BFSWConnectorSerialInit (uint Switch, uint Connector) |
| Alternate initializer, initializing from a BitFlow board switch and connector, rather than from the CLSerial port index, which may or may not directly correspond. More... | |
| void | GetBoardSWConnector (ref uint Switch, ref uint Connector) |
| Return the BitFlow board's Switch and Connector for the currently Initialized port. This is only valid if initialized with More... | |
| void | SerialClose () |
| Closes the serial device and cleans up resources associated with it. Does nothing, if the device is not Initialized. More... | |
| uint | SerialWrite (string Message, uint SerialTimeout) |
| This method writes a string of characters to the serial device. More... | |
| ErrorCodes | SerialWrite (byte[] Buffer, ref uint BufferSize, uint SerialTimeout) |
| This method writes a data to the serial device. More... | |
| uint | SerialWrite (sbyte[] Buffer, uint SerialTimeout) |
| This method writes a buffer of signed bytes to the serial device. More... | |
| uint | SerialWrite (byte[] Buffer, uint SerialTimeout) |
| This method writes a buffer of unsigned bytes to the serial device. More... | |
| string | SerialRead (uint NumBytesToRead, uint SerialTimeout) |
| Reads data from the serial device. More... | |
| ErrorCodes | SerialRead (byte[] Buffer, ref uint BufferSize, uint SerialTimeout) |
| Reads data from the serial device. More... | |
| sbyte[] | SerialReadArray (uint NumBytesToRead, uint SerialTimeout) |
| Reads data from the serial device and return it directly. More... | |
| void | FlushPort () |
| Discards any bytes that are available in the input buffer. More... | |
| uint | GetNumBytesAvail () |
| Returns the number of bytes that are received, but not yet read out of the the serial device. More... | |
| BaudRates | GetSupportedBaudRates () |
| Returns the valid baud rates of the interface. The return value is represented as a bitfield with the bitfield values be as follows: CL_BAUDRATE_9600 - bit 1 CL_BAUDRATE_19200 - bit 2 CL_BAUDRATE_38400 - bit 3 CL_BAUDRATE_57600 - bit 4 CL_BAUDRATE_115200 - bit 5 CL_BAUDRATE_230400 - bit 6 CL_BAUDRATE_460800 - bit 7 CL_BAUDRATE_921600 - bit 8 More... | |
| void | SetBaudRate (BaudRates BaudRate) |
| Sets the Baud Rate for the serial port. More... | |
| void | BFSerialSettings (BaudRates baudRate, DataBits dataBits, Parity parity, StopBits stopBits) |
| Set the BF CLSerial settings. More... | |
| string | BFSerialRead (uint MaxBytesToRead) |
| Reads data from the serial device. This method will wait efficiently for data to become available on the port, then return that length of data. No more than MaxBytesToRead will be read at a time, but the length read may be less than that. More... | |
| BFCLErrorCodes | BFSerialRead (byte[] Buffer, ref uint BufferSize) |
| Reads data from the serial device. This method will wait efficiently for data to become available on the port, then return that length of data. More... | |
| sbyte[] | BFSerialReadArray (uint MaxBytesToRead) |
| Reads data from the serial device and return it directly. More... | |
| void | BFSerialCancelRead () |
| Cancel the active call to clBFSerialRead. More... | |
| BaudRates | BFGetBaudRate () |
| Return the current baud-rate of the CLSerial port. More... | |
Static Public Member Functions | |
| static string | GetErrorText (ErrorCodes ErrorCode) |
| Converts an error code to error text which can be displayed in a dialog box or in the standard I/O window. More... | |
| static uint | GetNumPorts () |
| Returns the number of Camera Link serial ports in this machine that are supported by clallserial.dll. More... | |
| static void | GetPortInfo (uint SerialIndex, ref string ManufacturerName, ref string PortID, ref uint Version) |
| This function provides information about the port specified by the serial index. More... | |
| static void | BFSVersion (ref UInt32 majorVersionRef, ref UInt32 minorVersionRef) |
| Retrieve the version of the loaded BFS library. More... | |
Properties | |
| bool | Initialized [get] |
| Retrieve the initialization status. More... | |
| bool | PortIsBF [get] |
| Return the support status for the BitFlow CLSerial extensions. More... | |
| uint | PortIndex [get] |
| Return the index of the currently Initialized port. This is only valid if initialized with the More... | |
| uint | BoardNumber [get] |
| Return the BitFlow board number of the currently Initialized port. This is only valid if initialized with the More... | |
| uint | BoardSwitch [get] |
| Retrieve the BitFlow board's Switch for the currently Initialized port. This is only valid if initialized with More... | |
| uint | BoardConnector [get] |
| Retrieve the BitFlow board's Connector for the currently Initialized port. This is only valid if initialized with More... | |
C# Wrapper class around the clAllSerial functions.
Camera link baud rates.
Error codes used by the BFSerial library.
Camera link data bits. This is the number of bits for each character received or transmitted.
Error codes used in CLAllSerial.
Specifies the parity to be used if any. The parity can be set to one of the following:
Specifies the number of stop bits transmitted and received in each serial character. The number of stop bits can be set to one of the following:
Camera link versions.
| BaudRates CLComm.CLAllSerial.BFGetBaudRate | ( | ) |
Return the current baud-rate of the CLSerial port.
| System.InvalidOperationException | Thrown if no port has been initailized. |
| System.ApplicationException | Thrown if an error occurs while reading the baud-rate. |
| System.NotSupportedException | Thrown if the initialied port is not a BF port. |
| void CLComm.CLAllSerial.BFSerialCancelRead | ( | ) |
Cancel the active call to clBFSerialRead.
| System.InvalidOperationException | Thrown if no port has been initailized. |
| System.ApplicationException | Thrown if an error occurs while canceling the read. |
| System.NotSupportedException | Thrown if the initialied port is not a BF port. |
| void CLComm.CLAllSerial.BFSerialInit | ( | uint | BoardIndex | ) |
Alternate initializer, initializing from a BitFlow board index, rather than from the CLSerial port index, which may or may not directly correspond.
| BoardIndex | The BitFlow board number who's CLSerial device we want to open. This is the index of the correspoding BitFlow board, and not necessarily the index used by the CLSerial library. |
| System.InvalidOperationException | Thrown if a port has already been initailized. |
| System.ApplicationException | Thrown when there is a problem initializing the serial device. |
| string CLComm.CLAllSerial.BFSerialRead | ( | uint | MaxBytesToRead | ) |
Reads data from the serial device. This method will wait efficiently for data to become available on the port, then return that length of data. No more than MaxBytesToRead will be read at a time, but the length read may be less than that.
| MaxBytesToRead | The maximum number of bytes to be read from the serial device. |
| System.InvalidOperationException | Thrown if no port has been initailized. |
| System.ApplicationException | Thrown when there is a problem reading from the serial device. |
| System.OperationCanceledException | Thrown if the function is exiting because of a call to BFSerialCancelRead. |
| System.NotSupportedException | Thrown if the initialied port is not a BF port. |
| BFCLErrorCodes CLComm.CLAllSerial.BFSerialRead | ( | byte[] | Buffer, |
| ref uint | BufferSize | ||
| ) |
Reads data from the serial device. This method will wait efficiently for data to become available on the port, then return that length of data.
| Buffer | Points to a user-allocated buffer. Upon a successful call, contains the data read from the serial device. |
| BufferSize | As an input parameter, BufferSize contains the buffer size to indicate the maximum number of bytes that the buffer can accomodate. Upon a successful call, BufferSize is the number of bytes that were read successfully from the serial device. |
| System.ApplicationException | Thrown when there is a problem reading from the serial device. |
| System.NotSupportedException | Thrown if the initialied port is not a BF port. |
| sbyte [] CLComm.CLAllSerial.BFSerialReadArray | ( | uint | MaxBytesToRead | ) |
Reads data from the serial device and return it directly.
| MaxBytesToRead | The maximum number of bytes to be read from the serial device. |
| System.ApplicationException | Thrown when there is a problem reading from the serial device. |
| System.InvalidOperationException | Thrown if no port has been initailized. |
| System.OperationCanceledException | Thrown if the function is exiting because of a call to BFSerialCancelRead. |
| System.NotSupportedException | Thrown if the initialied port is not a BF port. |
| void CLComm.CLAllSerial.BFSerialSettings | ( | BaudRates | baudRate, |
| DataBits | dataBits, | ||
| Parity | parity, | ||
| StopBits | stopBits | ||
| ) |
Set the BF CLSerial settings.
| baudRate | The baud rate you want to use. Can be one of the following: CL_BAUDRATE_9600 CL_BAUDRATE_19200 CL_BAUDRATE_38400 CL_BAUDRATE_57600 CL_BAUDRATE_115200 CL_BAUDRATE_230400 CL_BAUDRATE_460800 CL_BAUDRATE_921600 |
| dataBits | The number of data bits in each transmitted or received serial character. May be any of the following: DataBits_5 DataBits_6 DataBits_7 DataBits_8 |
| parity | The parity to be used if any. The parity can be set to one of the following: ParityEven ParityOdd ParityNone |
| stopBits | Specifies the number of stop bits transmitted and received in each serial character. The number of stop bits can be set to one of the following: StopBits_1 - One stop bit. StopBits_15 - One and a half stop bits. StopBits_2 - Two stop bits. |
| System.InvalidOperationException | Thrown if no port has been initailized. |
| System.ApplicationException | Thrown when there is a problem one or all of the settings. |
| System.NotSupportedException | Thrown if the initialied port is not a BF port. |
|
static |
Retrieve the version of the loaded BFS library.
| majorVersionRef | Return reference for the major version. |
| minorVersionRef | Return reference for the minor version. |
| System.ApplicationException | Thrown if an error occurs retrieving the library version. |
| void CLComm.CLAllSerial.BFSWConnectorSerialInit | ( | uint | Switch, |
| uint | Connector | ||
| ) |
Alternate initializer, initializing from a BitFlow board switch and connector, rather than from the CLSerial port index, which may or may not directly correspond.
| Switch | The switch setting of the BitFlow board who's CLSerial device we want to open. |
| Connector | The connector of the switched BitFlow board who's CLSerial device we want to open. |
| System.InvalidOperationException | Thrown if a port has already been initailized. |
| System.ApplicationException | Thrown when there is a problem initializing the serial device. |
| void CLComm.CLAllSerial.FlushPort | ( | ) |
Discards any bytes that are available in the input buffer.
| System.InvalidOperationException | Thrown if no port has been initailized. |
| System.ApplicationException | Thrown when there is a problem flushing the serial device. |
| void CLComm.CLAllSerial.GetBoardSWConnector | ( | ref uint | Switch, |
| ref uint | Connector | ||
| ) |
Return the BitFlow board's Switch and Connector for the currently Initialized port. This is only valid if initialized with
BFSWConnectorSerialInit
| Switch | Set to the value of the initialized board's Switch. |
| Connector | Set to the value of the initialized board's Connector. |
|
static |
Converts an error code to error text which can be displayed in a dialog box or in the standard I/O window.
| ErrorCode | The error code used to look up the appropriate error text. |
| System.ApplicationException | Thrown when the error code could not be found. |
| uint CLComm.CLAllSerial.GetNumBytesAvail | ( | ) |
Returns the number of bytes that are received, but not yet read out of the the serial device.
| System.InvalidOperationException | Thrown if no port has been initailized. |
| System.ApplicationException | Thrown when an error occurs when trying to get the number of bytes available from the serial device. |
|
static |
Returns the number of Camera Link serial ports in this machine that are supported by clallserial.dll.
| System.ApplicationException | Thrown when there is a problem getting the number of CL serial devices. |
|
static |
This function provides information about the port specified by the serial index.
| SerialIndex | Zero-based index of the serial port you are finding the name for. Use GetNumSerialPorts to determine the valid range of serial index. This range will be 0 to number of serial ports - 1. |
| ManufacturerName | Returns the name of the manufacture for the serial index provided. |
| PortID | The identifier for the port. |
| Version | The version of the serial driver. Can be one of the following: CL_DLL_VERSION_NO_VERSION CL_DLL_VERSION_1_0 CL_DLL_VERSION_1_1 |
| System.ApplicationException | Thrown when there is a problem getting serial device information. |
| BaudRates CLComm.CLAllSerial.GetSupportedBaudRates | ( | ) |
Returns the valid baud rates of the interface. The return value is represented as a bitfield with the bitfield values be as follows:
CL_BAUDRATE_9600 - bit 1
CL_BAUDRATE_19200 - bit 2
CL_BAUDRATE_38400 - bit 3
CL_BAUDRATE_57600 - bit 4
CL_BAUDRATE_115200 - bit 5
CL_BAUDRATE_230400 - bit 6
CL_BAUDRATE_460800 - bit 7
CL_BAUDRATE_921600 - bit 8
| System.InvalidOperationException | Thrown if no port has been initailized. |
| System.ApplicationException | Thrown when an error occurs while getting the supported baud rates. |
| void CLComm.CLAllSerial.SerialClose | ( | ) |
Closes the serial device and cleans up resources associated with it. Does nothing, if the device is not Initialized.
| void CLComm.CLAllSerial.SerialInit | ( | uint | SerialIndex | ) |
Initializes the device referred to by serialIndex. Only CL boards are considered a serial device.
| SerialIndex | The serial device number to open. This is the CLSerial index, which may not correspond directly the the BitFlow board number. Use BFSerialInit, to initialize from a BitFlow board number. |
| System.InvalidOperationException | Thrown if a port has already been initailized. |
| System.ApplicationException | Thrown when there is a problem initializing the serial device. |
| string CLComm.CLAllSerial.SerialRead | ( | uint | NumBytesToRead, |
| uint | SerialTimeout | ||
| ) |
Reads data from the serial device.
| NumBytesToRead | The number of bytes to be read from the serial device. |
| SerialTimeout | Indicates the timeout value in miliseconds. |
| System.ApplicationException | Thrown when there is a problem reading from the serial device. |
| System.InvalidOperationException | Thrown if no port has been initailized. |
| System.TimeoutException | Thrown if the read operation times out. |
| ErrorCodes CLComm.CLAllSerial.SerialRead | ( | byte[] | Buffer, |
| ref uint | BufferSize, | ||
| uint | SerialTimeout | ||
| ) |
Reads data from the serial device.
| Buffer | Points to a user-allocated buffer. Upon a successful call, contains the data read from the serial device. |
| BufferSize | As an input parameter, BufferSize contains the buffer size to indicate the maximum number of bytes that the buffer can accomodate. Upon a successful call, BufferSize is the number of bytes that were read successfully from the serial device. |
| SerialTimeout | Indicates the timeout value in miliseconds. |
| System.InvalidOperationException | Thrown if no port has been initailized. |
| System.ApplicationException | Thrown when there is a problem reading from the serial device. |
| sbyte [] CLComm.CLAllSerial.SerialReadArray | ( | uint | NumBytesToRead, |
| uint | SerialTimeout | ||
| ) |
Reads data from the serial device and return it directly.
| NumBytesToRead | The number of bytes desired to read. |
| SerialTimeout | Indicates the timeout value in miliseconds. |
| System.ApplicationException | Thrown when there is a problem reading from the serial device. |
| System.InvalidOperationException | Thrown if no port has been initailized. |
| System.TimeoutException | Thrown if the read operation times out. |
| uint CLComm.CLAllSerial.SerialWrite | ( | string | Message, |
| uint | SerialTimeout | ||
| ) |
This method writes a string of characters to the serial device.
| Message | The string message to send to the serial device. |
| SerialTimeout | Indicates the timeout value in miliseconds. |
| System.ApplicationException | Thrown when there is a problem writing from the serial device. |
| System.InvalidOperationException | Thrown if no port has been initailized. |
| System.TimeoutException | Thrown if the write operation times out. |
| ErrorCodes CLComm.CLAllSerial.SerialWrite | ( | byte[] | Buffer, |
| ref uint | BufferSize, | ||
| uint | SerialTimeout | ||
| ) |
This method writes a data to the serial device.
| Buffer | Contains data to write to the serial port. |
| BufferSize | As an input parameter, BufferSize contains the number of bytes of data in the buffer to write to the serial device. Upon a successful call, BufferSize contains the number of bytes that were written successfully to the serial device. |
| SerialTimeout | Indicates the timeout value in miliseconds. |
| System.InvalidOperationException | Thrown if no port has been initailized. |
| System.ApplicationException | Thrown when there is a problem writing from the serial device. |
| uint CLComm.CLAllSerial.SerialWrite | ( | sbyte[] | Buffer, |
| uint | SerialTimeout | ||
| ) |
This method writes a buffer of signed bytes to the serial device.
| Buffer | Contains data to write to the serial port. |
| SerialTimeout | Indicates the timeout value in miliseconds. |
| System.ApplicationException | Thrown when there is a problem writing from the serial device. |
| System.InvalidOperationException | Thrown if no port has been initailized. |
| System.TimeoutException | Thrown if the write operation times out. |
| uint CLComm.CLAllSerial.SerialWrite | ( | byte[] | Buffer, |
| uint | SerialTimeout | ||
| ) |
This method writes a buffer of unsigned bytes to the serial device.
| Buffer | Contains data to write to the serial port. |
| SerialTimeout | Indicates the timeout value in miliseconds. |
| System.ApplicationException | Thrown when there is a problem writing from the serial device. |
| System.InvalidOperationException | Thrown if no port has been initailized. |
| System.TimeoutException | Thrown if the write operation times out. |
| void CLComm.CLAllSerial.SetBaudRate | ( | BaudRates | BaudRate | ) |
Sets the Baud Rate for the serial port.
| BaudRate | The baud rate you want to use. Can be one of the following: CL_BAUDRATE_9600 CL_BAUDRATE_19200 CL_BAUDRATE_38400 CL_BAUDRATE_57600 CL_BAUDRATE_115200 CL_BAUDRATE_230400 CL_BAUDRATE_460800 CL_BAUDRATE_921600 |
| System.InvalidOperationException | Thrown if no port has been initailized. |
| System.ApplicationException | Thrown when an error occurs when setting the baud rate. |
|
get |
Retrieve the BitFlow board's Connector for the currently Initialized port. This is only valid if initialized with
BFSWConnectorSerialInit
|
get |
Return the BitFlow board number of the currently Initialized port. This is only valid if initialized with the
BFSerialInit method.
| System.ApplicationException | Thrown if the port is not currently Initialized. |
|
get |
Retrieve the BitFlow board's Switch for the currently Initialized port. This is only valid if initialized with
BFSWConnectorSerialInit
|
get |
Retrieve the initialization status.
|
get |
Return the index of the currently Initialized port. This is only valid if initialized with the
SerialInit method.
| System.ApplicationException | Thrown if the port is not currently Initialized. |
|
get |
Return the support status for the BitFlow CLSerial extensions.