Defining operation in different scan modes, Execution considerations for add-on instructions, Optimizing performance – Rockwell Automation Logix5000 Controllers Add-on Instructions Programming Manual User Manual
Page 49
Defining Add-On Instructions
Chapter 2
3. Edit your logic by using the available language editors.
Execution considerations for Add-On Instructions
An Add-On Instruction is executed just like any other routine belonging to a
particular program. Because another task can preempt a program containing an
Add-On Instruction that is being executed, an Add-On Instruction may be
interrupted prior to completing its execution.
In standard programs, you can use the User Interrupt Disable/Enable (UID/UIE)
instructions to block a task switch if you want to be sure the Add-On Instruction
executes uninterrupted before switching to another task.
Tip:
UID and UIE instructions are not supported in the safety task of GuardLogix projects.
Optimizing performance
The performance depends on the structuring, configuration, and the amount of
code in an Add-On Instruction. You can pass large amounts of data through a
structure by using an InOut parameter. The size of data referenced by an InOut
parameter does not impact scan time and there is no difference between passing a
user-defined type tag or an atomic tag because it is passed by reference.
When a rung condition is false, any calls to an Add-On Instruction are still
processed even though the logic routine is not executed. The scan time can be
affected when many instances of an Add-On Instruction are executed false. Be sure
to provide instructions in your documentation if an Add-On Instruction can be
skipped when the rung condition is false.
To provide Add-On Instructions with the same flexibility as built-in instructions,
optional Scan mode routines can be configured to fully define the behavior of the
instruction. Scan mode routines do not initially exist for Add-On Instructions.
You can create them depending upon the requirements of your instruction.
Like all built-in instructions in the controller, Add-On Instructions support the
following four controller Scan modes.
Scan Mode
Description
True
The instruction is scanned as the result of a true rung condition or the EnableIn parameter is set True.
False
The instruction is scanned as the result of a false rung condition or the EnableIn parameter is set
False. Instructions in the controller may or may not have logic that executes only when that
instruction is scanned false.
Defining operation in
different scan modes
Rock well Automati on Publication 1756- PM010F-EN-P - Oct ober 2014
49