EasyManua.ls Logo

Rockwell Automation Allen-Bradley ControlLogix 1756-MVI - Default Chapter; Comport Must be Previously Opened with Mvisp_Open; Reception Queue, and Return Values Correspond Accordingly; Timeout Amount of Time to Wait to Receive Character

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-25
MVIsp_Gets
Syntax:
int MVIsp_Gets(int comport, BYTE *str, BYTE term, int *len,
DWORD timeout);
Parameters:
comport port from which data is to be received
str pointer to array of bytes to receive data
term termination character of 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.
str points to an array of bytes that will receive the data.
len points to the number of bytes to receive.
MVIsp_Gets retrieves bytes from the reception queue until either a
byte is equal to the termination character or the number of bytes
pointed to by len are retrieved. If a byte is retrieved that equals the
termination character, the byte is copied into the array str and the
function returns.
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_Gets. 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. If the queue is not empty,
these characters are removed from the queue and both the str and the
len return values correspond accordingly.

Table of Contents

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

Related product manuals