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

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

Advertisement

MVIsp_GetLineStatus
Syntax:
int
MVIsp_GetLineStatus(int comport, BYTE *status);
Parameters:
comport
port for which line status is requested
status
pointer to BYTE to receive line status
Description:
MVIsp_GetLineStatus returns any line status errors received over the
serial port. The status returned indicates if any overrun, parity, or
framing errors or break signals have been detected.
comport is the desired serial port and must be previously opened with
MVIsp_Open.
status points to a BYTE that will receive a set of flags that indicate
errors received over the serial port. If the returned status is 0, no
errors have been detected. If status is non-zero, it can be logically
and'ed with the line status error flags LSERR_OVERRUN,
LSERR_PARITY, LSERR_FRAMING, LSERR_BREAK, and/or
QSERR_OVERRUN to determine the exact cause of the error. The
corresponding error flag will be set for each error type detected.
(Note: The QSERR_OVERRUN bit indicates that a receive queue
overflow has occurred.)
After returning the bit flags in status, line status errors are cleared.
Therefore, MVIsp_GetLineStatus actually returns line status errors
detected since the previous call to this function.
Return Value:
MVI_SUCCESS
MVI_ERR_NOACCESS
MVI_ERR_BADPARAM
Example:
BYTE
sts;
if (MVIsp_GetGetLineStatus(COM2,&sts) = = MVI_SUCCESS)
{
if (sts = = 0)
printf("No Line Status Errors Received\n");
else if ( (sts & LSERR_BREAK) != 0)
printf("A Break Signal was Received\n");
else
printf("A Line Status Error was Received\n");
}
the line status was read successfully
comport has not been opened
invalid pointer
Publication 1756-RM004B-EN-P - October 2000
Serial Port API
5-19

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents