Function Block States

Logix-based controllers evaluate function block instructions based on the state of different conditions:
Condition
Description
prescan
Prescan for function block routines is the same as for ladder diagram 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.
Every function block instruction also included 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 simply skips normal algorithm execution.
  • EnableOut mirrors EnableIn. However, if Function Block detects an overflow condition, EnableOut is also cleared.
  • Function Block resumes from where it left off when EnableIn toggles from cleared to set. However, there are some function block instructions that specify special functionality (for example, 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 from where 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.
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.