User`s manual

Reading an Error
Code
This program generates an error and then reads the error code from the
Query Response Register.
HP BASIC/WS Version
10 !Map the A16 address space in the HP V/382 and store the multimeter base
20 !address in a variable.
30 CONTROL 16,25;2
40 COM Base_addr
50 Base_addr=DVAL("C600",16)
60 !
Call the subprogram which sets an invalid parameter, thus generating an error.
70 CALL Error_gen
80 END
90 !
This subprogram checks each bit in the multimeter Status register.
100 !The subprogram is called by subprograms Wait_not_bsy, Wait_done, and
110 !Qry_ready to determine when a command and parameter can be written to
120 !Command and Parameter registers, and when an error code is in the Query
130 !Response register.
140 SUB Read_status(Status,Rdy,Done,Indardy,Qryrdy,Noerr,Pass_fail)
150 COM Base_addr
160 Status=READIO(-16,Base_addr+4)
170 Rdy=BIT(Status,0)
180 Done=BIT(Status,7) AND Rdy
190 Indardy=BIT(Status,4) AND Done
200 Qryrdy=BIT(Status,1) AND Done
210 Noerr=NOT (NOT (BIT(Status,6)) AND Done)
220 Pass_fail=BIT(Status,2)
230 SUBEND
240 !
This subprogram calls Read_status to check status bit 0 to determine
250 !when a parameter can be sent.
260 SUB Wait_not_bsy
270 REPEAT
280 CALL Read_status(Status,Rdy,Done,Indardy,Qryrdy,Noerr,Pass_fail)
290 UNTIL Rdy
300 SUBEND
310 !
This subprogram calls Read_status to check status bit 7. This bit determines
320 !the validity of bits 6 and 1, and determines when a command is finished.
330 SUB Wait_done
340 REPEAT
350 CALL Read_status(Status,Rdy,Done,Indardy,Qryrdy,Noerr,Pass_fail)
360 UNTIL Done
370 SUBEND
Continued on Next Page
230 HP E1326B/E1411B Multimeter Register-Based Programming Appendix C