Using Variables and Traces

Formatting Trace-Data Output

20

ASSIGN @Sa TO 723

 

30

ASSIGN @Sa_fast TO 723;FORMAT OFF

Assign fast I/O path to 723.

40

OUTPUT @Sa;"MDS W;"

De￿ne data size as one word.

50

OUTPUT @Sa;"TDF B;"

Activate binary data format.

60

OUTPUT @Sa;"TRA?;"

Return amplitude of all trace elements

 

 

in measurement units .

70

ENTER @Sa_fast USING "#,W";Z(*)

Load binary values into array Z. \#"

 

 

speci￿es that line execution is termi-

nated when last ENTER item is termi- nated. \W" speci￿es that items loaded are words (two bytes).

To return trace data in block-data format with data size of one word (TDF A), then send data back to analyzer.

1

OUTPUT

723;"SNGLS;SP 1MHZ;CF 300MHZ;"

Activate single-sweep mode . Set

 

 

 

 

measurement range .

5

OUTPUT

723;"TS;"

 

Sweep trace A.

 

 

 

 

 

 

10

INTEGER Pounda,Num_bytes

Declare integer

array.

20

ASSIGN

@Sa TO 723

 

 

 

 

 

 

 

30

ASSIGN @Sa_fast TO 723;FORMAT OFF

Assign fast I/O path to 723.

40

OUTPUT

@Sa;"MDS

W;"

De￿ne data size as one word.

50

OUTPUT

@Sa;"TDF

A;"

Activate absolute block-data format.

60

OUTPUT

@Sa;"TRA?;"

Return amplitude of all trace elements.

70

ENTER @Sa_fast;Pounda,Num_bytes

Assign #A to Pounda. Assign length,

 

 

 

 

that is, the number of bytes re-

 

 

 

 

turned to computer, to Num

 

bytes .

 

 

 

 

(Temporary variables.)

80

ALLOCATE INTEGER A(1:Num_bytes/2)

Declare array with length of Num

 

bytes/2.

90

ENTER @Sa_fast;

A(*)

Store contents of trace A in an

 

 

 

 

integer array .

 

 

 

 

 

 

100 OUTPUT

@Sa;"TRDSP TRA,OFF;"

Stop display of trace A.

110 OUTPUT @Sa;"TRC";

This line and the next line store

 

 

 

 

the contents of the integer array in

 

 

 

 

trace C. The semicolon is required

 

 

 

 

to suppress carriage-return/line-feed

 

 

 

 

so that the TRC-command statement

 

 

 

 

is not terminated prematurely .

120 OUTPUT

@Sa_fast;Pounda;Num_bytes;A(*)

Send #A and length to OSA, fol-

 

 

 

 

lowed by contents of integer array.

 

 

 

 

As required by the TRC-command

 

 

 

 

syntax, the @Sa

 

fast format removes

 

 

 

 

commas that separate the numbers

 

 

 

 

inside the integer array .

130 OUTPUT 723;"VIEW TRC;"

View trace C.

 

 

 

 

 

 

2-14