7.3 Example of Calculation
Following example program converts the hexa data in WR0 to BCD 4 digit data in WM006. If the temperature is
negative, R0 will be "1".
(1)WR0 is extended to double word data because the calculation with sign can be operated by double word.
(2)(3)Since the calculation with radix point is impossible, DM0 is multiplied by 100 and divided by 4096.
(4) If the temperature is negative, R0 will be "1".
(5)WM2 is converted to the absolute value WM4.
(6)WM4 is converted to BCD 4 digits value.
7. Collection of Temperate Data
EXT (DM000,WR0000)
DM000 = DM000 S* 100
DM002 = DM000 S/ 4096
R0
= DM002 S< 0
ABS (WM004,WM002)
BCD (WM006,WM004)
(1)
(2)
(3)
(4)
(5)
(6)
7-4