beautypg.com

Rpbasic-52 programming guide – Remote Processing BASIC 52 User Manual

Page 154

background image

RPBASIC-52 PROGRAMMING GUIDE

B-5

1685 print : print "Sent +++"

1690 return

rem look for OK
rem If have it, send hang up
rem If not, set flag (nokfl) and continue as modem could have
rem been hung up on and lost carrier
rem Send out hang up command any way

1700 uo 1
1710 print "ATH0"
1720 uo 0
1730 nokfl = not(okflg).and.1 : okflg = 0

rem DEBUG

1735 print : print "Sent ATHO."

1740 return

rem Look for OK (must have it). If not there, reset htim=0
rem nokfl set to alert system, and redo cycle
rem Send out reset string to modem. This is a simple one.

1750 if okflg = 0 then htim = 0:nokfl = 1: return
1760 uo 1
1770 print "ATZ"
1780 uo 0
1790 okflg = 0

rem DEBUG

1795 print : print "Sent ATZ"

1800 return

rem Look for OK (must have this one also). If not there, reset
rem htim =0 and redo cycle
rem clear COM(1) to flush out any other erroneous data

1850 clear com(1)
1860 if okflg = 1 then cycle = 0 : return
1870 htim = 0
1890 return

rem

Cycle 5 tick processing

rem Send out sign on message after 3 seconds of waiting

1900 htim = htim + 1
1910 if htim < 3 then return

rem print sign on message and request password

1920 uo 1
1930 print "Remote Processing modem demo"
1940 print "Enter password..."
1950 uo 0

rem DEBUG

1955 print : print "Printed RPC sign on message"

1960 clear com(1)

1970 cycle = 2
1980 atim = 0
1990 return