Main Menu

KB#00001 - BBx programs demonstrating how to communicate with a modem

Title:

BBx programs demonstrating how to communicate with a modem

Description:

The first example opens up the device directly and communicates with it via READ RECORDs and WRITE RECORDs: 

0010 OPEN (1)"/dev/com2" 
0015 WRITE (1)"ATZ"+$0D$ 
0017 REM send a command that dumps the modem setup 
0020 PRINT (1)"AT&V"+$0D$ 
0030 READ RECORD(1,SIZ=-1)A$ 
0035 PRINT HTA(A$)+" "+A$ 
0040 IF A$<>"" THEN GOTO 0030 
0050 CLOSE (1) 
0060 END 


Notes: 
With DOS ports, the DOS MODE command is use to configure the port. 

With Windows, port configuration is done via Control Panel. 


This one is for Unix and uses a pipe to the cu utility provided with Unix. Note that the READ RECORDS and WRITE RECORDS still pertain, as no extra formatting information is desired. 

0100 REM 100 ========================================================
0110 PRINT 'CS' 
0130 A$="| cu -s 2400 -t 2945675" 
0160 OPEN (1)A$ 
0200 REM 200 ========================================================
0210 READ RECORD(1,SIZ=-1,TIM=50,ERR=0300)A$ 
0220 PRINT A$ 
0225 REM 225 ========================================================
0230 REM - use READ RECORDS and WRITE RECORDS here to read/write data 
0240 REM - to cu 
0300 REM 300 ========================================================
0310 PRINT (1)"~." 
0320 PRINT "Closing Connection" 
0330 CLOSE (1) 
0340 END 



Last Modified: 02/10/2004 Product: PRO/5 Operating System: All platforms

BASIS structures five components of their technology into the BBx Generations.

  Google+ View BASIS LinkedIN ProfileVisit our Twitter Feed Check out our Facebook Public Profile Click to View the BASIS youTube channel