13.2. Scripting the creation of waveforms and using them

You can also script the creation of waveform objects and then use the SpecTcl API to locate the waveform objects you need in your event processor object. The new waveform allows you to create and maniupulate waveform objects. The code in the OnAttach of Programmatically creating and filling a waveform is equivalent to the following Tcl, which can be placed in, e.g. SpecTclRC.tcl

Example 13-2. Scrdipting waveform objects


waveform create test 100     (1)
waveform metadata set test Frequency  100MHz bits 14 (2)
            
(1)
Creates the waveform named test with 100 sample points.
(2)
Sets the waveform metadata.

The code to locate and fill the event processor in the event processor is the same as that shown in Programmatically creating and filling a waveform.