HP E1340A User's Manual
Download Operation & user’s manual of HP E1340A Portable Generator for Free or View it Online on All-Guides.com.
320 SUB Ramp_wave
330 Ramp_wave: !Subprogram which defines ramp waveform
340 COM @Afg,@Afg1,INTEGER Waveform(*)
350 FOR I=1 TO 4096 !calculate waveform points as dac
codes
360 Waveform(I)=((I*.00122)/.0025)+2048
370 NEXT I
380 !
390 OUTPUT @Afg;“SOUR:ARB:DAC:SOUR INT” !dac data source
(internal)
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
(2 bytes/ampl point)
430 OUTPUT @Afg !CR LF
440 SUBEND
450 !
460 SUB Rst
•
•
530 SUB Errmsg
•
•
C and QuickBASIC
Program Versions
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).
Transferring Data in C To transfer Definite Length Block Data to the AFG requires that the data
sent with the
[SOURce:]LIST[:SEGMent]:VOLTage:DAC command must be
contiguous. To do this, send no carriage return (CR) and line feed (LF)
before transferring all the data. The
send_data function does this as follows
(refer to the C function below):
1. Disable EOI and EOL using
IOEOI (ISC, 0) and IOEOL (ISC, “ ”, 0),
respectively.
ISC contains the HP-IB select code, and 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[1][:SEGment]:VOLTage:DAC command string using
IOOUTPUTS (ADDR, commands, strlen(commands)). ADDR
contains the AFG HP-IB address, commands contains the SCPI
command string, and
strlen(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.
Chapter 6 HP E1340A High Speed Operation 116