beautypg.com

17ć1, File search and file diagnostic instructions – Rockwell Automation 1772-LP3 PLC - 2/30 Programmable Controller Programming and Operations Manual User Manual

Page 293

background image

Chapter

17

17Ć1

File Search and File Diagnostic

Instructions

The File Search instruction locates all words in a file whose data is
identical to a specific input word’s data.

The File Diagnostic instruction can be used to locate discrepancies
between actual and desired states of I/O’s by searching for 1 in the result
file of an XOR operation (Section 16.1.3).

NOTE: This section assumes the reader has read Chapter 12, Data
Transfer File Instructions, and is familiar with the concepts introduced in
that chapter.

This output instruction consists of an input word, a data file to be searched,
and a counter (Figure 17.1). Upon false-true transition of rung decision, the
input word data is compared to the file data. When a match is found, the
position counter accumulated value indicates that word of the file. Upon
the next false-to-true transition, the instruction continues searching the rest
of the file. If another equality is found, the counter accumulated value
indicates current match word.

Figure 17.1

FILE SEARCH Operation

5612

500

003

064

Position

File Length

Input Word

The input word data has been found equal to data in word 402, the third in the

file. The counter accumulated value, 3, indicates this.

Counter

400

401

402

477

5612

File (64 words)

17.0
General

17.1
File Search