
2-9
Sample Programs
C Programming Examples
Service Request Example
The sample C program, gen_srq.c, shows how to initialize the interface and instrument and
generate a service request. The init_IO() function initializes the instrument and interface and
sets up and generates a service request. In the initialize function, the *RST command is a
common command that resets the instrument to a known default configuration. Using this
command ensures that the instrument is in a known state before you configure it. *RST
ensures very consistent and repeatable results. Without *RST, a program may run one time,
but it may give different results in following runs if the instrument is configured differently.
*RST defaults the instrument to a set configuration so that the program can proceed from the
same state each time. The *CLS command clears the status registers and the output queue.
AUToscale finds and displays all signals that are attached to the instrument. You should pro-
gram the instrument's time base, channel, and trigger for the specific measurement to be
made, as you would do from the front panel, and use whatever other commands are needed
to configure the instrument for the desired measurement.
File: gen_srq.c
/* gen_srq.c */
/*
* This example programs initializes the Agilent 86100 scope, runs an
* autoscale, then generates and responds to a Service Request from the
* scope. The program assumes an Agilent 86100 at address 7, an interface card
* at interface select code 7, and a signal source attached to channel 1.
*/
#include <stdio.h>
/* location of: printf ( ) */
#include "hpibdecl.h"
void initialize ( );
void setup_SRQ ( );
void create_SRQ ( );
void main ( void )
{
init_IO ( );
/* initialize interface and device sessions */
initialize ( );
/* initialize the scope and interface */
setup_SRQ ( );
/* enable SRQs on scope and set up SRQ handler */
create_SRQ ( );
/* generate SRQ */
close_IO ( );
/* close interface and device sessions */
} /* end main ( ) */
/*
* Function name: initialize
* Parameters: none
* Return value: none
* Description: This routine initializes the analyzer for proper acquisition of data.
* The instrument is reset to a known state and the interface is cleared.
* System headers are turned off to allow faster throughput and immediate access
* to the data values requested by queries. The analyzer performs an autoscale to acquire waveform data.
Содержание 86100A
Страница 18: ...1 14 Introduction Status Reporting Figure 1 4 Status Reporting Data Structures...
Страница 19: ...1 15 Introduction Status Reporting Status Reporting Data Structures continued...
Страница 94: ...2 40 Sample Programs BASIC Programming Examples...
Страница 124: ...4 16 Root Level Commands VIEW...
Страница 125: ...5 DATE 5 2 DSP 5 2 ERRor 5 3 HEADer 5 4 LONGform 5 5 MODE 5 6 SETup 5 7 TIME 5 7 System Commands...
Страница 132: ...5 8 System Commands TIME...
Страница 140: ...6 8 Acquire Commands SWAVeform RESet...
Страница 152: ...7 12 Calibration Commands STATus...
Страница 192: ...11 12 Display Commands SSAVer...
Страница 202: ...12 10 Function Commands VERTical RANGe...
Страница 203: ...13 AREA 13 2 DPRinter 13 2 FACTors 13 3 IMAGe 13 3 PRINters 13 4 Hardcopy Commands...
Страница 316: ...21 12 TDR TDT Commands Rev A 05 00 and Below STIMulus...
Страница 332: ......
Страница 353: ...26 DISPlay 26 2 LOAD 26 2 SAVE 26 3 XOFFset 26 3 XRANge 26 3 YOFFset 26 3 YRANge 26 4 Waveform Memory Commands...