Application Programs
5
Example Program for C++ (GPIB IEEE 488)
E3632A User’s Guide
141
Example Program for C++ (GPIB IEEE 488)
This following C programming example shows sending and
receiving formatted I/O. Refer to the
VISA User’s Guide
for
non- formatted I/O. This example program is intended to
show the use of SCPI commands and VISA functionality and
does not include error trapping. Error trapping, however, is
good programming practice and is recommended in your
application. Refer to the
VISA User’s Guide
for more
information about error trapping.
The example program was written in Microsoft Visual C++
ver 1.52, project type “QuickWin application”, using the large
memory model. Be sure to move the “visa.lib” and “visa.h”
file to the lib and include development directory. These are
usually found at
c:\vxipnp\win\lib\msc\
and
c:\vxipnp\win\include
.
Diode.c
/*Diode.C
This example program steps the E3632A DC Power Supply through 10 voltages and measures the
current response. It prints the voltage step and the current response as a table. Note that
the GPIB address is the default address from the factory for the E3632A.*/
#include <visa.h>
#include <stdio.h>
#include <string.h>
#include <time.h>
/* Provides a delay of the specified time wait in milliseconds*/
void delay( clock_t wait );
void main ()
{
ViSession defaultRM; /* resource manager id */
ViSession power_supply; /* session id to an instrument */
char reply_string [256]; /* string returned from instrument */
char GPIB_address [3]; /* GPIB address of instrument */
char Visa_address[40]; /* Complete VISA address send to card */
double voltage; /* value of voltage sent to power supply */
double current; /* value of current output of power supply */
Содержание E3632A
Страница 1: ...Keysight E3632A DC Power Supply User s Guide ...
Страница 2: ......
Страница 3: ......
Страница 12: ...X E3632A User s Guide THIS PAGE HAS BEEN INTENTIONALLY LEFT BLANK ...
Страница 20: ...XVIII E3632A User s Guide THIS PAGE HAS BEEN INTENTIONALLY LEFT BLANK ...
Страница 22: ...XX E3632A User s Guide THIS PAGE HAS BEEN INTENTIONALLY LEFT BLANK ...