Modem carrier detect

 BBS: Inland Empire Archive
Date: 02-01-93 (12:51)             Number: 368
From: CHARLES GRAHAM               Refer#: NONE
  To: JOHN KELLEY                   Recvd: NO  
Subj: Modem carrier detect           Conf: (2) Quik_Bas
> Looking for and example of code to monitor carrier detect.
> Would like to be able to have a local programer using
> Thorobred add carrier detect to his program but he has never
> seen any code as to what to do. I know there has to be
> someone in the Quick Basic world that can do this and
> hopefully we can transfer this to another basic program. Any
> help appreciated.

John - what you need to do is use QuickBASIC to read a byte
at the COM port and check the highest order bit of that
byte. If you're using COM1 the I/O port address is &H3FE.
For COM2 use &H2FE. Put a test like this in your main
communications loop:

                IF NOT INP(&H3FE) AND 128 THEN
                         'you ain't got no carrier
                END IF

Hope this helps...

--- QM v1.30
 * Origin: QwikCom * St Charles MO * 16.8K HST/V32b (1:100/602.0)
Outer Court
Echo Basic Postings

Books at Amazon:

Back to BASIC: The History, Corruption, and Future of the Language

Hackers: Heroes of the Computer Revolution (including Tiny BASIC)

Go to: The Story of the Math Majors, Bridge Players, Engineers, Chess Wizards, Scientists and Iconoclasts who were the Hero Programmers of the Software Revolution

The Advent of the Algorithm: The Idea that Rules the World

Moths in the Machine: The Power and Perils of Programming

Mastering Visual Basic .NET