[futurebasic] Re: Serial port from FutureBasic

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : January 1998 : Group Archive : Group : All Groups

From: "Kenneth Perrine, PhD" <perrine@...>
Date: Mon, 19 Jan 1998 10:18:14 +0000
Greg:
Thanks for responding.  Below is one of the permutations I've tried. 
It's adapted from the example given in Tech Support Goodies that came
with FB.  I've tried: deleting  HANDSHAKE, changing the baud rate and
deleting all the modem arguments (all the parameters for the modem match
those in the AD/DA manual), changing the number of bytes suffixed to
READ and WRITE (including 0, which the FB Reference suggests), varying
the loop in which the READ is imbedded, and not converting the ASCII
characters.  No matter what, it hangs up if the READ suffix is anything
but 0, and doesn't hang up but returns no data if the READ suffix is 0.
Any ideas?
Thanks, 
Ken

thisPort = _modemPort
_baud = 9600

WINDOW 1, "Receive Data" : TEXT ,,,0
OPEN "C", thisPort, _baud, _noParity, _oneStopBit, _eightBits
HANDSHAKE thisPort, _none
PRINT%(10,20)  "Waiting for data";
L$ = ""
out$="!"+CHR$(48)+"RC"
DO
  WRITE #thisPort, out$;4
  READ #thisPort, rcvd$;0
  char = ASC(rcvd$) AND 127
  IF char AND char <> 13 THEN L$ = L$ + CHR$(char)
UNTIL char = 13 OR INKEY$ = "."
PRINT:PRINT "Received :";L$;"xx"
INPUT "Return to continue";co$

CLOSE #thisPort
END