
Programming Examples
U, I, P Measurement over RS-232 Interface without VISA Library
6
6-25
/****************************************************************************
**/
static int sio_puts(sio_t *sio,char *str)
{
char buf[1024];
strcpy(buf,str);
strcat(buf,"\n");
return sio_write(sio,(byte *)buf,strlen(buf));
}
/****************************************************************************
**/
int main(int argc,char *argv[])
{
char buffer[1024];
sio_t sio;
/*
* Open connection to the instrument:
*/
if ( sio_open(&sio,SIO_PORT) < 0 )
return 1;
#if 0
if ( sio_puts(&sio,"*IDN?") < 0 )
return 1;
if ( sio_gets(&sio,buffer) < 0 )
return 1;
puts(buffer);
#endif
#if 1
/* Bring the instrument into a default state: */
sio_puts(&sio,"*RST");
#endif
/* Select three wattmeter configuration: */
sio_puts(&sio,"ROUT:SYST \"3W\"");
/* SYNC source = voltage phase 1: */
sio_puts(&sio,"SYNC:SOUR VOLT1");
/* Set voltage range on voltage channel 1 to 300 V: */
sio_puts(&sio,"VOLT1:RANG 300.0");
/* Set current channel 1 to autorange: */
sio_puts(&sio,"CURR1:RANG:AUTO ON");
/* Set averaging time to 1 second: */
sio_puts(&sio,"APER 1.0");
/* Select U, I, P measurement: */
sio_puts(&sio,"FUNC \"VOLT1\",\"CURR1\",\"POW1:ACT\"");
/* Run continuous measurements: */
sio_puts(&sio,"INIT:CONT ON");
Delay(2.0); /* Wait 2 seconds */
/****************************************************************************
**/
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 ...