![background image](http://html1.mh-extra.com/html/rands/nrpm/nrpm_user-manual_3219371179.webp)
Programming examples
R&S
®
NRPM
179
User Manual 1425.8663.02 ─ 07
print(Query(session, "SYST:ERR?");
// Check for static errors
print(Query(session, "SYST:SERR?");
//===================================================================
// Execute the list mode measurement
//
// resetting the event information by an initial readout
Query(session, "STAT:OPER:MEAS:EVEN?");
Query(session, "STAT:OPER:EVEN?");
// Start a measurement
WriteCmd(session, "INIT:IMM");
// Synchronize with end of measurement...
// (We will prematurely end this function if we do not get a trigger
// within approx. 30 seconds)
bool bMeasReady = FALSE;
unsigned int uiSleep = 10; // 10 ms
unsigned int uiWaitForTriggerTimeoutCount = 5000 / uiSleep;
unsigned short usEvent = 0;
while (!bMeasReady)
{
Query(pSensor->session, "STAT:OPER:MEAS:EVEN?", szReadBuff,
sizeof(szReadBuff));
usEvent = atoi(Query(session, "STAT:OPER:MEAS:EVEN?"));
bMeasReady = ((usEvent & 0x02) != 0);
if (bMeasReady)
break;
if (uiWaitForTriggerTimeoutCount > 0)
{
--uiWaitForTriggerTimeoutCount;
_sleep(10);
}
else
break;
}
// If no trigger burst has been recognized, we prematurely end here!
if (!bMeasReady)
return 0; // No results
// Fetch AVERAGE results
Performing measurements in list mode