F
flywheel
Unregistered / Unconfirmed
GUEST, unregistred user!
有一段qb程序,如下
10 '
20 OPEN "COM1:9600,N,8,1,LF" FOR RANDOM AS #1
30 PRINT #1, "*RST"
40 PRINT #1, ":TRAN:TERM1"
50 PRINT #1, ":VOLT1:RANG 15O;AUTO OFF;MEAN OFF"
60 PRINT #1, ":CURR1:RANG 10;AUTO OFF;MEAN OFF"
70 PRINT #1, ":SCAL1T 3;CT 2;CONT ON,ON,OFF"
80 PRINT #1, ":TIMER:TIME 1,0;CONTROL ON"
90 PRINT #1, ":INTER:TIME 0,1,0;CONTROL ON"
100 PRINT #1, "*ESE 0;*ESE0 4;*SRE 0"
110 PRINT #1, ":HEAD ON"
120 PRINT #1, "*CLS"
130 PRINT #1, ":INTEG:START"
140 PRINT #1, "*STB?"
150 LINE INPUT #1, A$
160 IF INSTR(A$, "*STB 1") = 0 THEN GOTO 140
170 PRINT #1, ":MEAS? TIME,WP1,PWP1,MWP1"
180 LINE INPUT #1, A$
190 PRINT A$
200 PRINT #1, ":INTEG?"
210 LINE INPUT #1, A$
220 IF INSTR(A$, ":INTEGRATE 0") <> 0 THEN GOTO 250
230 PRINT #1, "*CLS"
240 GOTO 140
250 PRINT #1, ":INTEG:RESET"
260 CLOSE #1
270 END
要把它改成delphi的,我用了mscomm控件,用mscomm1.output把输出字符串一步步输出,但显示好象是通讯联上了但就是没反应,大概是数据输出到仪器时好象有错误,不知这段程序该如何改呢?先谢谢各位大虾指点,一旦解决,分数绝不吝惜。
另:20 OPEN "COM1:9600,N,8,1,LF" FOR RANDOM AS #1
中打开串口,LF是什么意思啊??
10 '
20 OPEN "COM1:9600,N,8,1,LF" FOR RANDOM AS #1
30 PRINT #1, "*RST"
40 PRINT #1, ":TRAN:TERM1"
50 PRINT #1, ":VOLT1:RANG 15O;AUTO OFF;MEAN OFF"
60 PRINT #1, ":CURR1:RANG 10;AUTO OFF;MEAN OFF"
70 PRINT #1, ":SCAL1T 3;CT 2;CONT ON,ON,OFF"
80 PRINT #1, ":TIMER:TIME 1,0;CONTROL ON"
90 PRINT #1, ":INTER:TIME 0,1,0;CONTROL ON"
100 PRINT #1, "*ESE 0;*ESE0 4;*SRE 0"
110 PRINT #1, ":HEAD ON"
120 PRINT #1, "*CLS"
130 PRINT #1, ":INTEG:START"
140 PRINT #1, "*STB?"
150 LINE INPUT #1, A$
160 IF INSTR(A$, "*STB 1") = 0 THEN GOTO 140
170 PRINT #1, ":MEAS? TIME,WP1,PWP1,MWP1"
180 LINE INPUT #1, A$
190 PRINT A$
200 PRINT #1, ":INTEG?"
210 LINE INPUT #1, A$
220 IF INSTR(A$, ":INTEGRATE 0") <> 0 THEN GOTO 250
230 PRINT #1, "*CLS"
240 GOTO 140
250 PRINT #1, ":INTEG:RESET"
260 CLOSE #1
270 END
要把它改成delphi的,我用了mscomm控件,用mscomm1.output把输出字符串一步步输出,但显示好象是通讯联上了但就是没反应,大概是数据输出到仪器时好象有错误,不知这段程序该如何改呢?先谢谢各位大虾指点,一旦解决,分数绝不吝惜。
另:20 OPEN "COM1:9600,N,8,1,LF" FOR RANDOM AS #1
中打开串口,LF是什么意思啊??