Formatting a single line, 4ć46 – Rockwell Automation 1771-DA,D17716.5.13 U MNL 1771-DA ASCII I/O MODULE User Manual

Page 120

Advertising
background image

ASCII I/O Module Tutorial

Chapter 4

4Ć46

Notice the following:

BCD values are right justified between delimiters in the hex display.
One more storage word was used to store the 15 character string

because of the justification of BCD values.

The data string was left justified in file storage.
The industrial terminal cannot correctly display BCD values in an

ASCII display.

When your program transfers BCD values, be sure you know how the
data will be justified in the storage file. Justification of BCD values can
require extra storage words.

When formatting a message, you store the message text, and you write
program logic to insert variables into your message. Consider the
message PRODUCED (quantity) PARTS. The message text is
PRODUCED....PARTS. The variable that you want to communicate is
the quantity. The variable can be timer or counter accumulated values,
analog I/O values, or any other data table word, byte, or bit that changes
value.

You will use file MVF O6:0 to store your message. The quantity in your
message will be the BCD accumulated value of a free running timer. You
will move the accumulated value into your message storage file, and store
it in the storage word located between two BCD delimiters.

Format the message PRODUCED (quantity) PARTS as follows:

1.

In this demonstration you will increase the string length to 21
characters, the length of your message. Otherwise, use the same
initialization data as before.

Four initialization words using IW1(00-01)
Report generation mode using IW1(02-04)
String length of 21 characters using IW2(00-13)
4 BCD digits per word data conversion using IW2(14-16)
Slash symbol (/) as BCD delimiter using IW4(10-16)

Set the bits in all four initialization words using the procedure in section
titled “Setting Bits in Initialization Words”, P. 3-30.

Display The initialization word file is displayed in hex as follows:

Formatting a SingleĆLine

Message

Advertising