User Manual

Page 2.8
’Example of a typical program sequence:
’***************** Begin example program ****************
OPEN "COM1:1200,N,8,1,CS,DS,RB2048" FOR RANDOM AS #1
’This QBASIC program line sets the parameters for the
’RS232 port (COM1 on the Computer) to match the
’instrument power-on default settings. It also opens a
’communication channel (assigned #1) for input or output
’through the COM1 port. Your instrument must be connected
’to this port. "RB2048" sets the size of the computer
’receive buffer to 2048 bytes to prevent buffer overflow
’during communication with the instrument.
PRINT #1, "ID"
’Outputs the IDENTITY command (query) to the instrument.
GOSUB Acknowledge
’This subroutine inputs the acknowledge response from
’the instrument and displays an error message if the
’acknowledge value is non-zero.
INPUT #1, Response$
’This inputs the response data from the IDENTITY query.
PRINT Response$
’Displays the queried data.
CLOSE #1
’This closes the communication channel.
END
’This ends the program.