Agilent Technologies 6000 Series quick start Reading Query Results into String Variables

Models: 6000 Series

1 32
Download 32 pages 42.31 Kb
Page 25
Image 25

Getting Started

2

Reading Query Results into String Variables

The output of the instrument may be numeric or character data depending on what is queried. Refer to the specific command descriptions in the online Programmer’s Reference for the formats and types of data returned from queries.

N O T E

Express String Variables Using Exact Syntax

 

 

In Visual Basic, string variables are case sensitive and must be expressed exactly the same

 

each time they are used.

 

 

 

The following example shows numeric data being returned to a string variable:

 

myScope.WriteString ":CHANNEL1:RANGE?"

 

Dim strQueryResult As String

 

strQueryResult = myScope.ReadString

 

MsgBox "Range (string):" + strQueryResult

 

After running this program, the controller displays:

 

Range (string): +40.0E+00

Reading Query Results into Numeric Variables

The following example shows numeric data being returned to a numeric variable:

myScope.WriteString ":CHANNEL1:RANGE?" Dim varQueryResult As Variant strQueryResult = myScope.ReadNumber

MsgBox "Range (variant):" + CStr(varQueryResult)

After running this program, the controller displays:

Range (variant): 40

Agilent 6000 Series Oscilloscopes Programmer’s Quick Start Guide

25

Page 25
Image 25
Agilent Technologies 6000 Series Reading Query Results into String Variables, Reading Query Results into Numeric Variables