Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!spool2.mu.edu!news.cs.indiana.edu!news.nd.edu!vangogh!treesh From: treesh@vangogh.helios.nd.edu Newsgroups: comp.sys.cbm Subject: inputting from the modem port in commdore basic Message-ID: <1991Jan3.204035.20778@news.nd.edu> Date: 3 Jan 91 20:40:35 GMT Sender: news@news.nd.edu (USENET News System) Organization: University of Notre Dame, Notre Dame Lines: 36 Hello everyone, I have run into a small snag in programming project that Im currently involved with. I have written a subroutine in basic that looks at the Commodore 128's RS232 port, and waits for a string of ascii (petascii) data to come into it, then will terminate and RETURN from the subroutine once a carrage-return charector is transmitted. The received string will be in the variable a$. This subroutine also needs to monitor two other conditions. "Timeout" and "Carrier Drop". Upon any of these three conditions, the subroutine will terminate with a RETURN, and a$ will contain the valid data, or the error message if either of the two error conditions are ture. This is the code I have that will do the job in C128 basic. 1000 for t=1to1500:get#131,a$:a=peek(rs232status) 1010 ifa=anda$=""then next:a$="timeout":return 1020 ifa=thena$="Loss of Carrier":return 1030 ifa$=chr$(13)thena$=a1$:return 1040 a1$=a1$+a$:goto1000 In 128 basic, this code does the job perfectly so long as the string size does not get too large, since the C128 has a 512 byte rs232 buffer, and the typical string size that this thing will be dealing with is under 100 bytes, it works fine even at 2400 baud connect. So whats the problem?? Well, a 100 byte string sent into this routine will take over 15 solid seconds to return with the received data in a$. The checks for time out and carriere detect are a MUST, and thus thats why I dont use INPUT#131 instead of a incremented GET#131 command. I need a faster way to do all three conditions (valid data, error message 1, error message 2). 1 second is all the time delay I want for the entire string, not 1 second per byte!! Anyone have any ideas for me on this??? ctfm