![R&S 1444.1190K02 Скачать руководство пользователя страница 123](http://html1.mh-extra.com/html/rands/1444-1190k02/1444-1190k02_user-manual_774881123.webp)
Performing measurement tasks - programming examples
R&S
®
NRPxxP
123
User Manual 1179.5760.02 ─ 02
//Configure the trigger
TRIGger:SOURce INTernal
TRIGger:SLOPe POSitive
TRIGger:DTIMe 0.001
TRIGger:HYSTeresis 0.1
TRIGger:LEVel 30e-6
//Enable and configure the averaging filter
SENSe:TRACe:AVERage:COUNt 8
SENSe:TRACe:AVERage:STATe ON
//Select the data output format
FORMat:DATA REAL
//Initiate the measurement
INITiate
//Query the measurement results
FETCh?
9.4
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 power 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 power 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 1.8e9" );
write( "SENS:TRAC:POIN 500" );
write( "SENS:TRAC:TIME 20e-3" );
write( "TRIG:SOUR INT" );
write( "TRIG:SLOP POS" );
write( "TRIG:DTIM 0.001" );
Trace measurement with synchronization to measurement complete