Rockwell Automation 1775-KA PLC-3 Communication Adapter Module User Manual User Manual
Page 88

Message Procedure Commands
Chapter 6
6Ć10
There are two functions:
TO_BCD
FROM_BCD
Figure 6.2 illustrates the format of these functions as they might appear in
an assignment command.
Figure 6.2
Examples of TO-BCD and FROM-BCD Functions
$D:12 = TO_BCD (27)
COUNT = FROM_BCD ($D:12)
<
<
<
Function Parameter
Function
Assignment Command
Destination of
Resulting Value
10028–I
The parameter of the function must be enclosed in parentheses. The
parameter may be any one of the following:
A direct numeric value (either decimal or octal)
An expression
A user symbol
A logical address
A symbolic address
TO_BCD Function
The TO_BCD function converts its parameter into a binary coded decimal
value that is 32 bits long. For example, the TO_BCD function in
Figure 6.2 stores the number 27 in binary–coded–decimal format in word
12 of the decimal section of PLC–3 memory. After this function is
executed, word 12 will contain the following bit pattern:
0000 0000 0010 0111