
R&S FSH-K1
Programming Examples
1157.3564.12 73
E-8
Send SET Command to R&S FSH
Public Function FSHSet(ByVal Command As String) As Boolean
Dim TempError As Integer
InBuffer = vbNullString
FSHSet = False
With MainForm.FSHCommC
.Output = "set" + vbCr
TempError = Val(PollFSH)
If TempError = 0 Then
.Output = C vbCr
TempError = Val(PollFSH)
If TempError = 0 Then
FSHSet = True
Else
ErrorMsg "SET error" + Str(TempError) + " for command <" + C ">"
End If
Else
ErrorMsg "SET error" + Str(TempError) + " for command <" + C ">"
End If
End With
End Function
‘-------------------------------------------
Send GET Command to R&S FSH and Read Response
Public Function FSHGet(ByVal Command As String, ByRef Buffer As String) As Boolean
Dim TempError As Integer
InBuffer = vbNullString
FSHGet = False
With MainForm.FSHCommC
.Output = "get" + vbCr
TempError = Val(PollFSH)
If TempError = 0 Then
.Output = C vbCr
TempError = Val(PollFSH)
If TempError = 0 Then
Sleep 50
Buffer = PollFSH
FSHGet = True
Else
ErrorMsg "GET error" + Str(TempError) + " for command <" + C ">"
End If
Else
ErrorMsg "GET error" + Str(TempError) + " for command <" + C ">"
End If
End With
End Function
‘-------------------------------------------
Example: Program Instrument Setup
Private Sub FSHSetup ()
Dim Buffer As String
FSHCmd "REMOTE"
‘ Set FSH to Remote State
FSHGet "IDN?", Buffer
‘ Query instrument ID
FSHCmd "PRESET"
‘ Preset FSH settings
FSHSet "FREQ,950E6"
‘ Set Center Frequency to 950 MHz
FSHSet "SPAN,5E6"
‘ Set Span to 5 MHz
FSHCmd "LOCAL"
‘ Return to Local Mode
End Sub
‘-------------------------------------------
Содержание 1157.3458.02
Страница 4: ......
Страница 5: ...R S FSH K1 Table of Contents 1157 3564 12 I 1 E 8...
Страница 6: ......