EasyManua.ls Logo

Automationdirect.com DL06 - Page 425

Automationdirect.com DL06
533 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
DL06 Micro PLC User Manual, 3rd Edition, Rev. E
5-264
Chapter 5: Standard RLL Instructions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
A
B
C
D
Real to Double BCD with Implied Decimal Point and Rounding (RTOBCDD)
(IB-563)
For example, RTOBCDD R38156.74 with an implied number of decimal points equal to K1,
would yield 381567 BCD. If the implied number of decimal points was 0, then the function
would yield 38157 BCD (note that it rounded up).
If the Real number is negative, the Result will equal its positive, absolute value.
RTOBCDD Parameters
• Value (DWORD Real): specifies the Dword Real number that will be converted and rounded to a
BCD number with decimal points
• Number of Decimal Points: specifies the number of implied decimal points in the Result DWORD
• Result (DWORD BCD): specifies the location where the rounded/implied decimal points DWORD
BCD value will be placed
RTOBCDD Example
In the following example, the RTOBCDD instruction is used to convert the 32-bit REAL
(floating point) data format in V3000 and V3001 to the 8-digit BCD data format and stored
in V2000 and V2001 when C100 turns on.
K2 in the Number of Decimal Points implies the data will have two implied decimal points.
Parameter DL06 Range
Value (DWORD Real) V,P,R R ; See DL06 V-memory map - Data Words
Number of Decimal Points K K0-8
Result (DWORD BCD) V See DL06 V-memory map - Data Words
DS Used
HPP
N/A
Real to Double BCD with Implied Decimal
Point and Rounding converts the absolute
value of the given Real number to an 8 digit
DWORD BCD number, compensating for an
implied number of decimal points (K0-K8) and
performs rounding.