Chapter 9
133
Measurement Applications (Sample Programs)
Reading Measurement Results in ASCII Format Using :READ? Command
9.
M
easu
rem
ent
Applica
tio
ns
(S
amp
le
Prog
ra
ms)
Example 9-10
Reading Measurement Results in Ascii Format using :READ? Command
Sub Example10()
'===================================
' Configuration
'===================================
Dim defrm As Long 'Session to Default Resource Manager
Dim Agte4981a As Long 'Session to instrument
Dim Result As String * 500
Dim Res As Variant
Const TimeOutTime = 10000
On Error GoTo ErrorHandler
'===================================
' Open Instrument
'===================================
ErrorCheck viOpenDefaultRM(defrm)
Call SelectMode(defrm, Agte4981a)
ErrorCheck viSetAttribute(Agte4981a, VI_ATTR_TMO_VALUE,
TimeOutTime)
'===================================
' Setup Start
'===================================
ErrorCheck viVPrintf(Agte4981a, "SYST:PRES;*CLS" + vbLf, 0)
ErrorCheck viVPrintf(Agte4981a, "FORM ASC" + vbLf, 0)
ErrorCheck viVPrintf(Agte4981a, "INIT:CONT OFF" + vbLf, 0)
ErrorCheck viVPrintf(Agte4981a, "TRIG:SOUR EXT" + vbLf, 0)