EasyManua.ls Logo

Rohde & Schwarz SML01 - Page 239

Rohde & Schwarz SML01
299 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
R&S®SML / R&S®SMV03 Programming Examples
1090.3123.12 E-6 7.5
Reading out the status event registers, the output buffer and the error/event queue is effected in
subr
outines.
REM -------- Subroutines for the individual STB bits ------
Outputqueue: 'Reading the output buffer
Message$ = SPACE$(100) 'Make space for response
CALL IBRD(generator%, Message$)
PRINT " Message in output buffer :"; Message$
RETURN
Failure: 'Read error queue
ERROR$ = SPACE$(100) 'Make space for error variable
CALL IBWRT(generator%, "SYSTEM:ERROR?")
CALL IBRD(generator%, ERROR$)
PRINT "Error text :"; ERROR$
RETURN
Esrread: 'Read Event status register
Esr$ = SPACE$(20) 'Preallocate blanks to text variable
CALL IBWRT(generator%, "*ESR?") 'Read ESR
CALL IBRD(generator%, Esr$)
IF (VAL(Esr$) AND 1) > 0 THEN PRINT "Operation complete"
IF (VAL(Esr$) AND 4) > 0 THEN GOTO Failure
IF (VAL(Esr$) AND 8) > 0 THEN PRINT "Device dependent error"
IF (VAL(Esr$) AND 16) > 0 THEN GOTO Failure
IF (VAL(Esr$) AND 32) > 0 THEN GOTO Failure
IF (VAL(Esr$) AND 64) > 0 THEN PRINT "User request"
IF (VAL(Esr$) AND 128) > 0 THEN PRINT "Power on"
RETURN
REM
**********************************************************************
REM ------------- Error routine ----------------
Error handling:
PRINT "ERROR" 'Output error message
STOP ' Stop software

Table of Contents

Related product manuals