IOOUTPUTS(ADDR, qry_cmd, strlen(qry_cmd));

IOENTERS(ADDR, qry_resp, &length);

printf("\n%s = %s", qry_cmd, qry_resp);

}

Checking for Errors The following HP BASIC program shows the lines and subprogram which can be added to HP BASIC programs to check for errors. Line 140 clears the digitizer standard event status register. Lines 150 and 160 unmask the appropriate bits in the digitizer’s status byte register and standard event status register.

When an error occurs, the subprogram "Errmsg" reads the digitizer error queue and displays the code and message. Note that line 310 is used as an "end of statement" should a syntax error occur among coupled commands. Otherwise, line 320 would serve as the end of statement and the ABORT command would be ignored by the digitizer parser.

Note An alternative HP BASIC error checking program can be found in the "C-Size VXIbus Systems Installation and Getting Started Guide".

HP BASIC

1!This program represents one method that can be used to

2!check for programming errors in HP BASIC programs.

3!

10!Assign I/O path between the computer and HP E1429A/B.

20ASSIGN @A_d TO 70905

30COM @A_d

40!Define branch to be taken when an HP E1429A/B error occurs.

50!Enable HP-IB interface to generate an interrupt when an error

60!occurs.

70ON INTR 7 CALL Errmsg

80ENABLE INTR 7;2

90!Clear all bits in the standard event status register, unmask the

100!standard event status group summary bit in the HP E1429A/B status byte

110!register (decimal weight 32), unmask the query error, device

120!dependent error, execution error, and command error bits

130!(decimal sum 60) in the HP E1429A/B standard event status register.

Continued on Next Page

Chapter 1

Getting Started 45

Page 45
Image 45
HP E1429A manual Enable Intr