CLProtocol  3.5.1
CLSerial C-Function Interface
CLSERIALEXPORT CLINT32 CLSERIALCC clGetManufacturerInfo (CLINT8 *ManufacturerName, CLUINT32 *bufferSize, CLUINT32 *version)
 This function returns the name of the manufacturer represented by the index parameter and the version of the Camera Link specifications with which the specified .dll complies. More...
 
CLSERIALEXPORT CLINT32 CLSERIALCC clSerialInit (CLUINT32 serialIndex, hSerRef *serialRefPtr)
 This function initializes the device referred to by serialIndex and returns a pointer to an internal serial reference structure. More...
 
CLSERIALEXPORT CLINT32 CLSERIALCC clSerialRead (hSerRef serialRef, CLINT8 *buffer, CLUINT32 *bufferSize, CLUINT32 serialTimeOut)
 This function reads numBytes from the serial device referred to by serialRef. clSerialRead will return when numBytes are available at the serial port or when the serialTimeout period has passed. More...
 
CLSERIALEXPORT CLINT32 CLSERIALCC clSerialWrite (hSerRef serialRef, CLINT8 *buffer, CLUINT32 *bufferSize, CLUINT32 serialTimeOut)
 This function writes the data in the buffer to the serial device referenced by serialRef. More...
 
CLSERIALEXPORT void CLSERIALCC clSerialClose (hSerRef serialRef)
 This function closes the serial device and cleans up the resources associated with serialRef. Upon return, serialRef is no longer usable. More...
 
CLSERIALEXPORT CLINT32 CLSERIALCC clGetNumSerialPorts (CLUINT32 *numSerialPorts)
 This function returns the number of serial ports in your system from a specified manufacturer. Use this number to determine the number of times you should loop through the clGetSerialPortIdentifier function. More...
 
CLSERIALEXPORT CLINT32 CLSERIALCC clGetSerialPortIdentifier (CLUINT32 serialIndex, CLINT8 *PortID, CLUINT32 *bufferSize)
 
CLSERIALEXPORT CLINT32 CLSERIALCC clGetNumBytesAvail (hSerRef serialRef, CLUINT32 *numBytes)
 This function will output how many bytes have are available at the port specified by serialRef. More...
 
CLSERIALEXPORT CLINT32 CLSERIALCC clFlushPort (hSerRef serialRef)
 This function will discard any bytes that are available in the input buffer. More...
 
CLSERIALEXPORT CLINT32 CLSERIALCC clGetSupportedBaudRates (hSerRef serialRef, CLUINT32 *baudRates)
 This function returns the valid baud rates of the current interface. More...
 
CLSERIALEXPORT CLINT32 CLSERIALCC clSetBaudRate (hSerRef serialRef, CLUINT32 baudRate)
 This function sets the baud rate for the serial port of the selected device. Use clGetSupportedBaudRate to determine supported baud rates. More...
 
CLSERIALEXPORT CLINT32 CLSERIALCC clGetErrorText (CLINT32 errorCode, CLINT8 *errorText, CLUINT32 *errorTextSize)
 This function converts an error code to error text for display in a dialog box or in a standard I/O window. More...
 

Detailed Description

Function Documentation

◆ clGetManufacturerInfo()

CLSERIALEXPORT CLINT32 CLSERIALCC clGetManufacturerInfo ( CLINT8 *  ManufacturerName,
CLUINT32 *  bufferSize,
CLUINT32 *  version 
)
Returns
At completion, this function returns one of the following status codes: CL_ERR_NO_ERR CL_ERR_BUFFER_TOO_SMALL CL_ERR_FUNCTION_NOT_FOUND CL_ERR_INVALID_INDEX
Parameters
ManufacturerNameA pointer to a user-allocated buffer into which the function copies the manufacturer name. The returned name is NULL-terminated. In the case that the .dll conforms to the October 2000 spec, this parameter will contain the file name of the .dll rather than the manufacturer name.
bufferSizeAs an input, this value should be the size of the buffer that is passed. On successful return, this parameter contains the number of bytes written into the buffer, including the NULL termination character. On CL_ERR_BUFFER_TOO_SMALL, this parameter contains the size of the buffer needed to write the data text.
versionThe version of the Camera Link Specifications with which this .dll complies.

◆ clSerialInit()

CLSERIALEXPORT CLINT32 CLSERIALCC clSerialInit ( CLUINT32  serialIndex,
hSerRef *  serialRefPtr 
)
Returns
On completion, this function returns one of the following status codes: CL_ERR_NO_ERR CL_ERR_PORT_IN_USE CL_ERR_INVALID_INDEXa pointer to the vendor-specific reference to the current session.
Parameters
serialIndexA zero-based index value. For n serial devices in your system supported by this library, serialIndex has a range of 0 to(n-1). The order of the serial devices is vendor specific.
serialRefPtrPoints to a value that contains, on a successful call,

◆ clSerialRead()

CLSERIALEXPORT CLINT32 CLSERIALCC clSerialRead ( hSerRef  serialRef,
CLINT8 *  buffer,
CLUINT32 *  bufferSize,
CLUINT32  serialTimeOut 
)

Upon success, numBytes are copied into buffer. In the case of any error, including CL_ERR_TIMEOUT, no data is copied into buffer.

Returns
On completion, this function returns one of the following status codes: CL_ERR_NO_ERR CL_ERR_TIMEOUT CL_ERR_INVALID_REFERENCE
Parameters
serialRefThe value obtained from the clSerialInit function.
bufferPoints to a user-allocated buffer. Upon a successful call, buffer contains the data read from the serial device. Upon failure, this buffer is not affected. Caller should ensure that buffer is at least numBytes in size.
bufferSizeThis is the number of bytes requested by the caller.
serialTimeOutIndicates the timeout in milliseconds.

