Justifying data – Rockwell Automation 1771-DA,D17716.5.13 U MNL 1771-DA ASCII I/O MODULE User Manual

Page 81

Advertising
background image

ASCII I/O Module Tutorial

Chapter 4

4Ć7

Initialization Error

If the characters were not displayed when you entered them
(ALLEN-BRADLEY 12), and the display of transferred data contained
only the code X4XX in status word one, you have an initialization error.
(X is any value.) Repeat the procedure in section titled “Setting Bits in
initialization Words” (P. 3-4), exactly as shown setting IWl (00-01)=10 in
binary or 2 in hex. A setting of IW1 (00-01)=11 in binary or 3 in hex will
not work in this example.

The module justifies data before it transfers this data to the processor data
table. The module left justifies data by placing the first character in the
upper byte of the first word address of the file. The module right justifies
data by placing the last character in the lower byte of the last word of the
file.

You can tell the difference between the storage of left and right justified
data by looking at the first and last words. In left justified data, spaces or
fill characters, if needed, are added to the last file word. In right justified
data, space or fill characters, if needed, are added to the first file word.

If the number of characters transferred is less than the string length that
you set in IW2(00-13), the module completes the string by inserting fill
characters or spaces. Fill characters or spaces are stored ahead of the data
(lower addresses) for right justified data, or following the data (higher
addresses) for left justified data.

Demonstrating Margin Justification Storage

In this demonstration, you compare data table storage of right justified
data with left justified data. When the module operates in data mode,
margins are right justified (default) unless you select left justified. The
demonstration in the section titled “Changing the Module’s String Length
(Read, Only)” showed data table storage of right justified data
(Table 3.B). In this demonstration, you set the margin justification bit
IW3(03) for left justification, repeat the procedures in “Changing the
Module’s String Length (Read, Only)” (P. 3-5) and compare the two
displays.

1. Set IW3(03) for left justification using the procedure in section titled

“Setting Bits in Initialization Words”

Justifying Data

Advertising