
Page 3.39
Example for QP 0,0 (or QP or QP 0,1 or QP 0,2 or QP 0,3):
The following program reads the ScopeMeter screen (print)
data and copies this data to the file Qpfile. This file can be
copied to the printer port LPT1, for example.
The Read Buffer length for the PC is set to 7500 bytes to
prevent buffer overflow during input from the ScopeMeter.
The communication speed (baud rate) is set to 19200 and after
the data transfer it is reset to 1200 (default baud rate).
’***************** Begin example program *****************
CLS
OPEN "COM1:1200,N,8,1,CS,DS,RB7500" FOR RANDOM AS #1
’Programs COM1 port parameters to
’match with the ScopeMeter power-on
’defaults.
PRINT #1, "PC 19200" ’Programs ScopeMeter to the maximum
’baud rate.
GOSUB Acknowledge ’Input acknowledge from ScopeMeter.
CLOSE #1
OPEN "COM1:19200,N,8,1,CS,DS,RB7500" FOR RANDOM AS #1
’Programs COM1 port parameters to
’match with the new ScopeMeter
’settings.
PRINT #1, "QP 0,0" ’Sends QUERY PRINT data command.
’(actual screen for EPSON print)
GOSUB Acknowledge ’Input acknowledge from ScopeMeter.
PRINT
PRINT "Busy reading print data !"
PRINT
GOSUB Response
PRINT #1, "PC 1200" ’Programs ScopeMeter back to the
’default baud rate.
GOSUB Acknowledge ’Input acknowledge from ScopeMeter.
PRINT "Print data copied to file ’QPFILE’."
PRINT "You can copy the file contents to the EPSON Printer."
PRINT "DOS-example: COPY Qpfile LPT1"
CLOSE ’Close all files.
END
’**************** Acknowledge subroutine ******************
’Use this subroutine after each command or query sent to the
’ScopeMeter. This routine inputs the acknowledge
’response from the ScopeMeter. If the response is non-zero,
’the previous command was not correct or was not correctly
’received by the ScopeMeter. Then an error message is
’displayed and the program is aborted.
Acknowledge:
INPUT #1, ACK ’Reads acknowledge from ScopeMeter.
IF ACK <> 0 THEN
PRINT "Error "; ACK; ": ";
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...