S.B.C. Elettronica S.p.A. - Engineering Division
HPDxxN – High Power User’s Manual
70
Example 14: reading 4-digit preselector (BCD Thumbwheels)
(FILE: E005.HPD)
To change the value of parameter Pr82 by means of a 4-digit preselector. This procedure
involves the use of four digital outputs and four digital inputs:
terminal 12 on X2 = output for selection of first preselector digit (least significant)
terminal 13 on X2 = output for selection of second preselector digit
terminal 14 on X2 = output for selection of third preselector digit
terminal 15 on X2 = output for selection of fourth preselector digit
terminals 12...15 on X3 = inputs for reading digit in BCD (terminal 12 is least significant bit;
connection diagram shown on next page).
Copy bit 0 BCD digit
copy bit 1 BCD digit
copy bit 2 BCD digit
copy bit 3 BCD digit
if first digit
calculate units
if second digit
calculate first decimal place
if third digit
calculate second decimal place
if fourth digit
calculate third decimal place
add calculation result to auxiliary
parameter Pr81
if last digit (most significant)
copy final value in Pr83
zero set parameter Pr82
refresh outputs to enable reading of
next digit
if last digit already acquired, start
scanning digits starting from units
program end
MUL
90.1
91.4
91.1
80 73 81
913
90.2
91.2
END
90.4
91.1
91.2
91.3
91.4
99.13
91.4
90.3
80.2
80.0
80.1
80.3
MUL
80 75 81
MUL
80 76 81
MUL
80 77 81
ADD
81 82 82
ADD
82 72 83
SUB
82 82 82
91.3
91.4
91.2
91.3
91.1
91.2
LD
90.1
OUT
80.0
LD
90.2
OUT
80.1
LD
90.3
OUT
80.2
LD
90.4
OUT
80.3
LD
91.1
MUL
80.73.81
LD
91.2
MUL
80.75.81
LD
91.3
MUL
80.76.81
LD
91.4
MUL
80.77.81
LD
99.13
ADD
81.82.82
LD
91.4
ADD
82.72.83
SUB
82.82.82
LD
91.3
OUT
91.4
LD
91.2
OUT
91.3
LD
91.1
OUT
91.2
LDN
91.2
LDN
91.3
LDN
91.4
OUT
91.1
END