Sending Multiple Queries And Reading Results - Agilent Technologies InfiniiVision 5000 Series Programmer's Manual

Hide thumbs Also See for InfiniiVision 5000 Series:
Table of Contents

Advertisement

3
Getting Started
Figure 2
Definite-length block response data
The "8" states the number of digits that follow, and "00001000" states the
number of bytes to be transmitted.
The VISA COM library's ReadIEEEBlock and WriteIEEEBlock methods
understand the definite- length block syntax, so you can simply use
variables that contain the data:
' Read oscilloscope setup using ":SYSTem:SETup?" query.
myScope.WriteString ":SYSTem:SETup?"
Dim varQueryResult As Variant
varQueryResult = myScope.ReadIEEEBlock(BinaryType_UI1)
' Write learn string back to oscilloscope using ":SYSTem:SETup" command:
myScope.WriteIEEEBlock ":SYSTem:SETup ", varQueryResult

Sending Multiple Queries and Reading Results

You can send multiple queries to the instrument within a single command
string, but you must also read them back as a single query result. This can
be accomplished by reading them back into a single string variable,
multiple string variables, or multiple numeric variables.
For example, to read the :TIMebase:RANGe?;DELay? query result into a
single string variable, you could use the commands:
myScope.WriteString ":TIMebase:RANGe?;DELay?"
Dim strQueryResult As String
strQueryResult = myScope.ReadString
MsgBox "Timebase range; delay:" + strQueryResult
When you read the result of multiple queries into a single string variable,
each response is separated by a semicolon. For example, the output of the
previous example would be:
Timebase range; delay: <range_value>;<delay_value>
To read the :TIMebase:RANGe?;DELay? query result into multiple string
variables, you could use the ReadList method to read the query results
into a string array variable using the commands:
myScope.WriteString ":TIMebase:RANGe?;DELay?"
Dim strResults() As String
Agilent InfiniiVision 5000 Series Oscilloscopes Programmer's Guide
47

Advertisement

Table of Contents
loading

Table of Contents