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

Algorithmic closed loop controller
Table of Contents

Advertisement

580
OUTPUT @E1415;"alg:def 'alg1','static float y,radians=0;y=sin(radians);'"
590
OUTPUT @E1415;"form ascii;:trig:timer .001;:init"
600
RAD ! use radians
610
GOSUB Err_check
620
FOR Radians=-PI/2 TO PI/2 STEP PI/10
630
OUTPUT @E1415;"alg:scal 'alg1','radians',";Radians;";upd"
640
OUTPUT @E1415;"alg:scal? 'alg1','y'"
650
ENTER @E1415;Y
660
PRINT USING This;"'RMB' sin(radians): ";SIN(Radians);" 'E1415A' sin(Radians): ";Y
670 This:IMAGE K,SD.DDDD,K,SD.DDDD
680
NEXT Radians
690
STOP
700 End_: !
710
PRINT "HPIB TIMEOUT"
720
STOP
730 Err_check:REPEAT
740
750
760
770
780
790
UNTIL Error=0
800
RETURN
810
END
820 ! ############################################################## 830 !
840 ! Subprogram Build_eu_table
850 ! TASK: Generates tables of mx+b values for downloading to E1415 DSP
860 !
870 !
Generate the three coefficients for the EU algorithm:
880 !
890 !
900 !
910 !
920 ! INPUT PARAMETERS:
930 !
940 !
950 !
960 ! OUTPUT PARAMETERS
970 !
980 !
990 !
1000 !
1010 !
1020 Build_eu_table:SUB Build_table(REAL Min_input,Max_input,Table_range,Table_offset,INTEGER
Coef_array(*))
1030
1040
1050
1060
1070
1080
1090
1100
1110
1120
1130
1140
1150
1160
384 Generating User Defined Functions
! Check for any errors
OUTPUT @E1415;"SYST:ERR?"
ENTER @E1415;Error,String$
IF Error THEN
OUTPUT @Err;"Error returned: "&VAL$(Error)&". "&String$
END IF
a. The "exponent" value
b. The "slope" or "M" value
c. The "intercept" or "B" value.
REAL Min_input
- lowest expected value
REAL Max_input
- largest expected value
zero generates piecewise table
REAL Table_range
- returned table range
REAL Table_offset
- how much to adjust X for shifted function
INTEGER Coef_array
(512 values)
INTEGER M(128),Ex(128),Bhigh(128),Blow(128),Xofst,Shift,Ii,Jj
INTEGER Xfactor,Ltemp
REAL Input(129),Result(129),Test_range,T,Exponent,Exponent2
REAL Slope,Absslope,Mfactor,B,Bl
!
! Calculate the mid point of the range.
!
Center=Min_input+(Max_input-Min_input)/2
Table_offset=Center
Temp_range=Max_input-Center
Test_range=ABS(Temp_range)
!
! Now calculate the closest binary representation of the test_range
!
- returned coeficient array:
Appendix F

Advertisement

Table of Contents
loading

This manual is also suitable for:

Vxi e1415a

Table of Contents