[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
COM_MSR()
Reads the Modem Status Register (MSR)
------------------------------------------------------------------------------
Syntax
COM_MSR(<nComPort>) --> nMSR
Argument
<nComPort> Designates the port (1 to 4) for which the Modem Status
Register is read. COM1(1) to COM4(4) are possible.
Returns
COM_MSR() returns a value between 0 and 255 that corresponds to the
contents of the MSR.
Description
Not all the values for this status register can be determined from
separate functions. For example, if you need Delta status information,
you can use this function and test the corresponding bit. The
individual bits are defined as follows:
Table 3-5: MC-Register Coding
------------------------------------------------------------------------
Bit Symb. Const. Definition
------------------------------------------------------------------------
0 MSR_ERROR Parameter error
1 MSR_DELTA_CTS DELTA ready to send (DCTS)
2 MSR_DELTA_DSR DELTA data terminal ready (DDSR)
4 MSR_TERI Trailing edge RING (TERI)
8 MSR_DELTA_DCD DELTA data carrier detected (DDCD)
16 MSR_CTS Clear to send (CTS)
32 MSR_DSR Data terminal ready (DSR)
64 MSR_RI RING indicator (RI)
128 MSR_DCD Data carrier detected (DCD)
------------------------------------------------------------------------
Notes
. The simultaneous testing of multiple bits in the MSR is fairly
simple when using a logical AND operation.
. All delta bits in this register are reset using a read
procedure.
Example
nStatus := COM_MSR(1)
IF ISBIT(nStatus, 5) // CTS (Bit-5) active?
. . .
ENDIF
See Also:
COM_CTS()
COM_DSR()
COM_RING()
COM_DCD()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson