6.4. Read and fetch queries

The M81-SSM provides read and fetch queries for easy collection of measurement data. Upon receiving the read query the M81-SSM will wait the averaging time (number of NPLCs) before returning a measurement. Upon receiving the fetch query the M81-SSM will return with the most recent measurement. For general measurements, the read command is typically preferred over the fetch command.

For example, to read the RMS value from M1 waiting the averaging time:

READ:SENSe1:RMS?

To collect data at regular intervals over time, use data streaming instead.

Note

The basic READ? and FETCh? queries will not return while settling between range changes. Settle time depends on the averaging time. A measure module may go through multiple ranges before finding the optional range. Therefore it is important to configure your remote interface to avoid timeouts when using long averaging times. This is best accomplished by polling the settling status bit before querying a new measurement.

Read Multiple

To collect a snapshot of multiple values once all readings have settled and after waiting for the highest configured NPLC, READ[:MULTiple]? can be used. This command uses the data specifiers described in data streaming.

For example, to collect DC measurements from M1 and RMS measurements from M2:

READ:MULTiple? MDC,1,MRMS,2

By using read multiple instead of separate read commands, the data is synchronized in time.

Long running read measurements

When autorange is enabled, the read query accommodates range changes by resetting its averaging time on range change. This means that in some cases the time for a read command to complete cannot be determined a priori and communications can time out during a read command. For these cases, the read measurements can be started and the result queried after it is finished.

Use the READ:SENSe#:STARt command to start a read measurement. One read measurement can be started for each measurement channel available. Use the READ[:MULTiple]:STARt command to start a read multiple measurement. Paramenter pairs must be specified for the read multiple measurement. One read multiple measurement can be started. These measurements are all independent of each other.

To query if the measurement is running, use the READ:SENSe#:RUNNing? query for a single read measurement, or READ[:MULTiple]:RUNNing?

To abort a running measurement, use the READ:SENSe#:ABORt command for a single read measurement, or the READ[:MULTiple]:ABORt command for a read multiple measurement.

Once the measurement is completed, the results can be queried with the READ:SENSe#:RESult:DC? and similar queries for a single read measurement. All applicable measurement data can be queried without running a new measurement. For a multiple reading, use the READ[:MULTiple]:RESult? query. This query will return the data specified in the start command’s parameter pairs.

For example, to collect the RMS value from M1:

READ:SENSe1:STARt
READ:SENSe1:RUNNing?
READ:SENSe1:RESult:DC?

For example, to collect DC measurements from M1 and RMS measurements from M2:

READ:MULTiple:STARt MDC,1,MRMS,2
READ:MULTiple:RUNNing?
READ:MULTiple:RESult?

Fetch Multiple

To collect a snapshot of multiple values at once, FETCh[:MULTiple]? can be used. This command uses the data specifiers described in data streaming.

For example, to collect X and Y measurements from M1:

FETCh:MULTiple? MX,1,MY,1

By using fetch multiple instead of separate fetch commands, the data is synchronized in time.

Overload and Unlock

Readings that are presently not available because an overload will return 9.90E37 (SCPI value indicating Inf).

Readings that are presently not available because the PLL is unlocked will return 9.91E37 (SCPI value indicating NaN).

Settling

When a measurement is settling, the read command will wait until the reading has finished settling, and will subsequently wait the averaging time (NPLC). The fetch command will simply wait until the reading has finished settling to return a value.

Fetch Immediate

The Fetch Immediate Queries will always return a value regardless of settling. This can be used in cases where the query must always return a value as soon as possible. If the reading is settling the value returned will be 9.91E37 (SCPI value indicating NaN).