EasyManua.ls Logo

Rigol DG822 - Page 194

Rigol DG822
209 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...
RIGOL Chapter 4 Programming Examples
4-16 DG800 Programming Guide
5. Double-click CH1 to enter the programming environment. Add the following codes to control CH1 and
CH2. The codes of CH1 are as shown below; the codes of CH2 are similar.
Dim defrm As Long
Dim vi As Long
Dim strRes As String * 200
Dim list As Long
Dim nmatches As Long
Dim matches As String * 200
' Obtain the usb resource of visa
Call viOpenDefaultRM(defrm)
Call viFindRsrc(defrm, "USB?*", list, nmatches, matches)
' Turn on the instrument
Call viOpen(defrm, matches, 0, 0, vi)
' Send a command to query the status of CH1
Call viVPrintf(vi, ":OUTP1?" + Chr$(10), 0)
' Acquire the status of CH1
Call viVScanf(vi, "%t", strRes)
If strRes = "ON" Then
' Send the setting command
Call viVPrintf(vi, ":OUTP1 OFF" + Chr$(10), 0)
Label1(0).ForeColor = &H808080 'Gray
Else
Call viVPrintf(vi, ":OUTP1 ON" + Chr$(10), 0)
Label1(0).ForeColor = &HFFFF& 'Yellow
End If

Other manuals for Rigol DG822

Related product manuals