135
of 148
‘The next command is a 488.2 command. It receives the
‘device address and the timeout as parameters.
'The device handle (id2329) returned.
CALL IBDEV (0, adr, 0, T10s, 1, 0, id2329%)
IF (id2329% < 0) THEN
'In the event of an error, invoke the error routine
CALL gpiberr ("ibdev Error)
SYSTEM
END IF
‘The following commands are used to set the masks for the required
'SRQ function for the different registers
‘Enable BIT8 = EOC as a mask in the Status-Operation-Enable-Register
befehl$ = "stat:oper:enab " + STR$(EOC)
IF (CmdSenden(id2329%, befehl$) = 0) THEN
SYSTEM
END IF
‘Enable temperature and resistance errors
‘In the Status-Questionable-Enable-Register, enable BIT4 (= error) for
‘temperature measurement and BIT9 (= error) for resistance measurement
befehl$ = "stat:ques:enab " + STR$(TEMPError OR FRESError)
IF (CmdSenden(id2329%, befehl$) = 0) THEN
SYSTEM
END IF
‘In the Service-Request-Enable-Register, enable BIT3 (= Questionable-Register
‘input) and BIT7 (= Operation-Register input) for an SRQ
befehl$ = "*sre " + STR$(SRQOperReg OR SRQQuestReg)
IF (CmdSenden(id2329%, befehl$) = 0) THEN
SYSTEM
END IF
befehl$ = "abort"
‘Stop the device if a measurement is in progress
IF (CmdSenden(id2329%, befehl$) = 0) THEN
SYSTEM
END IF
befehl$ = "init:cont 0"
'Switch the device to single measurement
IF (CmdSenden(id2329%, befehl$) = 0) THEN
SYSTEM
END IF
i = 0
‘Reset the counter
DO WHILE (INKEY$ = " ") ‘Request the measurement values until the space bar is pressed
befehl$ = "in"
‘Start a measurement
IF (CmdSenden(id2329%, befehl$) = 0) THEN ‘Send command
SYSTEM
END IF
‘In the next loop, the device waits until an SRQ is present
‘After that, the measurement value is fetched
done% = 0
DO WHILE (done% <> 1)
done% = AbfrageSRQ(id2329%) ‘Scan the SRQ register
IF (done% = -1) THEN‘im
‘Abort in the event of an error
SYSTEM
END IF