User`s manual

Agilent E1330B Digital I/O Module Register Information 137
Appendix B
10 !re-save "DIG_NDL".
20 !Program to demonstrate the non-data lines—FLAG/CONTROL,RES/STS, PIR.
30 !This main line code is reserved as a error handling shell.
40 !All application code must be at lower level context.
50 ASSIGN @Sys TO 70900
!Define I/O paths.
60 ASSIGN @Dvm TO 70903
70 ASSIGN @Dig TO 70910
80 COM @Sys,@Dvm,@Dig
90 ON TIMEOUT 7,3 GOTO End
!Turn TIMEOUTS to errors—this
branch never taken.
100 ON ERROR RECOVER Kaboom
!This handles timeouts and errors not
handled.
110 !at lower level contexts.
120 Main
!Put application code in this sub.
121 PRINT “”
130 E13xx_errors
140 GOTO End
150 Kaboom:PRINT “”
160 PRINT ERRM$
170 PRINT “HERE IS THE E13XX ERROR STATUS”
180 El3xx_errors
190 End:END
200 !
210 SUB E13xx_errors
!This sub reads all errors from E13xx
instruments.
220 COM @Sys,@Dvm,@Dig
230 DIM A$[128]
240 ABORT 7
250 CLEAR @DVM
260 REPEAT
270 OUTPUT @Dvm;"SYST:ERR?"
280 ENTER @Dvm;A,A$
290 PRINT “DVM ERROR ”;A$
300 UNTIL A=0
310 !
320 CLEAR @Sys
330 REPEAT
340 OUTPUT @Sys;"SYST:ERR?"
350 ENTER @Sys;A,A$
360 PRINT “SYSTEM ERROR ”;A$
370 UNTIL A=0
380 !
390 CLEAR @Dig
400 REPEAT
410 OUTPUT @Dig;"SYST:ERR?"
420 ENTER @Dig;A,A$
430 PRINT “DIG I/O ERROR ”;A$
440 UNTIL A=0
450 SUBEND
460 !
470 SUB Main
!This subroutine is treated as the main line.
480 COM @Sys,@Dvm,@Dig
490 Cnt_flg_io
!Demonstrate driving CONTROL0,
receiving FLAG0.
500 Res_sts_io
!Demonstrate driving RES0, receiving STS0.
510 Res_pir_io
!Demonstrate driving RES0, receiving PIR0.
520 Res_pi_io
!Demonstrate driving RES0, receiving PI0.
530 !Put Application code here.