HP E1340A User Manual page 116

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

Advertisement

C and QuickBASIC
Program Versions
Transferring Data in C
Chapter 6
320
SUB Ramp_wave
330 Ramp_wave: !Subprogram which defines ramp waveform
340
COM @Afg,@Afg1,INTEGER Waveform(*)
350
FOR I=1 TO 4096
360
Waveform(I)=((I*.00122)/.0025)+2048
370
NEXT I
380
!
390
OUTPUT @Afg;"SOUR:ARB:DAC:SOUR INT" !dac data source
400
OUTPUT @Afg;"SOUR:LIST:SEGM:SEL A"!select segment name
410
OUTPUT @Afg USING "#,K";"SOUR:LIST:SEGM:VOLT:DAC #48192"
420
OUTPUT @Afg1;Waveform(*) !8192 bytes: 4 digits
430
OUTPUT @Afg
440
SUBEND
450
!
460
SUB Rst
530
SUB Errmsg
The C example program, DACBLOK.C, is in directory "CPROG" and the
QuickBASIC example program, DACBLOK.BAS, is in directory
" QBPROG" on the C and QuickBASIC example disk (part number
E1340-10036).
To transfer Definite Length Block Data to the AFG requires that the data
sent with the
[SOURce:]LIST[:SEGMent]:VOLTage:DAC
contiguous. To do this, send no carriage return (CR) and line feed (LF)
before transferring all the data. The
(refer to the C function 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[1][:SEGment]:VOLTage:DAC
IOOUTPUTS (ADDR, commands, strlen(commands))
contains the AFG HP-IB address,
command string, and
. This enables the AFG to receive voltage data. Since CR
commands
or LF is disabled, the AFG holds execution until all the data is sent.
!calculate waveform points as dac
codes
(2 bytes/ampl point)
!CR LF
send_data
function does this as follows
IOEOI (ISC, 0)
contains the HP-IB select code, and the
commands
strlen(commands)
contains the string length of
HP E1340A High Speed Operation
(internal)
command must be
and
IOEOL (ISC, " ", 0)
,
0
and " "
command string using
.
ADDR
contains the SCPI
116

Advertisement

Table of Contents
loading

Table of Contents