![background image](http://html.mh-extra.com/html/omron/nt20s/nt20s_operation-manual_744540244.webp)
225
EXAMPLE PROGRAM
Section 6-7
1900 LOCATE 66,12:COLOR 0:PRINT SPACE$(14);
1910 IF YN=–1 THEN GOTO *LV3.END
1920 GOSUB *SEND ’
Send command
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1930 COM(1) ON
1940 LOCATE 43,9:COLOR 4:PRINT ”Press ESC Key”;:COLOR 0
1950 *SND.KY.IN
1960 A$=INKEY$:IF A$<>CHR$(&H1B) THEN *SND.KY.IN
1970 *LV3.END
1980 LOCATE 0,12:PRINT SPACE$(79);
1990 FOR I=0 TO 10
2000 LOCATE 39,I:PRINT SPACE$(40);
2010 NEXT I
2020 GOTO *LV1 ’
Return to Sub-menu
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2030 ’
2040 *PRO.END ’
End routine
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2050 COM(1) OFF:CLOSE ’
Close communication port
. . . . . . . . . . . . . . . . . . . . . . . .
2060 CONSOLE 0,25,0,1:CLS 3
2070 END
2080 ’
2090 *SEND ’
Send command routine
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2100 SND$=CHR$(&H1B)+MID$(SEND$,6)
2110 PRINT #1,SND$
2120 RETURN
2130 ’
2140 *RECV ’
Receive interrupt routine
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2150 IF LOC(1)=0 THEN GOTO *NORCV
2160 SX=POS(0):SY=CSRLIN
2170 LINE INPUT #1,RCV$
2180 LOCATE 0,RY:COLOR 0
2190 PRINT ”[ESC]”;MID$(RCV$,2)
2200 R.CODE$=MID$(RCV$,2,1)
2210 *ESC.Y ’
Notify screen number
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2220 IF R.CODE$<>”Y” THEN GOTO *ESC.E
2230 PRINT ”Screen Number : ”;VAL(”&H”+MID$(RCV$,3,4))
2240 PRINT:GOTO *RCV.END
2250 *ESC.E ’
Notify 4-digit number
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2260 IF R.CODE$<>”E” THEN GOTO *ESC.F
2270 PRINT ”Numeral table # : ”;VAL(”&H”+MID$(RCV$,3,3))
2280 PRINT ”Input decimal value”;VAL(MID$(RCV$,6,4))
2290 PRINT:GOTO *RCV.END
2300 *ESC.F ’
Notify 8-digit number
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2310 IF R.CODE$<>”F” THEN GOTO *ESC.H
2320 PRINT ”Numeral table # : ”;VAL(”&H”+MID$(RCV$,3,3))
2330 IF MID$(RCV$,6,1)=”F” THEN NN=0–VAL(MID$(RCV$,7,7)) ELSE NN=VAL(MID$(RCV$,6,8))
2340 PRINT ”Input decimal value : ”;NN
2350 PRINT:GOTO *RCV.END
Содержание NT20S
Страница 1: ...Cat No V020 E1 04 NT20S Programmable Terminal OPERATION MANUAL ...
Страница 2: ...i ...
Страница 3: ...ii ...
Страница 4: ...iii NT series Programmable Terminal Operation Manual Revised August 1997 ...
Страница 5: ...iv ...
Страница 7: ...vi ...
Страница 11: ...x ...
Страница 19: ...xviii ...
Страница 129: ...110 ...
Страница 169: ...150 ...
Страница 253: ...234 ...