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ib\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
Summary of Contents for E3633A
Page 9: ...8 ...
Page 14: ...1 General Information ...
Page 25: ...Chapter 1 General Information Input Power Requirements 24 ...
Page 26: ...2 Initial Operation ...
Page 33: ...Chapter 2 Initial Operation Output Checkout 32 ...
Page 34: ...3 Front Panel Operation ...
Page 74: ...4 Remote Interface Reference ...
Page 124: ...5 Error Messages ...
Page 134: ...6 Application Programs ...
Page 145: ...Chapter 6 Application Programs Example Program for Excel 97 144 ...
Page 146: ...7 Tutorial ...
Page 162: ...8 Specifications ...
Page 169: ...Chapter 8 Specifications Supplemental Characteristics 168 ...
Page 175: ......