Rockwell Automation Allen-Bradley ControlLogix 1756-MVI Programming Reference Manual page 114

Multi-vendor interface module
Hide thumbs Also See for Allen-Bradley ControlLogix 1756-MVI:
Table of Contents

Advertisement

5-26
Serial Port API
Publication 1756-RM004B-EN-P - October 2000
MVIsp_Gets
When MVIsp_Gets 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. If the function returns because a termination
character was retrieved, len includes the termination character in the
length.
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.
Note: If handshaking is enabled and the reception queue is full, this
API may pause transmissions from the external device, and timeouts
may then occur.
Return Value:
MVI_SUCCESS
MVI_ERR_NOACCESS
MVI_ERR_BADPARAM
MVI_ERR_TIMEOUT
Example:
BYTE
str[10];
int
nn;
nn = 10;
if (MVIsp_Gets(COM1, &str[0], '\r', &nn, 1000L) = = MVI_SUCCESS)
printf("%d bytes were received\n",nn);
See Also:
MVIsp_Getch
MVIsp_Puts
MVIsp_PutData
bytes were retrieved successfully
comport has not been opened
invalid pointer
timeout elapsed before bytes retrieved

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents