Chapter 3 Programming Examples
RIGOL
Programming Guide for DSA1000A series
3-15
'
Find instrument resource
Call viFindRsrc(dfltRM, "USB?*INSTR", fList, nList, rsrcName(0))
'
Get the list of the instrument(resource)
strRet = ""
bFindDSA = False
For i = 0 To nList - 1
'
Get the instrument name
InstrWrite rsrcName(i), "*IDN?"
Sleep 200
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
Summary of Contents for DSA1000A Series
Page 1: ...RIGOL Programming Guide DSA1000A Series Spectrum Analyzer May 2011 RIGOL Technologies Inc...
Page 2: ......
Page 14: ......
Page 137: ...Chapter 3 Programming Examples RIGOL Programming Guide for DSA1000A series 3 3...
Page 154: ...RIGOL Chapter 3 Programming Examples Programming Guide for DSA1000A series 3 20 6 Exit code...
Page 158: ...RIGOL Chapter 3 Programming Examples Programming Guide for DSA1000A series 3 24...