Remote Control
R&S
®
ESRP
973
User Manual 1175.7445.02 ─ 08
End Try
End Sub
11.17.1.8
Evaluation of Event Status Register
REM ------ Subroutine for evaluating the Event Status Register ------------
Public SUB Esrread()
Esr$ = SPACE$(20) 'Preallocate blanks to text
'variable
CALL InstrWrite (analyzer, "*ESR?") 'Read ESR
CALL InstrRead(analyzer, Esr$)
IF (VAL(Esr$) AND 1) > 0 THEN Debug.Print "Operation complete"
IF (VAL(Esr$) AND 2) > 0 THEN Debug.Print "Request Control"
IF (VAL(Esr$) AND 4) > 0
THEN Debug.Print "Query Error"
IF (VAL(Esr$) AND 8) > 0
THEN Debug.Print "Device dependent error"
IF (VAL(Esr$) AND 16) > 0
THEN Debug.Print "Execution Error; Program aborted"'Output error message
STOP 'Stop software
END IF
IF (VAL(Esr$) AND 32) > 0
THEN Debug.Print "Command Error; Program aborted"'Output error message
STOP 'Stop software
END IF
IF (VAL(Esr$) AND 64) > 0 THEN Debug.Print "User request"
IF (VAL(Esr$) AND 128) > 0 THEN Debug.Print "Power on"END SUB
REM **********************************************************************
REM ------ Subroutine for evaluating the Event Status Register ------------
Public Sub Esrread()
Try
Dim myESR As Short = mbSession.Query("*ESR?") 'Read ESR
If (myESR And 1) > 0 Then Console.WriteLine("Operation complete")
If (myESR And 2) > 0 Then Console.WriteLine("Request Control")
If (myESR And 4) > 0 Then Console.WriteLine("Query Error")
If (myESR And 8) > 0 Then Console.WriteLine("Device dependent error")
If (myESR And 16) > 0 Then
Console.WriteLine("Execution Error; Program aborted") 'Output error message
Stop 'Stop software
End If
If (myESR And 32) > 0 Then
Console.WriteLine("Command Error; Program aborted") 'Output error message
Stop 'Stop software
End If
If (myESR And 64) > 0 Then Console.WriteLine("User request")
If (myESR And 128) > 0 Then Console.WriteLine("Power on")
Catch exp As Exception
Console.WriteLine(exp.Message)
Remote Control – Programming Examples