Performing Measurement Tasks - Programming Examples
R&S
®
NRPxxS(N)
146
User Manual 1177.5079.02 ─ 10
SENSe:POWer:AVG:APERture 10e-6
//Disable the averaging filter
SENSe:AVERage:STATE OFF
//Set the buffer size and enable the buffer for continuous average results
SENSe:BUFFer:SIZE 8192
SENSe:BUFFer:STAT ON
//Initiate a continuous measurement
INITiate:CONTinuous ON
//Fetch the number of results that is currently stored
//in the buffer after the measurement is done
SENSe:POWer:AVG:BUFFer:COUNt?
10.3
Performing a Buffered Continuous Average Measure-
ment
This example, written in pseudo code, shows how to setup and execute a buffered
continuous average measurement.
//Select whether using
// 'BUS Trigger' --> true
// or 'EXT Trigger' --> false
bool bUseBUSTrigger = true;
// Use the first NRP series sensor which is found
if ( VI_SUCCESS == SENSOR.openFirstNrpSensor( "USB?::0X0AAD::?*::INSTR" ) )
{
//Start with a clean state
SENSOR.write( "*RST" );
// Auto Averaging OFF and set Average Count = 4
SENSOR.write( "SENS:AVER:COUN:AUTO OFF" );
SENSOR.write( "SENS:AVER:COUN 4" );
// Select the trigger source
if ( bUseBUSTrigger )
{
// We want to use '*TRG' to trigger a single physical measurement
SENSOR.write( "TRIG:SOUR BUS" );
}
else
{
// We get trigger pulses on the external input (SMB-type connector)
SENSOR.write( "TRIG:SOUR EXT2" );
}
Performing a Buffered Continuous Average Measurement