beautypg.com

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

Page 87

background image

ASCII I/O Module Tutorial

Chapter 4

4Ć13

Table 3.G

Transfer of Balance of String

POSITION

FILE DATA

ASCII Equivalent

001

002

003

004

005

006

007

008

009

010

E011

0000

2020

2020

3637

3839

3041

4243

4445

4647

6 7

8 9

0 A

B C

D E

F G

Your program must include instructions for processing new data read
from the module. If not, data in your read block transfer file will be
written over in the next read block transfer.

You can do this by examining whether status word two (SW2) contains
data, using a greater-than instruction. When the value in SW2 is greater
than zero (new data flag), move new read block transfer data to an
alternate storage file. Your program can process it before it is overwritten
by the next transfer of new data (Figure 3.3). Make the address of the
source file of the file-to-file move instruction (file A) the same address as
the read block transfer file. Also examine the BTR done bit.

Figure 3.3

Example Programming, New Data Flag

Bit

17

BLOCK XFER READ

DATA ADDR:

MODULE ADDR:

BLOCK LENGTH:

FILE:

030

111

16

252 - 271

EN

011

17

DN

111

17

Bit

FILE TO FILE MOVE

COUNTER ADDR:

POSITION:

FILE LENGTH:

FILE A:

FILE R:

RATE PER SCAN:

035

001

16

254 - 271

16

EN

035

17

DN

035

15

035

00

SW2>0

253

<

BT Done

Storage

Bit

327

G

000

Storage

111