Comments, 6ć11, Count = 0 ; initialize counter – Rockwell Automation 1775-KA PLC-3 Communication Adapter Module User Manual User Manual
Page 89
Message Procedure Commands
Chapter 6
6Ć11
FROM_BCD Function
The FROM_BCD function converts its parameter from
binary–coded–decimal format to binary format. The resulting value is 32
bits long. For example, the FROM_BCD function in Figure 6.2 converts
the contents of decimal word 12 from binary coded decimal to a regular
decimal value of 27. From the above example (section titled TO_BCD
Function), the FROM_BCD function stores the following bit pattern in
user symbol COUNT:
0000 0000 0000 0000 0000 0000 0001 1011
As you can see from these examples, TO_BCD and FROM_BCD perform
opposite functions.
You can add your own explanatory comments to any command line in a
message procedure. To do this, enter a semicolon (;) after the command.
Then enter your comment after the semicolon. Figure 6.3 illustrates the
format for comments.
Figure 6.3
Format for Comments
COUNT = 0 ; INITIALIZE COUNTER
<
<
Comment
Comment Delimiter
Command
10029–I
Anything that appears between a semicolon and the end of the command
line is considered to be a comment. Comments may be any length. The
end of the command line, and therefore the end of your comment, is
delimited by the carriage– return and line–feed pair of characters.
A comment can be the only thing on a line. Do not use comments on the
same line as label. Doing so will cause errors in the message procedure.
Comments