
Programming Examples
U, I, P Measurement
6
6-9
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
}
U, I, P Measurement
This example will configure the instrument to measure power, voltage and current on
three-phase system 3 x 400V/50Hz and reads the measurements.
/*
* MEASURE U, I, P (wait synchronously)
*
* This example will configure the instrument to measure power, voltage
* and current on three-phase system 3 x 400V/50Hz and reads the measurements.
*
* The time it will take to finish the measurement is 1 s (averaging time).
* The query DATA? does not wait for the measurement to be completed, so it
* would return whatever values are available at a moment. The delay of 2
* seconds gives the instrument enough time to finish the measurement before
* reading data.
*/
#include <visa.h>
#include <stdio.h>
#define INTFC_RS232 1 /* RS-232 interface */
#define INTFC_GPIB 2 /* GPIB / IEEE 488.2 interface */
#define INTFC_LAN 3 /* ethernet / IEEE 802.3 interface */
#define INTFC_USB 4 /* USB interface (Virtual COM Port) */
#if 1
#define INTFC INTFC_RS232
#elif 1
#define INTFC INTFC_GPIB
#elif 1
#define INTFC INTFC_LAN
#else
#define INTFC INTFC_USB
#endif
#if INTFC == INTFC_RS232
# define RSRC_NAME "ASRL1" /* COM1 */
# define RSRC_ATTR_BAUD 115200 /* baud rate */
# define RSRC_ATTR_FLOW_CNTRL VI_ASRL_FLOW_RTS_CTS /* flow control */
#elif INTFC == INTFC_GPIB
# define RSRC_NAME "GPIB::5"
#elif INTFC == INTFC_LAN
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 ...