Programming Examples
R&S
®
ZNB/ZNBT
1222
User Manual 1173.9163.02 ─ 38
:CALCULATE1:MATH:FUNCTION NORMAL
:CALCULATE1:MATH:FUNCTION?
*RST
// Create Trc2 in channel 1 and display it in diagram 1
:CALCULATE1:PARAMETER:SDEFINE "Trc2","S11"
:DISPLAY:WINDOW1:TRACE2:FEED 'Trc2'
// Create diagram 2 and Trc3 in new channel
:DISPLAY:WINDOW2:STATE ON
:CALCULATE2:PARAMETER:SDEFINE "Trc3","S11"
:DISPLAY:WINDOW2:TRACE1:FEED 'Trc3'
// Select active traces for channels 1 and 2
:CALCULATE1:PARAMETER:SELECT "Trc1"
:CALCULATE2:PARAMETER:SELECT "Trc3"
// Create memory trace on Trc1 and assign it to a diagram, same for TRC3
:TRACE:COPY MDATA7,CH1DATA
:DISPLAY:WINDOW1:TRACE3:FEED 'Mem7[Trc1]'
:TRACE:COPY MDATA8,CH2DATA
:DISPLAY:WINDOW2:TRACE2:FEED 'Mem8[Trc3]'
// Examples for Trace Mathematics
// Special operands Data and Mem
:CALCULATE1:MATH:SDEFINE "Data * Mem"
:CALCULATE1:MATH:STATE ON
// Constants
:CALCULATE1:MATH:SDEFINE "Pi * e * j"
// Functions
:CALCULATE1:MATH:SDEFINE "linMag (1) + dBMag (2) + Arg (3) + Re (4) + Im (5j)"
:CALCULATE1:MATH:SDEFINE "log (2) * ln (3) * Min (1, 2) * Max (2, 3)"
:CALCULATE1:MATH:SDEFINE "S asin (sin (3)) + acos (cos (4))
+ atan (tan (4))"
:CALCULATE1:MATH:SDEFINE "(Trc1 + 2) * 1.1"
:CALCULATE1:MATH:SDEFINE "(tRC1 + e) * Pi + STIMVAL - sin (1) + Min (TRC1, Trc1)"
// Imaginary unit j = sqrt (-1)
// j is no ordinary operand: 1j not 1 * j
// magnitude: 1, phase: 60 degrees
:CALCULATE1:MATH:SDEFINE "(1 + 3 ^ (1 / 2) * 1j) / 2"
:CALCULATE1:MATH:SDEFINE "sin (1) + ACOS (0.5)"
// 2 periods for sin (), ... when stop frequency 8 GHz = 8e9 Hz
:CALCULATE1:MATH:SDEFINE "sin (2 * 2 * Pi * StimVal / 8e9) "
:CALCULATE1:MATH:SDEFINE "cos (2 * 2 * Pi * StimVal / 8e9) "
:CALCULATE1:MATH:SDEFINE "tan (2 * 2 * Pi * StimVal / 8e9) "
:CALCULATE1:MATH:SDEFINE "Min (sin (6 * Pi * StimVal / 8e9),
cos (6 * Pi * StimVal / 8e9))"
Condensed Programming Examples