EasyManua.ls Logo

Rockwell Automation Allen-Bradley ControlLogix 1756-MVI - MVI_ERR_BADPARAM Invalid Pointer; MVI_ERR_NOACCESS Comport Has Not Been Opened; Mvi_Err_Timeout; Return Value: MVI_SUCCESS

Rockwell Automation Allen-Bradley ControlLogix 1756-MVI
145 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Publication 1756-RM004B-EN-P - October 2000
Serial Port API 5-29
MVIsp_GetData
Syntax:
int MVIsp_GetData(int comport, BYTE *data, int *len, DWORD
timeout);
Parameters:
comport port from which data is to be received
data pointer to array of bytes to receive data
len number of bytes to receive / bytes received
timeout amount of time to wait to receive character
Description:
This function is used to receive an array of bytes from a serial port.
comport must be previously opened with MVIsp_Open.
data points to an array of bytes that will receive the data.
len points to the number of bytes to receive.
MVIsp_GetData retrieves bytes from the reception queue until either
the number of bytes pointed to by len are retrieved or the timeout
elapses.
All data received from a port is queued after reception from the serial
port. Therefore, some delay may occur between the time a character is
received across the serial line and the time the character is returned by
MVIsp_GetData. This function attempts to retrieve characters from the
reception queue, and return values correspond accordingly.
timeout specifies the amount of time in milliseconds to wait. If timeout
is TIMEOUT_ASAP, the function will return immediately if the queue is
empty. If timeout is TIMEOUT_FOREVER, the function will not return
until an array of bytes is retrieved from the reception queue
successfully.
If the timeout elapses before the termination character or len bytes are
received, MVI_ERR_TIMEOUT is returned.
When MVIsp_GetData returns, it writes to the int pointed to by len the
number of bytes retrieved. len is written for successfully retrieved
bytes as well as timeouts.
Return Value:
MVI_SUCCESS bytes were retrieved successfully
MVI_ERR_NOACCESS comport has not been opened
MVI_ERR_BADPARAM invalid pointer
MVI_ERR_TIMEOUT timeout elapsed before bytes retrieved

Table of Contents

Other manuals for Rockwell Automation Allen-Bradley ControlLogix 1756-MVI

Related product manuals