Getting Started 2
Agilent 6000 Series Oscilloscopes Programmer’s Quick Start Guide 27
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
strResults() = myScope.ReadList(ASCIIType_BSTR)
MsgBox "Timebase range: " + strResults(0) + ", delay: " + strResults(1)
To read the :TIMebase:RANGe?;DELay? query result into multiple numeric
variables, you could use the ReadList method to read the query results into a
variant array variable using the commands:
myScope.WriteString ":TIMEBASE:RANGE?;DELAY?"
Dim varResults() As Variant
varResults() = myScope.ReadList
MsgBox "Timebase range: " + FormatNumber(varResults(0) * 1000, 4) + _
" ms, delay: " + FormatNumber(varResults(1) * 1000000, 4) + " us"
Checking Instrument Status
Status registers track the current status of the instrument. By checking the
instrument status, you can find out whether an operation has been completed,
whether the instrument is receiving triggers, and more.
For more information, see the “Status Reporting” topic in the online
Programmer’s Reference which explains how to check the status of the
instrument.