EasyManuals Logo

Rigol DSA832E Programming Guide

Rigol DSA832E
243 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
Page #228 background imageLoading...
Page #228 background image
RIGOL Chapter 3 Programming Demos
3-14 DSA800E Programming Guide
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 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)

Table of Contents

Other manuals for Rigol DSA832E

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Rigol DSA832E and is the answer not in the manual?

Rigol DSA832E Specifications

General IconGeneral
BrandRigol
ModelDSA832E
CategoryMeasuring Instruments
LanguageEnglish

Related product manuals