HP E1340A User Manual page 119

Arbitrary function generator
Hide thumbs Also See for E1340A:
Table of Contents

Advertisement

Swapping the
Data Bytes
119
HP E1340A High Speed Operation
5. After all the data is sent, the function sends blank data using
IOOUTPUTS(ADDR&,"",0)
LF. This lets the AFG know that it can receive a new command.
SUB SendData (Commands$, WaveSeg%(), NumSize%, SwapSize%)
Endline$ = CHR$(13) + CHR$(10)
' First disable EOI and EOL to send continuous data to the AFG; then send
the last command
CALL IOEOI(ISC&, 0)
CALL IOEOL(ISC&, " ", 0)
CALL IOOUTPUTS(ADDR&, Commands$, LEN(Commands$))
' Send the data
CALL IOOUTPUTAB(ADDR&, SEG WaveSeg%(1), NumSize%,
SwapSize%)
' Re-enable EOL and EOI for normal HP-IB operation; then send CR/LF
CALL IOEOI(ISC&, 1)
CALL IOEOL(ISC&, Endline$, LEN(Endline$))
CALL IOOUTPUTS(ADDR&, "", 0)
END SUB
The C and QuickBASIC programs used with a PC type computer sends the
least significant bit (LSB) of the data byte first and the most significant bit
(MSB) last. Thus,
IOOUTPUTAB
the LSB last. To do this, set
(C program) or
num_bytes, swap)
IOOUTPUTAB(ADDR&, SEG WaveSeg%(1), SwapSize%)
program) to the size of the
of the array). Since the DAC code is a 16-bit integer, the array type is an
integer. The
or
swap
SwapSize%
This lets
IOOUTPUTAB
to terminate the data transfer with a CR
must swap the data bytes in order to send
swap
in
IOOUTPUTAB(ADDR, Wave_seg,
in
SwapSize%
Wave_seg
or
WaveSeg%
value is thus the size of an integer (i.e., 2).
know when to swap the byte.
(QuickBASIC
array type (not the size
Chapter 6

Advertisement

Table of Contents
loading

Table of Contents