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

Hide thumbs Also See for NRP Series:
Table of Contents

Advertisement

®
R&S
NRPxxS(N)
10.5 Trace measurement with synchronization to measure-
ment complete
This example, written in pseudo code, shows how to set up 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? waits (blocks) until a measurement result is available. However, this
behavior can lead to situations where an application blocks for a longer time (until time-
out). For example, if a trigger is missing and thus no results are ever becoming availa-
ble.
For certain applications, especially interactive ones, it is not the desired behavior that
you have to wait until a (probably long) timeout occurs. In these cases, start a mea-
surement 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 recommended to use the
status system of the sensor to find out whether the measurement is ready. The advant-
age 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" );
bool bMeasReady = false;
// poll until measurement is ready...
User Manual 1177.5079.02 ─ 15
Performing measurement tasks - programming examples

Trace measurement with synchronization to measurement complete

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

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents