DSA800 series programming guide - Page 238

For DSA815.

Loading ...
Loading ...
Loading ...
RIGOL Chapter 3 Programming Demos
3-16 DSA800 Programming Guide
strRet = InstrRead(rsrcName(i))
' Continue to switch the resource until find a DSA instrument
strRet = UCase(strRet)
j = InStr(strRet, "DSA")
If (j >= 0) Then
bFindDSA = True
Exit For
End If
Call viFindNext(fList + i - 1, rsrcName(i))
Next i
'Dispaly
If (bFindDSA = True) Then
TxtInsAddr.Text = rsrcName(i)
Else
TxtInsAddr.Text = ""
End If
End Sub
2) Write Operation
'Write the command to the instrument
Private Sub CmdWrite_Click()
If (TxtInsAddr.Text = "") Then
MsgBox ("Please write the instrument address!")
End If
InstrWrite TxtInsAddr.Text, TxtCommand.Text
End Sub
3) Read Operation
'Read the return value from the instrument
Private Sub CmdRead_Click()
Dim strTemp As String
strTemp = InstrRead(TxtInsAddr.Text)
TxtReturn.Text = strTemp
End Sub
6. Execution Result
1) Click "Connect" to search for the spectrum analyzer;
2) Input "*IDN?" in the "Command" edit box;
3) Click "Write" to write the command into the spectrum analyzer;
4) Click "Read" to read the return value.
The execution result is as shown in the figure below.
Loading ...
Loading ...
Loading ...