4. The voltage data values are sent next using the array
Wave_seg
in
IOOUTPUTA (ADDR, Wave_seg, num_size)
. The values in
Wave_seg
are in a floating point format.
IOOUTPUTS
automatically
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);
}
Transferring Data in
QuickBASIC
To transfer data to the AFG requires that the data sent with the
[SOURce:]LIST[:SEGMent]:VOLTage
command must be contiguous. To do
this, send no carriage return (CR) and line feed (LF) before transferring all
the data. The
SendData
routine in the QuickBASIC program do this as
follows (refer to the QuickBASIC routine below):
1. Disable EOI and EOL using
IOEOI (ISC&, 0)
and
IOEOL (ISC&,
“ ” ,
0
),
respectively.
ISC&
contains the HP-IB select code, the
0
and “ ”
(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
command string using
IOOUTPUTS(ADDR&, Commands$, LEN(Commands$)
.
ADDR&
contains the AFG HP-IB address,
Commands$
contains the SCPI
command string, and
LEN(Commands$)
contains the string length of
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
IOEOI(ISC&, 1)
and
IOEOL(ISC&,
Endline$, LEN(Endline$))
, respectively. The variable
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).
63 Generating Arbitrary Waveforms with the HP E1340A
Chapter 3
Содержание E1340A
Страница 12: ...Notes 12 HP E1340A Arbitrary Function Generator Module User s Manual ...
Страница 14: ...14 HP E1340A Arbitrary Function Generator Module User s Manual ...
Страница 42: ...Chapter 2 Generating Standard Waveforms with the HP E1340A 42 ...
Страница 54: ...Chapter 2 Generating Standard Waveforms with the HP E1340A 54 ...
Страница 57: ...Figure 3 1 Generating Arbitrary Waveforms 57 Generating Arbitrary Waveforms with the HP E1340A Chapter 3 ...
Страница 58: ...Chapter 3 Generating Arbitrary Waveforms with the HP E1340A 58 ...
Страница 84: ...Chapter 4 HP E1340A Sweeping and Frequency Shift Keying 84 ...
Страница 130: ...Chapter 6 HP E1340A High Speed Operation 130 ...
Страница 202: ...202 HP E1340A SCPI Conformance Information Chapter 7 ...
Страница 204: ...Figure 8 1 HP E1340A Status Groups and Associated Registers Chapter 8 HP E1340A AFG Status 204 ...
Страница 218: ...218 HP E1340A Specifications Appendix A ...
Страница 284: ...284 HP E1340A Register Based Programming Appendix C ...
Страница 295: ...Index HP E1340A Arbitrary Function Generator User s Manual 295 ...