![background image](http://html1.mh-extra.com/html/rands/nrpm/nrpm_user-manual_3219371183.webp)
Programming examples
R&S
®
NRPM
183
User Manual 1425.8663.02 ─ 07
Example: C/C++ (VISA) source code
This sequence shows the VISA source code, based on the
pseudo code
example
above.
// Determine the resource identifier, e.g.
// resource = "NRPM3-100001"
// resource identifier = USB0::0x0aad::0x0195::100001
// Open the device
viOpen( defaultRM, “USB0::0x0aad::0x0195::100001”, VI_NULL, VI_NULL,&session );
// Select the trace measurement mode
viWrite( session, “SENS:FUNC \”XTIM:POW\”\n”, 21, &uiSent );
// Set the overall length (10 ms) of the trace
// select the number of measurment points (500 points)
viWrite( session, “SENS:TRAC:TIME 10.0e-3\n”, 23, &uiSent );
viWrite( session, “SENS:TRAC:POINTS 500\n”, 21, &uiSent );
// Initiate a single measurement
viWrite( session, “INIT:IMM\n”, 9, &uiSent );
// Read the measurement result
viWrite( session, “FETCH1?\n”, 7, &uiSent );
viRead( session, resA, sizeof(resA), &uiCnt );
viWrite( session, “FETCH2?\n”, 7, &uiSent );
viRead( session, resB, sizeof(resB), &uiCnt );
viWrite( session, “FETCH3?\n”, 7, &uiSent );
viRead( session, resC, sizeof(resC), &uiCnt );
// process resA, resB and resC. Every buffer contains
// the measurement data of one channel
// Close the device
viClose( session );
Performing measurements in trace mode