Chapter 5: Intelligent Box (IBox) Instructions
BCD to Real with Implied Decimal Point (BCDTOR) (IB-560)
1
BCD to Real with Implied Decimal Point converts the given 4-digit WORD BCD value to a
Real number, with the implied number of decimal points (K0-K4).
230
2
For example, BCDTOR K1234 with an
240
implied number of decimal points equal to
250-1
K1, would yield R123.4
3
260
BCDTOR Parameters
4
DS5 Used
• Value (WORD BCD): specifies the word or
N/A
HPP
constant that will be converted to a Real
5
number
• Number of Decimal Points: specifies the
6
number of implied decimal points in the Result DWORD
• Result (DWORD REAL): specifies the location where the Real number will be placed
7
Value (WORD BCD) . . . . . . . . . . . . . . . . . . V,P,K
8
Number of Decimal Points . . . . . . . . . . . . . . . K
Result (DWORD REAL) . . . . . . . . . . . . . . . . . . . V
9
BCDTOR Example
In the following example, the BCDTOR instruction is used to convert the 16-bit data in
10
V2000 from a 4-digit BCD data format to a 32-bit REAL (floating point) data format and
store into V3000 and V3001 when C100 turns on.
11
K2 in the Number of Decimal Points implies the data will have two digits to the right of the
decimal point.
12
13
14
A
B
C
D
5–256
DL205 User Manual, 4th Edition, Rev. B
Parameter
DL205 Range
K0-9999; See DL205 V-memory map - Data Words
K0-4
See DL205 V-memory map - Data Words
Need help?
Do you have a question about the DirectLOGIC DL205 Series and is the answer not in the manual?