EasyManua.ls Logo

HP E3633A - Example Program for C and C

HP E3633A
175 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Chapter 6 Application Programs
Example Program for C and C++
135
6
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$#Users 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; /* Resource manager id */
ViSession power_supply; /* Identifies power supply */
int bHPIB = 1; /* Set the number to 0 for use with the RS-232 */
long ErrorStatus; /* VISA Error code */
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; /* Value of voltage sent to power supply */
char Buffer[256]; /* String returned from power supply */
double current; /* Value of current output of power supply */
Continued on next page

Table of Contents

Related product manuals