Code: Select all
Dim as string resp 'resp = response
Dim volt as Single
dim J as integer
shell "stty -F /dev/ttyUSB0 speed 9600 -clocal -hupcl" 'code frm FB Hdware Forum
sleep 1000 ' "
open com "/dev/ttyUSB0:9600,e,7,2,rs,cd,ds,lf,pe" as #1 ' "
Print #1, ":SYST:REM" 'initialize HP meter
Print #1,":CONF:VOLT:DC 10,.001;:SAMP:COUN 1" 'initialize HP meter
sleep 500 'delay is essential this ln
do
Print #1, ":READ?"
Input #1,resp
locate 5+j,20
print "*" & resp & "*"
volt = Val(resp)
locate 5+j,1
print using "##.####";volt
j+= 1
print j
loop until inkey<>"" or volt<.7
end
The display from running the code looks like the following. Note there are only two passes, though the code dictates looping until one of two events occur. Also note that 9600 is displayed. This is not desired.
Code: Select all
9600
3.3467 *+3.34670000E+00*
0.0000 **
2
------------------
(program exited with code: 0)
Press return to continue
So, please, what are suggestions for code changes so that it behaves?