imgSessionSerialRead

NI IMAQ Function

imgSessionSerialRead

Usage

rval imgSessionSerialRead(SESSION_ID sid, void* buffer, uInt32* bufSize, uInt32 timeout);

Purpose

Reads in data from the serial port on devices that support serial communication. This function fills the buffer with characters received from the serial port until either a termination character has been received or the timeout period has elapsed. The termination character is defined in the camera file associated with the session.

Parameters

Name Type Direction
sid SESSION_ID input
buffer void* input
bufSize uInt32* input/output
timeout uInt32 input
rval Int32 output

Parameter Discussion

sid: valid SESSION_ID.

buffer: buffer to receive the data read from the serial port.

bufSize: on input, the size of the buffer. On output, the number of bytes read into the buffer.

timeout: time, in milliseconds, to wait for the data to be read.

Return Value

This function returns 0 on success. On failure, this function returns an error code. For information about the error code, call imgShowError.