Trace Measurement With Synchronization To Measurement Complete - R&S NRPxxS Series User Manual

Three-path power sensors
Table of Contents

Advertisement

®
R&S
NRPxxS(N)
//Query the
FETCh?
10.5 Trace Measurement with Synchronization to Measure-
ment Complete
This example, written in pseudo code, shows how to setup and execute a trace mea-
surement using a non-blocking technique.
The advantage of using the FETCH? command (as shown in the previous example) is,
that FETCH? will wait (block) until a measurement result is available. However this may
lead to situations where an application blocks for a longer time (until timeout) if, for
example, a trigger is missing and thus no results will ever become available.
For certain applications, especially interactive ones, it is not the desired behavior that
the user has to wait until a (probably long) timeout occurs. In these cases it is preferred
to start a measurement and then enter a loop to poll the sensor until the measurement
is ready and the results can safely be retrieved. For such applications it is recommen-
ded to use the status system of the sensor to find out whether the measurement is
ready. The advantage of this approach is that the polling loop can be exited/canceled
at any time and the application stays operable (i. e. does not block).
// basic setup, similar to the previous example
write( "*RST" );
write( "SENS:FUNC \"XTIM:POW\"" );
write( "SENS:FREQ
write( "SENS:TRAC:POIN 500" );
write( "SENS:TRAC:TIME
write( "TRIG:SOUR INT" );
write( "TRIG:SLOP POS" );
write( "TRIG:DTIM 0.001" );
write( "TRIG:HYST
write( "TRIG:LEV
write( "SENS:TRAC:AVER:COUN
write( "SENS:TRAC:AVER:STAT
// configuring the event system to recognize the
// end of measurement (i.e. a negative transition
// of bit 1 in the meas operation register)
write( "STAT:OPER:MEAS:NTR
write( "STAT:OPER:MEAS:PTR
// resetting the event information by an initial readout
int iEvent = 0;
query( "STAT:OPER:MEAS:EVEN?", &iEvent );
// Now starting the measurement
write( "INIT:IMM" );
User Manual 1177.5079.02 ─ 10
Performing Measurement Tasks - Programming Examples

Trace Measurement with Synchronization to Measurement Complete

measurement results
1.8e9" );
20e-3" );
0.1" );
30e-6" );
8" );
ON" );
2" );
0" );
149

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents