Use concise programming, Execute an instruction only when needed, Figure 44 - precondition used with add instruction – Rockwell Automation 1756-RMxx ControlLogix Enhanced Redundancy System User Manual User Manual

Page 157

Advertising
background image

Rockwell Automation Publication 1756-UM535D-EN-P - November 2012

157

Program the Redundant Controller

Chapter 7

Use Concise Programming

Use these recommendations to create concise programming. Using concise

programming makes your program execute faster and reduces your program scan

time.

Execute an Instruction Only when Needed

We recommend that you execute instructions only when needed because each

time an instruction writes a value to a tag, the tag is crossloaded to the secondary

controller. Even if the tag values is the same, it is rewritten and is therefore

crossloaded.

Because many instructions write tag values whenever executed, strategic and

economical use of instructions is needed. Strategic programming techniques

include the following:

Using preconditions to limit the execution of instructions
Combining preconditions when possible
Dividing programming into subroutines that are called only when required
Running noncritical code every 2 or 3 scans instead of during every scan

For example, precondition an ADD instruction to run only when the controller

gets new data. As a result, the Dest_Tag is crossloaded only when the ADD

instruction produces a new value.

Figure 44 - Precondition Used with ADD Instruction

Advertising