User`s manual
Graphic Operation Terminal F930GOT Introduction 1
1-37
• Program example
This program writes "31,000" to D10, and "15,600" to D11. In hexadecimal, "31,000" is
expressed as "7918H", and "15,600" as "3CF0H".
10' Sample program
20'
500 T0=3000
: ‘ Counter waiting for receive (to be adjusted in accordance with speed of computer)
530 ERFLG=0
610 STX$=CHR$(2)
620 CR$=CHR$(13)
630 ACK$=CHR$(6)
640 NAK$=CHR$(&H15)
1000 * DATASEND : ‘ Send of statement
1010 CLOSE#1
1020 OPEN"COM1:"AS#1
1030 SENDDATA$="100140479183CF0" : ' Send statement
1040 PRINT#1,STX$;SENDDATA$;CR$;
1100 * REC0 : ' Receive of first character
1110 RVCNT=1
1120 GOSUB *JYUSHIN
1130 IF ERFLG=99 THEN GOTO *ERRORFIN1
1140 BUF$=RCV$
1150 HED$=LEFT$(BUF$,1)
1160 IF HED$=ACK$ THEN GOTO *FIN
1170 * ERRORFIN1
1180 PRINT "Error code is sent back."
1190 GOTO *FIN
1700 * ERRORFIN1
1710 PRINT "No response"
2000 * FIN
2010 CLOSE#1
2020 END
2100 * JYUSHIN : ' Waiting for receive
2110 FORI=1 TO T0
2120 RCV$=""
2130 IF LOC(1)=>RVCNT THEN GOTO *BUFIN
2140 NEXT
2150 IF RCV$=""THEN ERFLG=99
2160 RETURN
2200 * BUFIN : ' Read of receive data
2210 RCV$=INPUT$(RVCNT,#1)
2220 RETURN
D10
D11