HP E1313A Manual page 31

High speed a/d module
Table of Contents

Advertisement

Typical C-SCPI
Example Program
/* verif.cs
/*
1.) Prints the HP E1413A Module's identification, manufacturer, and
/*
revision number.
/*
2.) Prints the Signal Conditioning Plug-ons (SCPs) identification*/
/*
(if any) at each of the SCP positions.
/*
3.) Takes voltage measurements on channels 100 to 163 and returns the*/
/*
readings from the Current Value Table (CVT) and FIFO. */
#include <stdio.h>
#include <cscpi.h>
/* Defines module's logical address */
#define LADD "24"
/* Declares module as a register device */
INST_DECL(e1413, "E1413A", REGISTER);
/* Prototypes of functions declared later */
void rst_clr( void );
void id_scps( void );
void start_ad( void );
void get_readng( void );
void prt_readng( float32 * );
int32 check_error( char * );
/************************************************************************/
main() /* Main function */
{
char
/* Clear screen and announce program */
printf("\033H\033J\n\n
printf("\n\n
/* Start the register-based operating system for the module */
INST_STARTUP();
/* Enable communications to the module; check if successful */
INST_OPEN(e1413, "vxi," LADD);
if ( !e1413 )
{
printf("INST_OPEN failed (ladd = %s).Failure code is: %d\n",
exit(1);
}
/* Read and print the module's identification */
INST_QUERY(e1413, "*idn?", "", read_id);
printf("\n\nInstrument ID: %s\n\n", read_id);
rst_clr(); /* Function resets the module */
id_scps();
start_ad();
get_readng(); /* Function gets and prints readings */
exit(0);
}
/*************************************************************************/
void rst_clr() /* Reset the A/D module to its power-on state */
{
int16
/* Reset the module and wait until it resets */
INST_QUERY(e1413, "*RST;*OPC?", "", &opc_wait);
/* Check for module generated errors; exit if errors read */
30
Getting Started
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com
The Verify program (file name verif.cs) is printed below to show a typical
C-SCPI program for the HP E1313/E1413.
*/
read_id[80];
Installation Verification Program\n\n");
Please Wait...");
LADD,cscpi_open_error);
/* Function checks for installed SCPs */
/* Function sets up the module to make measurements */
opc_wait;
*/
*/
*/
Chapter 1

Advertisement

Table of Contents
loading

This manual is also suitable for:

E1413c

Table of Contents