
Programming Examples
Continuous Power Measurement
6
6-11
/* Select three wattmeter configuration: */
viPrintf (vi, "ROUT:SYST \"3W\"\n");
/* SYNC source = voltage phase 1: */
viPrintf (vi, "SYNC:SOUR VOLT1\n");
/* Set voltage range on voltage channel 1 to 300 V: */
viPrintf (vi, "VOLT1:RANG 300.0\n");
/* Set current channel 1 to autorange: */
viPrintf (vi, "CURR1:RANG:AUTO ON\n");
/* Set averaging time to 1 second: */
viPrintf (vi, "APER 1.0\n");
/* Select U, I, P measurement: */
viPrintf (vi, "FUNC \"VOLT1\",\"CURR1\",\"POW1:ACT\"\n");
/* Run continuous measurements: */
viPrintf (vi, "INIT:CONT ON\n");
Delay (2.0); /* Wait 2 seconds */
viPrintf (vi, "DATA?\n"); /* Query the measurement */
memset(buffer,0,sizeof(buffer)); /* Clear buffer */
viRead (vi, buffer, 256, &retCnt); /* Read values */
printf (buffer); /* Print the value on the screen */
/* Close VISA session to the instrument: */
status = viClose (vi);
CHECK_STATUS(status != VI_SUCCESS,"viClose(vi)",status);
/* Close session to the default resource manager: */
status = viClose(rm);
CHECK_STATUS(status != VI_SUCCESS,"viClose(rm)",status);
return 0;
#undef CHECK_STATUS
}
Continuous Power Measurement
Valid signals should be connected to the input channels of instrument, otherwise the
measured value can be invalid.
/*
* CONTINUOUS POWER MEASUREMENT
*
* This program will open VISA session to the instrument and perform
continuous
* power measurement. Bit 10 of the operating status register is used
* to determine end of averaging interval. This way it is assured that
* the newest measurement is immediately fetched and displayed.
*
* The time it will take to measure the power depends on the voltage and
* current signals attached to the instrument. Default averaging interval
* (equals to measurement time) is 300 ms. In the case viRead times out
before
* the measured power is returned, VISA timeout must be increased.
Summary of Contents for NORMA 4000 Operators
Page 6: ...Remote Control Users Guide iv ...
Page 8: ...Remote Control Users Guide vi ...
Page 10: ...Remote Control Users Guide viii ...
Page 26: ...Remote Control Users Guide 2 2 ...
Page 38: ...Remote Control Users Guide 3 2 ...
Page 50: ...Remote Control Users Guide 4 2 ...
Page 150: ...Remote Control Users Guide 4 102 ...
Page 152: ...Remote Control Users Guide 5 2 ...
Page 160: ...Remote Control Users Guide 6 2 ...
Page 184: ...Remote Control Users Guide 6 26 ...