◆ clSerialWrite()

CLSERIALEXPORT CLINT32 CLSERIALCC clSerialWrite ( hSerRef  serialRef,
CLINT8 *  buffer,
CLUINT32 *  bufferSize,
CLUINT32  serialTimeOut 
)
Returns
On completion, this function returns one of the following status codes: CL_ERR_NO_ERR CL_ERR_INVALID_REFERENCE CL_ERR_TIMEOUT
Parameters
serialRefThe value obtained from the clSerialInit function.
bufferContains data to write to the serial device.
bufferSizeContains the buffer size indicating the number of bytes to be written. Upon a successful call, bufferSize contains the number of bytes written to the serial device.
serialTimeOutIndicates the timeout in milliseconds.

◆ clSerialClose()

CLSERIALEXPORT void CLSERIALCC clSerialClose ( hSerRef  serialRef)
Parameters
serialRefThe value obtained from the clSerialInit function for clean up.

◆ clGetNumSerialPorts()

CLSERIALEXPORT CLINT32 CLSERIALCC clGetNumSerialPorts ( CLUINT32 *  numSerialPorts)
Returns
At completion, this function returns one of the following status codes: CL_ERR_NO_ERR CL_ERR_FUNCTION_NOT_FOUND CL_ERR_MANU_DOES_NOT_EXISTthat you can access with the current .dll.
Parameters
numSerialPortsThe number of serial ports in your system

◆ clGetSerialPortIdentifier()

CLSERIALEXPORT CLINT32 CLSERIALCC clGetSerialPortIdentifier ( CLUINT32  serialIndex,
CLINT8 *  PortID,
CLUINT32 *  bufferSize 
)

is passed. On successful return, this parameter contains the number of bytes written into the buffer, including the NULL termination character. On CL_ERR_BUFFER_TOO_SMALL, this parameter contains the size of the buffer needed to write the data text.

Parameters
serialIndexA zero-based index value. The valid range for serialIndex is 0 to n-1, where n is the value of numSerialPorts, as returned by clGetNumManuSerialPorts.
PortIDManufacturer-specific identifier for the serial port. In the case that the manufacturer .dll conforms to the October 2000 specification, on return this parameter will be "Port #n" where n is a unique index for the port.
bufferSizeAs an input, this value should be the size of the buffer that

◆ clGetNumBytesAvail()

CLSERIALEXPORT CLINT32 CLSERIALCC clGetNumBytesAvail ( hSerRef  serialRef,
CLUINT32 *  numBytes 
)
Returns
At completion, this function returns one of the following status codes: CL_ERR_NO_ERR CL_ERR_INVALID_REFERENCE CL_ERR_FUNCTION_NOT_FOUND
Parameters
serialRefThe value obtained by the clSerialInit function.
numBytesThe number of bytes currently available to be read from the port.

◆ clFlushPort()

CLSERIALEXPORT CLINT32 CLSERIALCC clFlushPort ( hSerRef  serialRef)
Returns
At completion, this function returns one of the following status codes: CL_ERR_NO_ERR CL_ERR_INVALID_REFERENCE
Parameters
serialRefThe value obtained by the clSerialInit function that describes the port to be flushed.

◆ clGetSupportedBaudRates()

CLSERIALEXPORT CLINT32 CLSERIALCC clGetSupportedBaudRates ( hSerRef  serialRef,
CLUINT32 *  baudRates 
)
Returns
At completion, this function returns one of the following status codes: CL_ERR_NO_ERR CL_ERR_INVALID_REFERENCE CL_ERR_FUNCTION_NOT_FOUNDas described by serialRefPtr. See Table B-2 of the Camera Link documentation for more information on constants.
Parameters
serialRefPoints to a value that contains, on a successful call, a pointer to the vendor-specific reference to the current session.
baudRatesBit-field that describes all supported baud rates of the serial port

◆ clSetBaudRate()

CLSERIALEXPORT CLINT32 CLSERIALCC clSetBaudRate ( hSerRef  serialRef,
CLUINT32  baudRate 
)
Returns
On completion, this function returns one of the following status codes: CL_ERR_NO_ERR CL_ERR_INVALID_REFERENCE CL_ERR_BAUD_RATE_NOT_SUPPORTEDvalues represented by the CL_BAUDRATE constants in table B-2. By default, the baud rate for serial communication is 9600.
Parameters
serialRefThe value obtained from the clSerialInit function.
baudRateThe baud rate you want to use. This parameter expects the

◆ clGetErrorText()

CLSERIALEXPORT CLINT32 CLSERIALCC clGetErrorText ( CLINT32  errorCode,
CLINT8 *  errorText,
CLUINT32 *  errorTextSize 
)

Note: clGetErrorText first looks for the error code in CCTserial.dll. If the error code is not found in CCTserial.dll, it is not a standard Camera Link error. clGetErrorText then passes the error code to the manufacturer-specific .dll, which returns the manufacturer-specific error text.

Returns
On completion, this function returns one of the following status codes: CL_ERR_NO_ERR CL_ERR_BUFFER_TOO_SMALL CL_ERR_ERROR_NOT_FOUNDinto the buffer, including the NULL-termination character. This value should be the size in bytes of the error text buffer passed in. On CL_ERR__BUFFER_TOO_SMALL, contains the size of the buffer needed to write the error text.
Parameters
errorCodeThe error code used to find the appropriate error text. An error code is returned by every function in this library.
errorTextA caller-allocated buffer which contains the NULL-terminated error text on function return.
errorTextSizeOn success, contains the number of bytes written