Program Example - Agilent Technologies E2259A User's Manual And Programming Manual

Double-wide breadboard m-module
Table of Contents

Advertisement

Program Example

Artisan Scientific - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisan-scientific.com
The following program example demonstrates how to access the registers on
the Agilent E2259A. The example uses the VXIplug&play register reads
and writes.
The example programs were developed with the ANSI C language using the
Agilent VISA extensions. The programs were written and tested in
®
Microsoft
Visual C++ but should compile under any standard ANSI C
compiler.
To run the programs you must have the Agilent SICL Library, the Agilent
VISA extensions, and an Agilent 82340 or 82341 GPIB module installed
and properly configured in your PC. An Agilent E1406 Command Module
is required for the first program. The Agilent E2259A must be installed in
an Agilent E2251A Carrier for access to the A16 VXI registers.
The example programs reset the Agilent E2259A Breadboard M-Module. It
then:
Reads the ID, Device Type, Status, and A24 Memory Offset Registers.
Writes a value to the I/O Register to output data on BC0 - BC15,
Writes a value to the WP0 Register to output data on BC0 - BC15,
Reads a value from the I/O Register to input data on TR0 - TR15,
Reads a value from the RP0 Register to input data on TR0 - TR15.
#include <visa.h>
#include <stdio.h>
#include <stdlib.h>
ViSession viRM,m_mod;
int main()
{
unsigned short id_reg,dt_reg ;
unsigned short stat_reg, a24_offset ;
short value;
ViStatus errStatus;
/* Open the default resource manager */
errStatus = viOpenDefaultRM ( &viRM);
if (VI_SUCCESS > errStatus){
printf("ERROR: viOpenDefaultRM() returned 0x%x\n",errStatus);
return errStatus;}
/* Open the M-Module instrument session */
errStatus = viOpen(viRM,"GPIB-VXI0::8",VI_NULL,VI_NULL,&m_mod);
if (VI_SUCCESS > errStatus){
printf("ERROR: viOpen() returned 0x%x\n",errStatus);
return errStatus;}
/* ID & Device Type Registers */
/* Status & A24 Offset Reg */
/* register variable */
/*Status from each VISA call*/
Using the Breadboard
25

Advertisement

Table of Contents
loading

Table of Contents