Toggling DTR Handshaking Line (Pin 20) with OUT Statement (37093)
This article was previously published under Q37093
SUMMARY
The communications port DTR line (Pin 20) can be toggled with an OUT
statement. The OUT statement should access the modem control register
in the UART. The modem control register can be accessed by the
following statements:
For COM1, the statement is as follows:
OUT &H3FC, INP(&H3FC) OR 1 ' Sets low bit to turn DTR on.
OUT &H3FC, INP(&H3FC) AND &HFE ' Clears low bit to turn off DTR.
For COM2, the statement is as follows:
OUT &H2FC, INP(&H2FC) OR 1 ' Sets low bit to turn DTR on.
OUT &H2FC, INP(&H2FC) AND &HFE ' Clears low bit to turn off DTR.
This information applies to Microsoft QuickBasic Versions 4.00, 4.00b
and 4.50, to Microsoft Basic Compiler Versions 6.00 and 6.00b for
MS-DOS, and to Microsoft Basic Professional Development System (PDS)
Version 7.00 for MS-DOS.
Modification Type: |
Minor |
Last Reviewed: |
1/8/2003 |
Keywords: |
KB37093 |
|