
2-2
Sample Programs
C Programming Examples
C Programming Examples
Listings of the C sample programs in this section include:
General Measurement Example
In this example, the main function inclues a call to init_IO() which initializes the instrument
and interface so that the instrument can capture data and perform measurements on the
data. At the start of the program, global symbols are defined which will be used to store and
convert the digitized data to time and voltage values. In the transfer_data function, the
header string (header_str) resembles the following string when the information is stripped
off: #510225. The left-most "5" defines the number of digits that follow (10225). The example
number "10225" is the number of points in the waveform. The information is stripped off of
the header to get the number of data bytes that need to be read from the instrument. In the
convert_data function, the data values are returned as digitized samples (sometimes called
quantization levels or q-levels). These data values must be converted into voltage and time
values. In the store_csv function, the time and voltage information of the waveform is stored
in integer format, with the time stored first, followed by a comma, and the voltage stored sec-
ond.
File: init.c
/* init. c */
/*
* Command Order Example. This program demonstrates the order of commands
* suggested for operation of the Agilent 86100 analyzer via GPIB.
* This program initializes the scope, acquires data, performs
* automatic measurements, and transfers and stores the data on the
* PC as time/voltage pairs in a comma-separated file format useful
* for spreadsheet applications. It assumes a SICL INTERFACE exists
Содержание 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...