HP E1340A User Manual page 63

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

Advertisement

Transferring Data in
QuickBASIC
63
Generating Arbitrary Waveforms with the HP E1340A
4. The voltage data values are sent next using the array
IOOUTPUTA (ADDR, Wave_seg, num_size)
are in a floating point format.
Wave_seg
separates each value in the arrays by a comma ( , ).
5. After all the data is sent, the data transfer terminates with a CR and
LF. This lets the AFG know that it can receive a new command.
void send_data(char *commands, float *Wave_seg, int num_size)
{
char static state[2] = {13, 10};
/* First disable EOI and EOL; then send the last command */
IOEOI (ISC, 0);IOEOL (ISC, " ", 0);
IOOUTPUTS (ADDR, commands, strlen(commands));
/* Re-enable EOL and EOI for normal HP-IB operation; then
send the last data */
IOEOI (ISC, 1);IOEOL (ISC, state, 2);
IOOUTPUTA (ADDR, Wave_seg, num_size);
}
To transfer data to the AFG requires that the data sent with the
[SOURce:]LIST[:SEGMent]:VOLTage
this, send no carriage return (CR) and line feed (LF) before transferring all
the data. The
routine in the QuickBASIC program do this as
SendData
follows (refer to the QuickBASIC routine below):
1. Disable EOI and EOL using
respectively.
ISC&
(NULL) values disables the carriage return (CR) and line feed (LF)
to allow the AFG to receive a command string without a terminator.
2. Next, sent to the AFG the SCPI
[SOURce:]LIST[:SEGment]:VOLTage
IOOUTPUTS(ADDR&, Commands$, LEN(Commands$)
contains the AFG HP-IB address,
command string, and
Commands$
. This enables the AFG to receive voltage data. Since
CR or LF is disabled, the AFG holds execution until all the data is
sent.
3. Enable EOI and EOL using
Endline$, LEN(Endline$))
contains the decimal codes for CR and LF. Although EOL and EOI
are enabled, no CR and LF is sent until all voltage data transfer is
completed (next step).
IOOUTPUTS
command must be contiguous. To do
IOEOI (ISC&, 0)
contains the HP-IB select code, the
command string using
Commands$
contains the string length of
LEN(Commands$)
IOEOI(ISC&, 1)
, respectively. The variable
Wave_seg
in
. The values in
automatically
and
IOEOL (ISC&,
" ",
0
),
0
and " "
.
ADDR&
contains the SCPI
and
IOEOL(ISC&,
Endline$
Chapter 3

Advertisement

Table of Contents
loading

Table of Contents