Sample Basic Ieee-488 Interface Program - Lakeshore 330 User Manual

Autotuning temperature controller
Table of Contents

Advertisement

Lake Shore Model 330 Autotuning Temperature Controller User's Manual
'
IEEEEXAM.BAS
EXAMPLE PROGRAM FOR IEEE-488 INTERFACE
'
'
This program works with QuickBasic 4.0/4.5 on an IBM PC or compatible.
'
'
The example requires a properly configured National Instruments GPIB-PC2 card. The REM
'
$INCLUDE statement is necessary along with a correct path to the file QBDECL.BAS. CONFIG.SYS
'
must call GPIB.COM created by IBCONF.EXE prior to running Basic. There must be QBIB.QBL
'
library in the QuickBasic Directory and QuickBasic must start with a link to it. All
'
instrument settings are assumed to be defaults: Address 12, Terminators <CR> <LF> and EOI
'
active.
'
'
To use, type an instrument command or query at the prompt. The command transmits to the
'
instrument and the MPS receives and displays the response. If no query is sent, the
'
instrument responds to the last query received. Type "EXIT" to exit the program. NOTE: The
'
INPUT instruction accepts no commas as part of an input string. If a comma appears in an
'
instrument command, replace it with a space.
'
REM $INCLUDE: 'c:\gpib-pc\qbasic\qbdecl.bas'
CLS
PRINT "IEEE-488 COMMUNICATION PROGRAM"
PRINT
CALL IBFIND("dev12", DEV12%)
TERM$ = CHR$(13) + CHR$(10)
LOOP2: IN$ = SPACE$(2000)
INPUT "ENTER COMMAND (or EXIT):"; CMD$
CMD$ = UCASE$(CMD$)
IF CMD$ = "EXIT" THEN END
CMD$ = CMD$ + TERM$
CALL IBWRT(DEV12%, CMD$)
CALL IBRD(DEV12%, IN$)
ENDTEST = INSTR(IN$, CHR$(13))
IF ENDTEST > 0 THEN
IN$ = MID$(IN$, 1, ENDTEST - 1)
PRINT "RESPONSE:", IN$
ELSE
PRINT "NO RESPONSE"
END IF
GOTO LOOP2
Remote Operation
Table 4-1. Sample BASIC IEEE-488 Interface Program
'Link to IEEE calls
'Clear screen
'Open communication at address 12
'Terminators are <CR><LF>
'Clear for return string
'Get command from keyboard
'Change input to upper case
'Get out on Exit
'Send command to instrument
'Get data back each time
'Test for returned string
'String is present if <CR> is seen
'Strip off terminators
'Print return string
'No string present if timeout
'Get next command
4-5

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents