61
COMMUNICATION PROCEDURE (other than NCP20)
:
Example of Communication Program
MLM26*RTZ002F
3
Reference) If the Com mode parameter is set to “PC” on the LM, the control/check process of
DTR becomes unnecessary. Therefore, delete lines 1110, 1130, 1140, 2120, and
3140 in the sample program.
10 '*************************************************************************
20 '* *
30 '* Input Data from LM‑1800P/1800PD V1.00
*
40 '*
by NIDEK 2010. 10.10 *
50 '* *
60 '*************************************************************************
70 '
80 ' SAVE "RS232C.BAS",A
90 '
1000 '‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑
1010 ' READ SW(LM) ‑‑> EXPORT SW(LM) ‑‑> RS(LM) ‑‑> SD(COMP) ‑‑> DATA(LM)
1020 '‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑
1030 CLEAR ,,,3000
1040 CHILD ("SWITCH RS232C‑0 [9600]") ' set 9600 bit/sec
1050 DIM LM$(210)
1060 RS$=CHR$(1)+"C**"+CHR$(2)+"RS"+CHR$(23)+CHR$(4) ' RS command
1070 SD$=CHR$(1)+"CLM"+CHR$(2)+"SD"+CHR$(23)+CHR$(4)
' SD command
1080 FOR I=1 TO 210: LM$(I)="": NEXT I ' buffer clear
1090 '
1100 OPEN "COM:O81NN" AS #1 ' RS‑232C & DTR on
1110 OUT &H32,&H15 ' DTR off
1120 PRINT: PRINT " ** Let's Measure !! ( and LM's PRINT sw on ! ) **"
1130 IF (INP(&H32) AND &H80)=&H0 THEN 1130 ' check DSR on
1140 OUT &H32,&H37 ' DTR on
1150 INPUT #1,C$: IF C$<>RS$ THEN 1150 ' input RS command
1160 PRINT #1,SD$ ' output SD command
1170 FOR I=1 TO 210
1180 INPUT #1,LM$(I) ' input DATA
1190 IF LM$(I)=CHR$(4) THEN 1210 ' check 'EOT(04H)'
1200 NEXT I
1210 CLOSE #1 ' RS‑232C & DTR off
1220 '
1230 BEEP
1240 FOR I=1 TO 210
1250 IF LM$(I)=CHR$(4) THEN 1280
1260 PRINT LM$(I) ' disp DATA
1270 NEXT I
1280 FOR I=1 TO 10000: NEXT I ' wait
1290 GOTO 1100
1300 '
1310 '
2000 '‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑
2010 ' READ SW(LM) ‑‑> SD(COMP) ‑‑> DATA(LM)
2020 '‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑
2030 CLEAR ,,,3000
2040 CHILD ("SWITCH RS232C‑0 [9600]") ' set 9600 bit/sec
2050 DIM LM$(210)
2060 SD$=CHR$(1)+"CLM"+CHR$(2)+"SD"+CHR$(23)+CHR$(4) ' SD command
2070 FOR I=1 TO 210: LM$(I)="": NEXT I ' buffer clear
2080 '
Содержание LM-1800P
Страница 1: ...INTERFACE MANUAL MLM26 RTZ002F LM 1800P LM 1800PD AUTO LENSMETER...
Страница 6: ...2 OUTLINE OF COMMUNICATION Outline of Communication Function MLM26 RTZ002F...
Страница 54: ...50 RS 232C Communication and USB Communication Example of Data Output MLM26 RTZ002F...
Страница 70: ...66 COMMUNICATION PROCEDURE other than NCP20 Flowchart MLM26 RTZ002F...