Remote-processing BASIC 52 Instrukcja Użytkownika Strona 85

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 163
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 84
RPBASIC-52 PROGRAMMING GUIDE
2-66
ON COM$
Syntax: ON COM$port,length,terminator,program line
ON COM$port
Where: port = the com port number 0 or 1
length = number of received characters for an interrupt
terminator = character to cause an interrupt
program line = executes subroutine when length or terminator is met.
Function: Branches to a subroutine when length or terminator criteria is met.
Mode: Run
Use: ON COM$0,5,13,1000 Executes subroutine at line 100 0 when eith er 5 characters or a <CR > is
received.
Cards: RPC-320, RPC-330
DESCRIPTION
ON COM$ is a mu ltitaski ng stat ement. length and terminator parameters are checked on every received
character in the background. If either parameter is met, the program branches to the program line designated.
The first syntax enables ON COM $ while the se cond one turns it off.
When terminator is 0, then character values are not checked. Only a length criteria will cause an interrupt.
Review HARDWAR E AND SOFTWARE INTERRU PTS in the first part of this manual for interrupt
handling and multitasking information. A far more extensive example is shown earlier in this manual under
Serial Multitasking.
RELATED
COM$
ERROR
BAD ARGUM ENT when length or terminator > 255.
EXAMPLE
The following example executes a program at line 1000 when either 5 characters or the <C R> character is
received. The received string is transferred to $(0) minus the <CR > character.
10 STRING 200,20
20 ON COM$0,5,13,1000
100 IDLE
200 GOTO 100
1000 $(0)=COM$(0)
1010 PRINT "COM string:",$(0)
1020 RETURN
Przeglądanie stron 84
1 2 ... 80 81 82 83 84 85 86 87 88 89 90 ... 162 163

Komentarze do niniejszej Instrukcji

Brak uwag