EasyManua.ls Logo

Rigol DG4000 Series

Rigol DG4000 Series
646 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
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
status = viClose(sesn)
status = viClose(dfltRM)
End Sub
2) Encapsulate the read operation of VISA for easier operation.
'-----------------------------------------------------------
'Function NameInstrRead
'Function Read the return value from the instrument
'Input rsrcName,Resource name
'ReturnThe 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

Table of Contents

Other manuals for Rigol DG4000 Series

Related product manuals