User`s manual
Generating a
1
⁄
2
Rectified Sine Wave
The SIN_R program generates a Rectified sine wave using 4096 segments
or points.
BASIC Program Example (SIN_R)
This program is similar to the “SIN_X” BASIC program on page 105, with
the following differences:
1 !RE-STORE “SIN_R”
2 !This program outputs a rectified sine wave as an arbitrary waveform.
180 !Call the subprogram which defines a rectified sine wave and
190 !the output sequence.
200 CALL Sinr_def
210 !Select the output sequence and start the waveform.
220 OUTPUT @Afg;"SOUR:FUNC:USER SIN_R_OUT"
230 OUTPUT @Afg;"INIT:IMM"
280 SUB Sinr_def
290 Sinr_def:!Compute waveform (rectified sine wave) and define segment.
300 COM @Afg
310 DIM Waveform(1:4096)
320 FOR I=1 TO 4096
330 Waveform(I)=SIN(2*PI*(I/4096))
340 NEXT I
350 FOR I=2048 TO 4096
360 Waveform(I)=0
370 NEXT I
380 OUTPUT @Afg;"SOUR:LIST1:SEGM:SEL SIN_R" !Define segment name
390 OUTPUT @Afg;"SOUR:LIST1:SEGM:DEF 4096" !Define segment size
400 OUTPUT @Afg;"SOUR:LIST1:SEGM:VOLT";Waveform(*) !load waveform points
410 !
420 OUTPUT @Afg;"SOUR:LIST1:SSEQ:SEL SIN_R_OUT" !Define sequence name
430 OUTPUT @Afg;"SOUR:LIST1:SSEQ:DEF 1" !Define sequence size
440 OUTPUT @Afg;"SOUR:LIST1:SSEQ:SEQ SIN_R" !Set segment execution order
450 SUBEND
Chapter 3 Generating Arbitrary Waveforms 111