
’ Page 3.46
’****************** Response subroutine *********************
’This subroutine reads bytes from the RS232 buffer as long
’as they enter. When no bytes enter for 1 second, the program
’assumes that the ScopeMeter has terminated its response. All
’bytes that enter the buffer are appended to the string Resp$
’and are written to the following files:
’File Waveform : the waveform data bytes
’File Waveresp : the waveform ASCII values
’
Response:
start! = TIMER
’Wait for bytes (maximum 1 s) to enter RS232 buffer
WHILE ((TIMER < (start! + 1)) AND (LOC(1) = 0))
WEND
IF LOC(1) > 0 THEN ’If RS232 buffer contains bytes
OPEN "WaveForm" FOR OUTPUT AS #2
’File to contain the waveform data bytes
docount = 1
total.count& = 0
DO
’ LOC(1) gives the number of bytes waiting:
total.count& = total.count& + LOC(1)
ScopeInput$ = INPUT$(LOC(1), #1) ’Input bytes
PRINT #2, ScopeInput$;
PRINT total.count&;
Resp$ = Resp$ + ScopeInput$
start! = TIMER
WHILE ((TIMER < (start! + 1)) AND (LOC(1) = 0))
WEND
docount = d 1
LOOP WHILE LOC(1) > 0 ’Repeat as long as bytes enter
CLOSE #2
PRINT
END IF
’
’***** Write the total Response string to file WaveResp
’
OPEN "WaveResp" FOR OUTPUT AS #3
PRINT "Response data length = "; LEN(Resp$)
PRINT #3, "Response data length = "; LEN(Resp$)
FOR i = 1 TO LEN(Resp$)
PRINT #3, ASC(MID$(Resp$, i, 1));
NEXT i
CLOSE #3: RETURN
’
Summary of Contents for ScopeMeter 190 Series
Page 40: ...Page 3 29 Response Syntax acknowledge cr See an example for this command under QUERY PRINT QP...
Page 42: ...to the ScopeMeter...
Page 64: ......
Page 68: ...Resp Count Resp Count 2 PRINT x_divisions X Divisions...
Page 70: ...PRINT x_step X Step...
Page 72: ...nb nb ASC MID Resp Resp Count 1 1 ELSE...
Page 74: ......
Page 76: ...PRINT SumCheck so far MOD 256 SumCheck1 MOD 256 CLOSE END...
Page 78: ...END IF...
Page 80: ...END IF NEXT j...
Page 83: ...Resp Count Resp Count Sample Bytes...