10.06.2016 Views

eldo_user

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Post-Processing Library<br />

Working with Waveforms Inside User Defined Functions<br />

proc WAVE_PLUS { wv_in } {set wv_out [expr $wv_in + $wv_in]<br />

+ return $wv_out}<br />

Waveforms in Expressions<br />

To enable operations on waveforms, a set of commands has been registered inside the PPL<br />

environment. Table 19-3 lists common operators’ syntax and the equivalent syntax used inside<br />

the PPL.<br />

These commands accept real, complex and/or wave arguments. For example, it is possible to<br />

add two waveforms, a waveform and a real, or two reals.<br />

Two commands are available to simplify the syntax: evalExpr and defineVec.<br />

Looking more closely at the Tcl syntax, complex expressions can be very difficult to read. For<br />

example, in common language:<br />

a = ((b+c)*(d+e))/(f+g)<br />

becomes, in Tcl:<br />

set a [div [mult [add $b $c] [add $d $e]] [add $f $g]]<br />

The example files, expressions.cir and expressions.tcl, show the usage of the evalExpr and<br />

defineVec commands with the two different syntaxes.<br />

Related Topics<br />

Table 19-3. C and PPL Syntax<br />

C Syntax C Example PPL Syntax PPL Example<br />

+ a = b + c add set a [add $b $c]<br />

- a = b - c sub set a [sub $b $c]<br />

* a = b * c mult set a [mult $b $c]<br />

/ a = b / c div set a [div $b $c]<br />

^ a = b ^ c pow set a [pow $b $c]<br />

fmod a = fmod(b,c) mod set a [mod $b $c]<br />

Post-Processing Library Example Files<br />

evalExpr<br />

defineVec<br />

Making Specific Calls to User Defined Functions<br />

Eldo® User's Manual, 15.3 1143

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!