E5071C
Reading Data in ASCII Format
Overview
•
Sample Program in Excel VBA
•
Sample Program in HT Basic
•
Other topics about Sample Programs
Overview
This sample program demonstrates how to retrieve formatted data arrays
in the ASCII transfer format.
This program holds the sweep on channel 1, then retrieves and displays
the stimulus array for channel 1 and the formatted data array for trace 1.
See Retrieving Measurement Results for this programming.
Sample Program in Excel VBA
Sub read_asc_Click()
'
Dim defrm As Long
Dim vi As Long
Dim Result As String * 10000
Dim Res As Variant
Dim Res2 As Variant
Dim Nop As Long
Const TimeOutTime = 10000
'
' Open the Analyzer
Call viOpenDefaultRM(defrm)
Call viOpen(defrm, "GPIB0::17::INSTR", 0, 0, vi)
Call viSetAttribute(vi, VI_ATTR_TMO_VALUE, TimeOutTime)
'
' Select Parameter 1
Call viVPrintf(vi, ":CALC1:PAR1:SEL" + vbLf, 0)
Call viVPrintf(vi, ":INIT1:CONT OFF" + vbLf, 0)
Call viVPrintf(vi, ":ABOR" + vbLf, 0)
'
' Read out NOP Data in ASCII transfer format
Call viVPrintf(vi, ":SENS1:SWE:POIN?" + vbLf, 0)
Call viVScanf(vi, "%t", Result)
Nop = Val(Result)
1224