Programming Examples
R&S
®
ZNB/ZNBT
1221
User Manual 1173.9163.02 ─ 38
// Create new channel 3 and new trace
:CALCULATE3:PARAMETER:SDEFINE "Ch3Trc1","S21"
:CALCULATE3:PARAMETER:SELECT 'Ch3Trc1' // now active for channel 3
:CALCULATE3:PARAMETER:SELECT? %'Ch3Trc1'
:SENSE1:SWEEP:POINTS 22
:TRACE:COPY MDATA8,CH3DATA
:TRACE:COPY MDATA7,CH3DATA
:DISPLAY:WINDOW2:TRACE1:FEED 'Mem8[Ch3Trc1]'
:TRACE:DATA:RESPONSE? MDATA7 // assigned to no diagram
// Copy with arbitrary trace names, no blanks in trace names !!!
:TRACE:COPY 'Trace_Name','Ch3Trc1'
:DISPLAY:WINDOW2:TRACE2:FEED 'Trace_Name'
:CALCULATE3:PARAMETER:SELECT 'Trace_Name'
:CALCULATE3:PARAMETER:SELECT?
:TRACE:COPY 'XYZ','Ch2Trc1'
:DISPLAY:WINDOW2:TRACE3:FEED 'XYZ'
:CALCULATE2:PARAMETER:SELECT 'XYZ'
:CALCULATE2:PARAMETER:SELECT?
:TRACE:COPY MDATA4 ,'Ch3Trc1' // mixed parameters Char, String
:DISPLAY:WINDOW2:TRACE4:FEED 'Mem4[Ch3Trc1]'
// Copy to existing memory traces = update trace data
:TRACE:COPY MDATA6,CH1DATA
:TRACE:COPY 'XYZ','Ch2Trc1'
:CALCULATE1:PARAMETER:CATALOG?
:CALCULATE2:PARAMETER:CATALOG?
:CALCULATE3:PARAMETER:CATALOG?
8.2.2.3
Trace Mathematics
The following script shows how to define mathematical relations between traces.
// Reset the analyzer
*RST
:SYSTEM:DISPLAY:UPDATE ON
// Create memory trace on active trace of channel 1,
// assign the memory trace to a diagram
:CALCULATE1:MATH:MEMORIZE
:DISPLAY:WINDOW1:TRACE2:FEED 'Mem2[Trc1]'
// Define simple trace mathematics
:CALCULATE1:MATH:FUNCTION ADD
:CALCULATE1:MATH:FUNCTION?
// Trace mathematics off
Condensed Programming Examples