imgSessionSerialReadBytes

NI IMAQ Function

imgSessionSerialReadBytes

Usage

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

Purpose

Reads in an expected number of bytes from the serial port on image acquisition devices that support serial communication. This function fills the buffer with characters received from the serial port until either the buffer is full or the timeout period has elapsed. When you use this function, the serial termination string attribute is ignored.

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, this is the number of bytes you expect to read. The buffer must be large enough to hold this number of bytes. On output, this is 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.