
Programming
Examples
995
REDIM
Form1_data(1:Size/6,2)
!
dimension
0
=
imag
mantissa,
997
!
1
=
real
mantissa
and
2
=
common
exponent
999
!
1001
ENTER
@Rec_data2;Form1_data(*)
!
read
the
data
1003
!
1005
!
Calculate
Exponent
-
The
exponent
is
represented
by
bits
0-7
of
1007
!
the
16
bit
integer,
Form1_data(n,2).
Bit
7
is
the
sign
bit
(1="-",
1009
!
0="+").
The
computed
value
is
offset
by
-15
to
give
values
which
1011
!
are
in
a
useful
range
for
measurements.
Thus,
for
Form1_data(n,2)
1013
!
values
of
0
to
127,
exponents
range
from
-15
to
112
and
for
values
1015
!
of
128
to
255,
exponents
range
from
-143
to
-16
respectivly.
This
1017
!
gives
a
data
range
of
~
674
to
-860
db
using
db=20*LGT(2^(exponent)).
1019
!
An
alternate,
table
method
is
used
to
decode
the
exponent
in
example26.
1021
!
1023
FOR
I=1
TO
SIZE(Form1_data,1)
1025
Exponent=BINAND(Form1_data(I,2),255)
!
bits
0-7
are
the
exponent
1027
!
1029
IF
Exponent<128
THEN
!
exponent
is
positive
1031
Exponent=2^(Exponent-15)
!
offset
(-15)
1033
!
1035
ELSE
!
exponent
is
negative
1037
Exponent=2^(BINCMP(BINEOR(Exponent,255))-15)
!
reverse
[EOR],
1039
!
change
sign
[CMP]
and
offset
[-15]
for
negative
going
exponents
1041
END
IF
1043
!
1045
!
Calculate
real
and
imaginary
data
1047
Real=Form1_data(I,1)*Exponent
1049
Imag=Form1_data(I,0)*Exponent
1051
!
1053
!
Calculate
linear
magnitude
data
1055
Lin_mag=SQRT(Real^2+Imag^2)
1057
!
1059
!
Calculate
log
magnitude
data
1061
Log_mag=20*LGT(Lin_mag)
1063
!
1065
!
Calculate
phase
data
1067
DEG
1069
IF
Imag=0
AND
Real<0
THEN
1071
Phase=-180
1073
ELSE
1075
Phase=2*ATN(Imag/(Real+Lin_mag))
1077
END
IF
1079
!
1081
IF
I=1
OR
I=SIZE(Form1_data,1)
THEN
!
first
and
last
points
1083
"Pt";I;"
Real
=
";Real;"
Imag
=
";Imag
1085
"
Lin
=
";Lin_mag;"
Log
=
";Log_mag;"
Phase
=
";Phase
1087
1089
END
IF
1091
NEXT
I
1093
!
1095
REDIM
Form1_data(0:2,1:201)
1097
!
1099
1101
LOCAL
@Rec
1103
RETURN
1105
!
1107
Example9:
!
USING
DISC
******************************
1109
!
1111
1113
"Example
9,
Using
Disc"
1115
OUTPUT
@Rec;"USERPRES;
POIN51;"
1117
OUTPUT
@Rec;"CHAN1;
PARA1;
SING;
DATI;"
1119
OUTPUT
@Rec;"CHAN2;
PARA4;
DUAC;
SING;
CONT;"
18-44
HP-IB
Programming
Содержание 8530A
Страница 9: ......
Страница 31: ......
Страница 34: ...General Information Figure 1 2 Antenna Measurement Setup Using an HP 85310A GeneralInformation 1 3 ...
Страница 51: ......
Страница 65: ......
Страница 81: ......
Страница 83: ......
Страница 84: ...5 Menus Block Chapter Contents Calibration Domain Display Markers MenusBlock 5 1 ...
Страница 85: ...5 2 Menus Block ...
Страница 90: ...Calibration Requirements Figure 5 1 Cal and Cal Type Menus MenusBlock 5 7 ...
Страница 93: ...Antenna Calibration 5 10 MenusBlock ...
Страница 167: ......
Страница 195: ......
Страница 201: ......
Страница 209: ......
Страница 249: ......
Страница 281: ......
Страница 411: ......
Страница 419: ...Glossary Glossary 8 ...
Страница 439: ......