40 Rockwell Automation Publication 1756-RM003N-EN-P - October 2011
Preface
Function Block States
The controller evaluates function block instructions based on the state of
different conditions.
Every function block instruction also includes EnableIn and EnableOut
parameters:
· Function block instructions execute normally when EnableIn is set.
· When EnableIn is cleared, the function block instruction either executes
prescan logic, postscan logic, or just skips normal algorithm execution.
· EnableOut mirrors EnableIn, however, if function block execution detects
an overflow condition EnableOut is also cleared.
· Function block execution resumes where it left off when EnableIn toggles
from cleared to set. However, there are some function block instructions
that specify special functionality, such as re-initialization, when EnableIn
toggles from cleared to set. For function block instructions with time base
parameters, whenever the timing mode is Oversample, the instruction
always resumes were it left off when EnableIn toggles from cleared to set.
If the EnableIn parameter is not wired, the instruction always executes as normal
and EnableIn remains set. If you clear EnableIn, it changes to set the next time the
instruction executes.
When programming in function block, restrict the range of
engineering units to +/-10
+/-15
because internal floating point
calculations are done by using single precision floating point.
Engineering units outside of this range may result in a loss of
accuracy if results approach the limitations of single precision
floating point (+/-10
+/-38
).
Possible Condition Description
Prescan Prescan for function block routines is the same as for relay ladder routines. The only difference is that the Enablein
parameter for each function block instruction is cleared during prescan.
Instruction first scan Instruction first scan refers to the first time an instruction is executed after prescan. The controller uses instruction first
scan to read current inputs and determine the appropriate state to be in.
Instruction first run Instruction first run refers to the first time the instruction executes with a new instance of a data structure. The
controller uses instruction first run to generate coefficients and other data stores that do not change for a function block
after initial download.