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

Page 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

Image 25
Contents Programmer’s Quick Start Guide WA R N I N G Programming the Oscilloscope-At a Glance This Book Contents Index Setting Up Connect and set up the oscilloscope Install Agilent IO Libraries Suite softwareUsing the LAN Interface Using the USB Device InterfaceUsing the Gpib Interface Verify the oscilloscope connection Click Test Connection Setting Up To access the Programmer’s Reference help file Access the Programmer’s ReferenceTo get the latest versions via the web Language for Program Examples Getting StartedInitializing Basic Oscilloscope Program StructureAnalyzing Captured Data Capturing DataReferencing the IO Library Programming the OscilloscopeOpening the Oscilloscope Connection via the IO Library Initializing the Interface and the Oscilloscope Using AUToscale to Automate Oscilloscope SetupInformation for Initializing the Instrument Example Oscilloscope Setup Code Using Other Oscilloscope Setup Commands Set TIMebaseMODE to Main or DELayed when using DIGitize Capturing Data with the DIGitize Command Ensure New Data is Collected Aborting a Digitize Operation Over Gpib Following program example shows a typical setupReading Query Responses from the Oscilloscope Reading Query Results into String Variables Express String Variables Using Exact SyntaxReading Query Results into Numeric Variables #8000010001000 bytes of dataterminator Reading Definite-Length Block Query Response DataChecking Instrument Status Sending Multiple Queries and Reading ResultsSending Scpi Commands using Browser Web Control Other Ways of Sending CommandsTelnet Sockets Index Index Page Index
Related manuals
Manual 368 pages 7.71 Kb