AWG610 Arbitrary Waveform Generator User Manual 3-197
Programming Examples
The following eight equation programming examples are described below.
Examples Keypoints to be learned
Example 1 Describeshow to create waveform file, and how to read and write waveform files.
Example 2 Describeshow to use for loop and if conditional branch statements.
Example 3 Describeshow to put comments, and how to create sequence file.
Example 4 Describeshow to use marker data and how to use the binary relational operations
in the assignment statement.
Example 5 Describeshow to use digital filter functions.
Example 6 Describeshow to use data() and code() functions.
Example 7 Describeshow 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 Createsthe equation file to generate the four waveforms and two sequence files
used in the Sequence editor tutorial in the GettingStarted section.
Others Refer to Appendix D:Sample Waveforms for more equation examples. 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