Example Program For C And C - HP E3633A User Manual

Table of Contents

Advertisement

Chapter 6 Application Programs

Example Program for C and C++

Example Program for C and C++
7KH#IROORZLQJ#&#SURJUDPPLQJ#H[DPSOH#VKRZV#\RX#KRZ#WR#VHQG#DQG#UHFHLYH#
IRUPDWWHG#,221#7KLV#H[DPSOH#SURJUDPPLQJ#VKRZV#\RX#KRZ#WR#XVH#WKH#6&3,#
FRPPDQGV#IRU#WKH#LQVWUXPHQW#ZLWK#WKH#9,6$#IXQFWLRQDOLW\#DQG#GRHV#LQFOXGH#
HUURU#WUDSSLQJ1#)RU#PRUH#LQIRUPDWLRQ#RQ#QRQ0IRUPDWWHG#,22#DQG#HUURU#WUDSSLQJ/#
UHIHU#WR#WKH#+3#9,6$#User's Guide1
7KH#IROORZLQJ#&#SURJUDPPLQJ#H[DPSOH#ZDV#ZULWWHQ#LQ#0LFURVRIW ® #9LVXDO#&..#
YHUVLRQ#4185#XVLQJ#SURMHFW#W\SH#§4XLFN:LQ#DSSOLFDWLRQªª/#DQG#XVLQJ#WKH#ODUJH#
PHPRU\#PRGHO#DQG#&..#YHUVLRQ#71[#RU#813#XVLQJ#SURMHFW#W\SH#§:LQGRZV#65#
DSSOLFDWLRQªª1#%H#VXUH#WR#PRYH#WKH##§YLVD1OLE#+:LQGRZV ® #614,#RU#YLVD651OLE#
+:LQGRZV ® #<8217,¨#DQG#§YLVD1K¨#ILOH#WR#WKH#OLE#DQG#LQFOXGH#GHYHORSPHQW#
GLUHFWRU\1#7KHVH#DUH#XVXDOO\#IRXQG#LQ#WKH#c:\vxipnp\win(win95 RU winnt)\lib\msc
RU c:\vxipnp\win (win95 RU winnt)\include#GLUHFWRU\1
Diode.c
/*Diode.C
This example program steps the power supply through 11 voltages and measures the current
response. It prints the voltage step and the current response as a table. Note that the
HP-IB address is the default address from the factory for the power supply.*/
#include <visa.h>
#include <stdio.h>
#include <string.h>
#include <time.h>
#include <conio.h>
#include <stdlib.h>
ViSession
defaultRM;
ViSession
power_supply;
int
bHPIB = 1;
long
ErrorStatus;
char
commandString[256];
char
ReadBuffer[256];
void
delay(clock_t wait);
void
SendSCPI(char* pString);
void
CheckError(char* pMessage);
void
OpenPort();
void main()
{
double
voltage;
char
Buffer[256];
double
current;
/* Resource manager id
/* Identifies power supply
/* Set the number to 0 for use with the RS-232 */
/* VISA Error code
/* Value of voltage sent to power supply
/* String returned from power supply
/* Value of current output of power supply
*/
*/
*/
*/
*/
*/
Continued on next page
135
6

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

E3634a

Table of Contents