Initial Operation - Agilent Technologies E1463A User's Manual And Scpi Programming Manual

32-channel, 5 amp, form c switch scpi programming guide
Hide thumbs Also See for E1463A:
Table of Contents

Advertisement

Initial Operation

Example: Closing a
Channel (BASIC)
Example: Closing a
Channel (TURBO C)
Chapter 1
Two example programs follow to help get you started using the Form C
switch. The first example assumes an HP 9000 Series 200/300 controller
running BASIC and a GPIB interface. The second example assumes a PC
running Borland Turbo C and an 82350A (or equivalent) Interface Card (with
command library)
This program closes channel 02 of a Form C switch at logical address 120
(secondary address = 120/8 = 15) and queries the channel closure state.
The result is returned to the computer and displayed (1 = channel closed,
0 = channel open). See Chapter 3 for information on the SCPI commands.
10 OUTPUT 70915;"*RST"
20 OUTPUT 70915;"CLOS(@102)"
30 OUTPUT 70915;"CLOS?(@102)"
40 ENTER 70915;Value
50 PRINT Value
60 END
This program closes channel 02 of a Form C switch at logical address 120
(secondary address = 120/8 = 15) and queries the channel closure state.
The result is returned to the computer and displayed (1 = channel closed,
0 = channel open). See Chapter 3 for information on the SCPI commands.
#include <stdio.h>
#include <chpib.h>
#define ISC 7L
#define FORMC 70915L
#define TASK1 "*RST"
#define TASK2 "CLOSE (@102)"
#define TASK3 "CLOS? (@102)"
main()
{
char into[257];
int length = 256;
/*Output commands to Form C switch*/
error_handler (IOTIMEOUT (7L,5.0), "TIMEOUT");
error_handler (IOOUTPUTS (FORMC, TASK1, 4), "OUTPUT command");
error_handler (IOOUTPUTS (FORMC, TASK2, 12), "OUTPUT command");
error_handler (IOOUTPUTS (FORMC, TASK3, 12), "OUTPUT command");
/*Enter from Form C switch*/
error_handler (IOENTERS (FORMC, into, &length), "ENTER command");
printf("Now let's see if the switch is closed: %s",into);
return;
}
int error_handler (int error, char *routine)
{
! Reset the module
! Close channel 02
! Query channel 02 state
! Enter result into Value
! Display result
/*Include file for GPIB*/
/*Form C default address*/
/*Command for a reset*/
/*Command to close channel 02*/
/*Command to query channel 02*/
Getting Started 29

Advertisement

Table of Contents
loading

Table of Contents