Programming examples – Tektronix AWG610 User Manual
Page 315
AWG610 Arbitrary Waveform Generator User Manual
3-197
Programming Examples
The following eight equation programming examples are described below.
Examples Key points to be learned
Example 1 Describes how to create waveform file, and how to read and write waveform files.
Example 2 Describes how to use for loop and if conditional branch statements.
Example 3 Describes how to put comments, and how to create sequence file.
Example 4 Describes how to use marker data and how to use the binary relational operations
in the assignment statement.
Example 5 Describes how to use digital filter functions.
Example 6 Describes how to use data() and code() functions.
Example 7 Describes how to handle specific point data in the waveform file using the
extract(), join() and integ() function, and also the for and if statement.
Example 8 Creates the equation file to generate the four waveforms and two sequence files
used inthe Sequence editor tutorial inthe Getting Started section.
Others
Refer to Appendix D:Sample Waveforms for more equationexamples. Most of the
waveforms in the appendix were created by the listed equations.
The example below creates three waveform files: a.wfm, b.wfm and c.wfm.
size = 2000
”a.wfm” = cos (2 * pi * scale)
size = 1512
”b.wfm” = cos (2 * pi * scale)
”c.wfm” = ”a.wfm” * ”b.wfm”
The first and third lines define the waveform record length (in points). You can
change the record length any time within an equation; all created files use the
last-set size value. When you do not define the waveform record length, the
instrument uses the default length of 1000.
The second line generates the waveform a.wfm with 2000 data points. The scale
is the system-used variable to fit the generated waveform within the
±
1.0 vertical
scale range.
The waveform c.wfm has the point size of 1512 and is generated by multiplying
the a.wfm and b.wfm waveforms.
Example 1