Chapter 3 Programming Examples
RIGOL
Programming Guide for DSA1000A series
3-13
status = viClose(sesn)
status = viClose(dfltRM)
End Sub
2)
Encapsulate the read of VISA.
'-----------------------------------------------------------
'Function Name
:
InstrRead
'Function
:
Read the return value from the instrument
'Input
:
rsrcName,Resource name
'Return
:
The string gotten from the instrument
'-----------------------------------------------------------
Public Function InstrRead(rsrcName As String) As String
Dim status As Long
Dim dfltRM As Long
Dim sesn As Long
Dim strTemp0 As String * 256
Dim strTemp1 As String
Dim rSize As Long
'Begin by initializing the system
status = viOpenDefaultRM(dfltRM)
'Initial failed
If (status < VI_SUCCESS) Then
MsgBox "
Failed to open the instrument! "
Exit Function
End If
'Open the instrument
status = viOpen(dfltRM, rsrcName, VI_NULL, VI_NULL, sesn)
'Open instrument failed
If (status < VI_SUCCESS) Then
MsgBox "
Failed to open the instrument! "
Exit Function
End If
'
Read from the instrument
stasus = viRead(sesn, strTemp0, 256, rSize)
'
Read failed
Содержание 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...