OpenComm

int OpenComm(lpszDevControl, cbInQueue, cbOutQueue)

LPCSTR lpszDevControl;

/* Address of the device control information */

UNIT

cbInQueue;

/* Size of the reception queue */

UNIT

cbOutQueue;

/* Size of the transmission queue */

The OpenComm function will open the communication device.

<Parameter >

lpszDevControl: Pointer to a character string that ends with a NULL. This character string is the

 

device name in the format of COMn (n denotes the device number).

cbInQueue:

Specifies the size of the reception queue in bytes.

cbOutQueue:

Specifies the size of the transmission queue in bytes.

<Return value >

Returns a value that identifies the opened device if the function is terminated normally. Otherwise it

returns a value less than zero.

<Error values >

IE_BADID

IE_BAUDRATE IE_BYTESIZE IE_ DEFAULT IE_HARDWARE IE_MEMORY IE_NOPEN IE_OPEN

Note:

The device ID is invalid or not supported. The device baud rate is not supported. The specified byte size is invalid.

The default parameter is incorrect.

The hardware is not available (locked by another device). The function cannot assign a queue.

The device is not open

The device is already open. If calling this function by specifying zero for the size of both the queues, IE_OPEN or IE_MEMORY will be returned depending on whether the device is already open.

For Windows COM ports 1 through 9 are available. If the device driver does not support these

communication port numbers, execution of the OpenComm function fails. The communication

device is initialized by the default settings. To set other values for the device use the SetCommState

function. The reception and transmission queues are used for the interrupt-driven type device driver.

121

Page 121
Image 121
Casio IT-2000W manual OpenComm, Error values