
Remote Commands
R&S
®
FSW
1096
User Manual 1173.9411.02 ─ 19
11.15.2.5
Reading Out the Output Buffer
REM -------- Subroutine for the individual STB bits -----------------------
Public SUB Outputqueue() 'Reading the output buffer
result$ = SPACE$(100) 'Make space for response
CALL InstrRead(analyzer, result$)
Debug.Print "Contents of Output Queue:"; result$
END SUB
REM ***********************************************************************
REM -------- Subroutine for the output queue -----------------------
Public Sub Outputqueue() 'Reading the output buffer
Try
Dim result As String = mbSession.ReadString()
Console.WriteLine("Contents of Output Queue:" + result)
Catch exp As Exception
Console.WriteLine(exp.Message)
End Try
End Sub
11.15.2.6
Reading Error Messages
REM -------- Subroutine for reading the error queue -----------------------
Public SUB ErrorQueueHandler()
ERROR$ = SPACE$(100) 'Make space for error variable
CALL InstrWrite (analyzer, "SYSTEM:ERROR?")
CALL InstrRead(analyzer, ERROR$)
Debug.Print "Error Description:"; ERROR$
END SUB
REM ***********************************************************************
REM -------- Subroutine for reading the error queue -----------------------
Sub ErrorQueueHandler()
Dim result As String
Dim hasErr As Boolean = True
Do
mbSession.Write("SYST:ERR?")
result = mbSession.ReadString()
Dim parts As String() = result.Split(",")
If parts(0) = 0 Then
hasErr = False
Console.WriteLine(result)
Else
Console.WriteLine(result)
End If
Loop While hasErr
End Sub
Programming Examples