4–13Scanner Configuration and Programming
Publication
17476.6 - July 1996
Rung
2:0
To decrease program scan time, copy the first four words of the M1 File
to a binary file and use these addresses throughout the program to access
block transfer done, error, data, etc. information without interrupting
the program scan many times.
| +COP––––––––––––––––+ |
|–––––––––––––––––––––––––––––––––––––––––––––––––+COPY FILE +–| |
| |Source #M1:1.100| |
| |Dest #B3:0| |
| |Length 4| |
| +–––––––––––––––––––+ |
Rung 2:1
Examine B3/13 (B3:0/13), an internal storage bit, to determine when a
block transfer is done. Note that examining multiple individual M–file
bits directly (every scan) can measurably increase processor scan time.
| ”BT DONE” |
| B3 +COP––––––––––––––––+ |
|––––] [––––––––––––––––––––––––––––––––––––––––––+COPY FILE +–| |
| 13 |Source #B3:10| |
| |Dest #N10:0| |
| |Length 64| |
| +–––––––––––––––––––+ |
|
Rung 2:2
Examine B3/12 (an internal storage bit) to determine if a BT error
occurred. Buffer the BT status from B3:3 if an error does occur.
| ”BT ERROR” |
| |
| B3 +MOV––––––––––––––––+ |
|––––] [––––––––––––––––––––––––––––––––––––––––––+MOVE +–|
| 12 |Source B3:3| |
| | 0000000000000000| |
| |Dest N10:64| |
| | 0| |
| +–––––––––––––––––––+ |
Rung 2:3
| |
|–––––––––––––––––––––––––––––––––––––+END+–––––––––––––––––––––––––––––|
| |
Important: If you are using an SLC 5/02 processor M file data
cannot be directly monitored. To monitor M files, you
must move the M file words into an SLC file that can be
monitored, e.g., an integer “N” file. SLC 5/03 or later
processors (running APS 4.02 or later) allow you to
monitor M files directly. However, do not address M
file bits more than necessary throughout your
application program. The processor accesses M files
like immediate I/O. Therefore, excessive addressing of
M files can greatly increase SLC processor scan time.
For more information on M files, refer to appendix B.