Counter instructions, Programming techniques – Rockwell Automation 1747-BSN Backup Scanner Module User Manual
Page 161

Publication 1747-UM010B-EN-P - September 2003
Programming Techniques 9-19
Counter Instructions
Counter instructions are similar in structure to timer instructions.
However, when a switchover occurs, a counter that occurs once in a
program could increment or decrement twice in one program scan.
This problem arises when the following sequence of events occur:
1. The primary system executes a counter up/down instruction
conditioned by a rung transition of not-true to true. This
increments/decrements the counter accumulated value.
2. The 1747-BSN modules transfer this data into the counter file of
the backup processor before the secondary’s input image table
is updated with the input transition information.
3. The backup processor updates its input image table.
4. The processor in the secondary system (which was at a different
point in its program scan) executes the counter instruction
again, thus incrementing/decrementing the counter again.
Programming Techniques
As with the timer instruction, your program should transfer the
counter accumulated value from the primary to the secondary
processor at least once after you:
•
start the backup system
•
switch the secondary SLC 500 from PROGRAM to RUN mode
•
restart a repaired system
This allows the accumulated value in the secondary processor to track
the accumulated value in the primary processor.
Diagnostic, Sequencing, File Copy and Fill Instructions
The type of data you are transferring, as well as how you transfer the
data to the secondary processor, determines the behavior of the
following file instructions:
•
File Copy (COP)
•
File Fill (FLL)
•
Diagnostic (FBC and DDT)