Reading Query Results Into String Variables; Reading Query Results Into Numeric Variables; Reading Definite-Length Block Query Response Data; Reading Definite- Length Block Query Response Data - Agilent Technologies InfiniiVision 2000 X-Series Programmer's Manual

Oscilloscopes
Hide thumbs Also See for InfiniiVision 2000 X-Series:
Table of Contents

Advertisement

3
Getting Started

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 for the
formats and types of data returned from queries.
Express String Variables Using Exact Syntax
N O T E
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
varQueryResult = myScope.ReadNumber
MsgBox "Range (variant):" + CStr(varQueryResult)
After running this program, the controller displays:
Range (variant): 40

Reading Definite-Length Block Query Response Data

Definite- length block query response data allows any type of
device- dependent data to be transmitted over the system interface as a
series of 8- bit binary data bytes. This is particularly useful for sending
large quantities of data or 8- bit extended ASCII codes. The syntax is a
pound sign (#) followed by a non- zero digit representing the number of
digits in the decimal integer. After the non- zero digit is the decimal
integer that states the number of 8- bit data bytes being sent. This is
followed by the actual data.
For example, for transmitting 1000 bytes of data, the syntax would be:
58
Agilent InfiniiVision 2000 X-Series Oscilloscopes Programmer's Guide

Advertisement

Table of Contents
loading

Table of Contents