Getting Started 2
Agilent 6000 Series Oscilloscopes Programmer’s Quick Start Guide 25
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.
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
NOTE
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.