Generating A Sine Wave; Hp E1340A Example Programs - HP E1340A User Manual

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

Advertisement

Generating a Sine
Wave
HP IBASIC (RSTSINE)
C and QuickBASIC
Programs

HP E1340A Example Programs

Chapter 1
To output a sine wave, only an amplitude needs to be specified and the AFG
placed in the wait-for-trigger state (INIT). Using the minimum amount of
AFG commands, this programs generates a 10 kHz, 10 Vp-p sine wave.
1
!RE-SAVE"RSTSINE"
2
!This program outputs a sine wave based on a specified amplitude
3
!and the reset settings of the AFG.
4
!
10
!Assign an I/O path between IBASIC and the AFG.
20
ASSIGN @Afg TO 80910
30
COM @Afg
40
!
50
!Reset the AFG
60
CALL Rst
70
OUTPUT @AFG;"SOUR:VOLT:LEV:IMM:AMPL 5" !set amplitude
80
OUTPUT @Afg;"INIT:IMM" !output sine wave using reset conditions
90
END
100
!
110
SUB Rst
120 Rst: !subprogram which resets the AFG.
130
COM @Afg
140
OUTPUT @Afg;"*RST;*OPC?"
150
ENTER @Afg;Complete
160
SUBEND
The C and QuickBASIC versions of RSTSINE are on the C language
example programs disk (HP P/N E1340-10036).
For easy reference, names and descriptions of the example programs in this
manual are summarized in Appendix B, Table B-1.
!reset the AFG
Getting Started with the HP E1340A
40

Advertisement

Table of Contents
loading

Table of Contents