HP E1340A User Manual page 32

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

Advertisement

QuickBASIC Program
Example
Chapter 1
This generates an object listing that has the same name as the program name
with an OBJ extension. This object file must be linked to the HP-IB library.
Second, link the HP-IB library:
path
\program name
link <
After prompted for a run file, press the Enter key. The executable file with
an EXE extension is then generated.
The following is an example program written in QuickBASIC using the HP
82335 HP-IB Interface Card. The program:
sends commands to the AFG to generate an arbitrary waveform
receives data from the AFG
shows how to send coupled commands
performs error checking of the AFG
' ARB_GEN.BAS - This program generates a 4096 points ramp. The data to
'
generate the ramp is transferred to the AFG as voltages
DECLARE SUB GenSeg ()
DECLARE SUB CmdExe (Commands$(), Length%)
DECLARE SUB SendData (Commands$, WaveSeg!(), NumSize%)
DECLARE SUB RstClr ()
DECLARE SUB CheckError (FuncType$)
DECLARE SUB RunQuery ()
COMMON SHARED ADDR&, ISC&
REM $INCLUDE: 'QBSETUP'
ISC& = 7 'Assigns the HP-IB select code
ADDR& = 70910 'Assign an I/O path between the computer and the AFG
CALL RstClr ' Reset the AFG
CALL GenSeg ' Generate segment list and output sequence
CALL RunQuery ' Query segment name
END
SUB CheckError (FuncType$)
Max.Length% = 160: Actual.Length% = 0
Continued on next page
>
Getting Started with the HP E1340A
32

Advertisement

Table of Contents
loading

Table of Contents