SynaptiCAD Tutorials

(TD) 4.2 Faster Drawing with Waveform Equation Blocks

(TD) 4.2 Faster Drawing with Waveform Equation Blocks

Previous topic Next topic  

(TD) 4.2 Faster Drawing with Waveform Equation Blocks

Previous topic Next topic  

The fastest way to generate analog waveforms that can be edited as equations is to use a Waveform Equation Block. Waveform equation blocks contain a Python function that is evaluated at each point to calculate the associated waveform value. There are several built-in functions and you can write your own functions.

Adding a Waveform Equation Block:

Add a new signal and draw one or more waveform segments on it.

Double Click on a segment to open the Edit Bus State dialog.

eq_drawnew

 

Press the Insert Block button to open the Waveform Equation Block Properties dialog.

eq_edit_bus_state_dlg

Choose Sine Wave from the pre-defined equation flyout.

Notice that the code to make the sine wave is shown in the edit box portion of the dialog. This is Python code that can be edited by you.

The State function is called at each point in the Sampling Period (startT + n*deltaT) to figure out the value for the waveform at that particular point (n).

Press OK to close this dialog and generate the waveform.

eq_wf_eq_block_dlg_small

eq_first_sine

Setup View Mode and Drag the Equation block:

When you are viewing the waveforms normally, it is impossible to tell the difference between a sine wave generated by a Waveform Equation Block or one generated by the older method of State Label Equations. There is a special mode that will highlight the equation blocks and speed up editing these blocks (in this mode, double clicking on the block will directly open the dialog that edits waveform blocks).

Check the View > Show Waveform Block Highlights menu to draw blue boxes around all of the Waveform Equation Blocks.

Move the block around by dragging-and-dropping the first edge of the block using the left mouse button. This moves the block but does not affect the other edges of the signal.

eq_show_highlight_menu

To move all of the transitions on one signal, hold down the <1> and <2> number keys while dragging the equation block. Holding down just the <1> key moves all the edges to the left of the selected edge, and the <2> key moves all the edges to the right of the selected edge. You may need to add more transitions on the signal to see the effect of these keys.