RIGOL
Chapter 3
Programming Examples
Programming Guide for DSA1000A series
3-12
4.
Encapsulate the read and write operations of VISA.
1)
Encapsulate the write to VISA.
'-----------------------------------------------------------
'Function Name
:
InstrWrite
'Function
:
Send command to the instrument
'Input
:
rsrcName,instrument(resource) name
strCmd,Command
'-----------------------------------------------------------
Public Sub InstrWrite(rsrcName As String, strCmd As String)
Dim status As Long
Dim dfltRM As Long
Dim sesn As Long
Dim rSize As Long
'Initialize the system
status = viOpenDefaultRM(dfltRM)
'Failed to initialize the system
If (status < VI_SUCCESS) Then
MsgBox "
No VISA resource was opened
!
"
Exit Sub
End If
„
Open the VISA instrument
status = viOpen(dfltRM, rsrcName, VI_NULL, VI_NULL, sesn)
'Failed to open the instrument
If (status < VI_SUCCESS) Then
MsgBox "Failed to open the instrument
!
"
Exit Sub
End If
'Write command to the instrument
status = viWrite(sesn, strCmd, Len(strCmd), rSize)
'Failed to write to the instrument
If (status < VI_SUCCESS) Then
MsgBox "
Faild to write to the instrument
!
"
Exit Sub
End If
'Close the system
Содержание DSA1000A Series
Страница 1: ...RIGOL Programming Guide DSA1000A Series Spectrum Analyzer May 2011 RIGOL Technologies Inc...
Страница 2: ......
Страница 14: ......
Страница 137: ...Chapter 3 Programming Examples RIGOL Programming Guide for DSA1000A series 3 3...
Страница 154: ...RIGOL Chapter 3 Programming Examples Programming Guide for DSA1000A series 3 20 6 Exit code...
Страница 155: ...Chapter 3 Programming Examples RIGOL Programming Guide for DSA1000A series 3 21 7 Execute results...
Страница 158: ...RIGOL Chapter 3 Programming Examples Programming Guide for DSA1000A series 3 24...