
Trusted
TM
Process Control Algorithms T8019
Issue 8 Sep 07 PD-T8019 9
1.2. BCD Translation
BCD
OUT
IP0
I
P1
IP2
IP3
M
N
The BCD translation function requires the 4-bit BCD value represented as 4 Boolean parameters (IP0,
IP1, IP2, and IP3), IP0 being the least significant bit, IP3 the most significant bit. All four inputs must
be defined; inputs not required for specific application must be set to FALSE. M and N are of type
integer.
M specifies the value multiplier and must be a power of 10, i.e. 1, 10, 100, etc. N allows the BCD
functions to be cascade, by adding the value from a previous function. A value of -1 is assumed to be
the result of an up-stream conversion error and will result in all chained BCD functions generating
values of -1. The returned value OUT is an integer.
NMIP3IP2,IP1,IP0,BCDOUT +×=
Invalid BCD number (see table below) are to result in OUT = -1.
IP3
IP2
IP1
IP0
OUT
(with M=1 and N=0)
0 0 0 0 0
0 0 0 1 1
0 0 1 0 2
0 0 1 1 3
0 1 0 0 4
0 1 0 1 5
0 1 1 0 6
0 1 1 1 7
1 0 0 0 8
1 0 0 1 9
1 0 1 0 -1
1 0 1 1 -1
1 1 0 0 -1
1 1 0 1 -1
1 1 1 0 -1
1 1 1 1 -1
Table 2 BCD Translation
Multiple values (M) that are not powers of 10 are to result in a value of -1. If an overflow condition
occurs, the function is to return a value of -1 and increment the “Overflow”, error counter.
Commenti su questo manuale