HP VXI 75000 C Series User's And Scpi Programming Manual page 386

Algorithmic closed loop controller
Table of Contents

Advertisement

1750
1760
1770
1780
1790
1800
1810
1820 END IF
1830 Loopend1:NEXT Ii
1840
FOR Ii=0 TO 64 STEP 1
1850 Input(Ii)=Center-((Tbl_range/64.0)*Ii)
1860 Result(Ii)=FNMy_function(Input(Ii))
1870 IF Ii=0 THEN GOTO Loopend2! This is the first point
1880
1890
1900 Jj=Ii-1
1910 T=ABS(Result(Ii-1))
1920
!
1930
! compute the exponent of the offset (B is 31 bits)
1940 IF T<>0. THEN
1950
1960 ELSE
1970
1980 END IF
1990 !
2000 ! compute slope in bits (each table entry represents 512 bits)
2010 Slope=(Result(Ii)-Result(Ii-1))/512.0
2020 !
2030 ! don't take the log of a negative slope
2040 Absslope=ABS(Slope)
2050 !
2060 ! compute the exponent of the slope (M is 16 bits)
2070 IF Absslope<>0. THEN
2080
2090 ELSE
2100
2110 END IF
2120
2130 IF Exponent2<Exponent THEN Exponent=Exponent2
2140 Xfactor=INT(Exponent) !convert to integer
2150 IF T<>0. THEN
2160
2170
2180 END IF
2190 Mfactor=PROUND(2^Xfactor*Slope,0)
2200 IF Mfactor=32768.0 THEN
2210
2220
2230
2240 END IF
2250 IF (Mfactor<=32767.0 AND Mfactor>=-32768.0) THEN
2260
2270
2280
2290
2300
2310
2320
386 Generating User Defined Functions
Ex(Jj)=Xofst-Xfactor
M(Jj)=Mfactor
! remove leading 1's
B=PROUND(2^Xfactor*Result(Ii-1),0)
Bhigh(Jj)=INT(B/65536.0)
Bl=B-(Bhigh(Jj)*65536.0)
IF Bl>32767 THEN Bl=Bl-65536
Blow(Jj)=Bl
!
! for second and subsequent points
! generate numbers for prev segment
! using abs value of prev seg base
Exponent=31.0-(LGT(T)/LGT(2.0)) ! take log base 2
Exponent=100.0
Exponent2=15.0-(LGT(Absslope)/LGT(2.0))
Exponent2=100.0
! Choose the smallest exponent -- maximize resolution
Ltemp=PROUND(LGT(T)/LGT(2.0),0)
IF (Xfactor+Ltemp)>30 THEN Xfactor=30-Ltemp
! There is an endpoint problem. Re-compute if on endpoint
Xfactor=Xfactor-1
Mfactor=PROUND(2^Xfactor*Slope,0)
! only save if M is in limits
Ex(Jj)=Xofst-Xfactor
M(Jj)=Mfactor
! remove leading 1's
B=PROUND(2^Xfactor*Result(Ii-1),0)
Bhigh(Jj)=INT(B/65536.0)
Bl=B-(Bhigh(Jj)*65536.0)
IF Bl>32767 THEN Bl=Bl-65536
! truncates
! don't take log of zero
! truncates
Appendix F

Advertisement

Table of Contents
loading

This manual is also suitable for:

Vxi e1415a

Table of Contents