1. :FETCh[:SCALar]?
Fetch one result
Query syntax
:FETCh[:SCALar]? [<series name>]
where <series names>
in measurement function dependent series
Query response format
The format of the returned data is determined by the format commands :FORMAT:TINF
and :FORMAT:DATA
. See description below.
Description
The fetch query retrieves one measurement result for the given series name without making new measurements. Fetch does not work unless a measurement has been made by the :INITiate command. Series name argument is optional. If ommited, the command will default to first series for current measurement. If the counter has made an array of measurements, the query fetches the first measuring results first. The second query fetches the second result and so on. When the last measuring result has been fetched, the query returns empty string.
Measuring result can be fetched as long as the result is valid, i.e. until the following occurs:
– *RST is received.
– an :INITiate command is executed
– any reconfiguration is done.
The format of the returned data is determined by the format commands :FORMAT:TINF
and :FORMAT:DATA
:
:FORMAT:DATA ASCii | :FORMAT:DATA REAL | :FORMAT:DATA PACKED | |
:FORMAT:TINF OFF | <Val>,<Val>,<Val>… | #18<Val>, #18<Val>, #18<Val>… | #280<Val><Val><Val>… |
:FORMAT:TINF ON | <Val>,<TS>,<Val>,<TS>,<Val>,<TS> | #18<Val>, #18<TS>, #18<Val>, #18<TS>, #18<Val>, #18<TS>… | #6000160<Val><TS><Val><TS><Val><TS>…. |
Val = measurement value (double-precision floating-point format according to IEEE-754 in REAL and PACKed)
TS = timestamp value (double-precision floating-point format according to IEEE-754 in REAL, and 64-bit integer representing the number of picoseconds in PACKed)
#18 and #3160 – are binary data headers. First digit after “#” represent the number of subsequent digits. Those digits specify the size of a binary data (in bytes) that follow the header. For example, in REAL format in the header #18
“1” indicates that there is one more digit to read after “#”. “8” indicates that there will be 8 bytes of binary samples. In PACKED format the header #6000160
shows that there are 6 more digits after ‘#’. 000160 indicates that there will be 160 bytes of binary data.
In some situations, the instrument may not be able to provide valid results because of a measured value exceeds expected range (for example signal has too big amplitude or frequency is too high). In such situations the samples returned by :FETCh[:SCALar] and :FETCh:ARRay will have special ‘infinity’ value. In ASCII format it will be inf
string, and for REAL and PACKED formats it will be bit pattern corresponding to infinity according to IEEE 754.
2. :FETCh :ARRay
Fetch an array of results
Query syntax
:FETCh:ARRay <fetch array size>, [<series name>]
where <fetch array size>
is either an integer number or MAX keyword and <series name>
is series name.
Query response format
The format of the returned data is determined by the format commands :FORMat and :FORMat:FIXed. See :FETCh[:SCALar] for formats description.
Description
:FETCh:ARRay? query differs from the :FETCh? query by fetching several measuring results at once.
<fetch array size>
must be positive integer value or MAX
keyword. Data samples in response are present in the order they were created by the measurement core of the instrument (sorted by time, earliest sample is first). Maximum allowed array size for a single fetch is 1000000. Samples are fetched in FIFO-manner. For example, when the instrument has made a measurement and an array of measurements is available for input ‘A’ then :FETCh:ARRay? 10, A
fetches the first 10 measuring results from the output queue. The second :FETCh:ARRay? 10, A
fetches results 11 to 20, and so on. When the last measuring result has been fetched, :FETCh:ARRay? 10, A
returns empty string.
3. :FORMat[:DATA]
Specifies format of the data samples that are returned in response to FETCH:SCALAR? and FETCH:ARRAY? queries.
Command syntax
:FORMat[:DATA] <format>
where <format>
is one of ASCii
, REAL
or PACKed
Query syntax
:FORMat[:DATA]?
Query response
ASCII
, REAL
or PACKED
Default value: ASCII
Description
ASCii
: Returned data samples are represented as floating point numbers in text, separated by comma (for FETCH:ARRAY? query).
REAL
: Returned data samples are represented as binary data with “#18” header. Each sample or timestamp consists of 8 bytes.
PACKed
: See REAL.
For more details, see :FETCh[:SCALar] query description.
4. :FORMat:TINFormation
Specifies whether timestamps are included in data samples that are returned in response to FETCH:SCALAR? and FETCH:ARRAY? queries.
Command syntax
:FORMat:TINFormation <boolean>
where <boolean>
is one of 1
, 0
, ON
, OFF
1 or ON enable timestamping
0 or OFF disable timestamping
Default value: OFF
Description
This command turns on/off the time stamping of measurements. The setting of this command will affect the output format of FETCh queries.
For more details, see :FETCh[:SCALar] query description.