KEI 194A Programming.pdf

(2211 KB) Pobierz
IEEE-488 Programming Guide
Model
194A
High Speed Voltmeter
Ql.987, Keithley Instruments, Inc.
Instrument Division
Cleveland, Ohio, U.S.A.
Document Number: l94A-903-01 Rev. A
TABLE OF CONTENTS
About This Programming
Computer
Programming
Guide
..............................................................
Syntax
.................................
...................................
.................
.: .. ., ............
I ...............................
; ..............
., .. 1
3
7
11
.,..........
....
..I ......
.._ .......
17
21
29
_. .. .,
.............................
._._. ................
_ .......................
._.~. ......
.,_ .,....
_
...............
Single Channel
Dual Channel
Programming
Programming
-~__ __ ................................................
Single and Continuous
SRQ~andErrorHandling..
Binary
DataTransfer
Trigger Arming ..............................................
...................
;...:~ ...........
.: .... .._.....
..........................................................................
...................................
Reading Buffer Operation
37
41
47
55
~A-1
B-l
.I ..............
C-l
D-l
E-l
Using Translator ...................................................
Using External Sample Triggering ................................
Generating
Appendix
Appendix
Appendix
Appendix
Appendix
Bus Time Information
A - Device-Dependent
...............................................
Commands~
......................
.~~.;.:,
.I.
: ...........
.,.........
B - Data Formats ...................................................................
C - Status Words and SRQ Format I ..................................
D - Front Panel Modes and Equivalents IEEE-488 Commands
E - Data~Transmission
and NRFD Hold-off Times ......
...........................
; ..............................
ABOUT THIS PROGRAMMING GUIDE
This programming guide is intended as a tt.&xial on a number of programming conceptss
associated with the Model 194A. It is not intended to replace the IEEE-488 programming
section of the Instruction Manual, which should be consulted for detailed programming
information.
Programming concepts discussed in this guide include:
l
l
l
l
l
l
l
Programming a single-channel unit and obtaining data.
Programming a dual-channel unit and requesting data.
Single/continuous arming and~triggering.
Using binary data transfer to optimize speed.
Using SRQ and error word to minimize controller overhead.
Buffer operation, including use of buffer pointers.
Using Translator to increase readability and emulate-other instrumentation.
In addition to these fundamental concepts, applications programs for external sample tig-
gering, plotting data, and trigger performance and timing are also included. Fmally, reference
information such as device-dependent commands, data formats, and error words is also
supplied.
l/2
COMPUTER
SYNTAX
PROGRAMMING
All the example programs in this guide are written in Hewlett=Packard BASIC 4.0, which
is used on the Series 200 and 300 computers. This programming language was chosen for
these examples because of its ease of understanding, as well as its powerful subset of com-
mands and statements controlling the IEEE-488 bus.
Most BASIC 4.0 statements are very similar to those used~.in
other BASIC languages; however,
there are some statements associated with IEEE-488 bus Ii0 that require discussion. The
following provides a brief overview of some of the statements you will encounter in the various
programs in this guide. Refer to the BASIC 4.0 Reference for more detailed information.
OUTPUT
OUTPUT allows you to send a variable or string over the bus, and it may take on one c$
several forms. A typical syntax is:
In this instance, 7 specifies the interface select code, while 09 is the primary address of the
instrument. FlX is a literal string that will be transmitted to the instruments when the state-
ment~is executed.
ENTER
ENTER performs the opposite-function,~ allowing the transmission of data from the instru-
ment to the computer. Typical syntax for this statement is;
Again, 7 specifies the interface select code, while 09 represents the primary address of the
instrument. .A$ is a string variable into which incoming data is placed. Keep in mind that
A$ must be dimensioned large enough to hold all Rpected characters. As an alternative,
the ENTER statement-can directly input the data into a numeric variable, assuming that the
proper instrument data format is used.
SPOLL
SPOLL serial polls the instrumentand places its status byte in a numeric variable as follows:
Here again, 709 represents the interface select code and primary address of the instrument.
S is a numeric variable which will contain the decimal value of the status byte after the state-
3
ment is executed. The status byte-can then be checked by ANDing or BIXng S to determine
the status of the required bits. These bits can yield certain information such as reading,overflow
and ready for a new command.
BIT
BIT can be used to detetie
the bit status of numeric variables:
In this example, the status of bit 5 of the variable S is placed into A.
TRIGGER
TRIGGER sends a GET (Group Execute Trigger) to a device as follows:
A GET is one of many methods that can be used~& initiate a~
Model 194A +?v+urement~
In order to~~use~~ form of triggering, the GET t$ger mode must be programmed, and
this
the A/D converter must be armed. Note that programming a trigger mode over the bus
automatically arms the A/D converter.
ASSIGN
ASSIGN is used to assign an I/O path, as in the following example:
Following ASSIGN execution, the attribute D194 will be associated with the interface code
and primary address. Another form of ASSIGN is used to-define the IiO~buffer:
ASSIGM IZufTU
BUFFER k8 ‘~
TRANSFER
TRANSFER is used to perform a rapld I/O data transfer sequence. Usualli, TRANSFER is
used with the binary dump feature oft the Model 194A for most~rapid data transfer. Using
this combination, data can be transferred at a rate as high as 90K bytes per second.
Typical syntax for TRANSFER is:
TRAHSFER I?11194 TO WUF;
COU~KT-i00B,W~Il
In this instance, a total of 1000 bytes will be tr~mitted
buffer.
from the Model 194A to~~the~internal
4
Zgłoś jeśli naruszono regulamin