ASCII I/O Module Tutorial
Chapter 4
414
Whenever the module encounters the ASCII character that you defined in
IW4(10-16) as the fill character to be removed, the module removes it
from the string. Then the module transfers only data, justifies the data,
and adds its own fill character. The number of fill characters that it adds
is equal to the number of those it removed. (The fill character that the
module inserts is described in section titled “Your ASCII Module Inserts
Fill Characters”), P. 2-22. If your ASCII device uses fill characters for
positioning data, you may choose not to remove them because the position
has meaning.
In this demonstration you will select a fill character that the module will
remove, and observe its operation.
1. Increase the number of initialization words to four by setting
appropriate bits. Set IW1=0003. Use the procedure in section titled
“Setting Bits in Initialization Words”, P. 3-4
2. Select the slash symbol (/) as the fill character to be removed. The
ASCII / is 2F in hex. Set IW4=2F00.
Display The file-to-file move instruction displays your settings as
follows:
FILE DATA
POSITION
Hex Binary
001
002
003
004
0003 00000000 00000011
0015 00000000 00010101
0D00 00001101 00000000
2F00 00101111 00000000
3. Enter: //AS//23//AS//4[RETURN]
Refer to procedures in section titled “Reading Data from Your ASCII
Device” if necessary.
Procedure P1 Set your industrial terminal to alphanumeric mode
Procedure P2 Enter your data
Procedure P3 Set your industrial terminal to PLC2 mode
Procedure P4 Observe how data is stored in the data table
Results The module transferred the data characters, extracted the fill
character, added its own fill character, and right justified the data
(Table 3.H).
Removing the Fill Character
StockCheck.com