Functions
Functions have an output parameter and one or more input parameters.
Instruction block format
An instruction block is represented by a single rectangle and has a fixed number of input and output connection points. An elementary instruction block performs a single function.
Instruction block example

Item | Name | Description |
---|---|---|
![]() | Block name | The name of the function to be performed by the instruction block is written inside its rectangle shape (at the top). |
![]() | Input | Each input of an instruction block is labeled and has a defined type. |
![]() | Output | Each output of an instruction block is labeled and has a defined type. |
![]() | Input connection | Inputs are connected on the left border. |
![]() | Output connection | Outputs are connected on the right border. |
![]() | Output value | Output values are displayed when the controller is online. It is "??" when the controller is offline and there is no default value. |
Calling a function
FactoryTalk Design Workbench
does not support recursive function calls. When a function of the Functions section is called by itself or one of its called functions, a run-time error occurs. Functions do not store the local values of their local variables. Because functions are not instantiated, they cannot call function blocks.- A function can be called by a program, a function, or a function block.
- Any program of any section can call one or more functions. A function can have local variables.
- A function has no instance, which means that local data is not stored and is typically lost from one call to the other.
- Because the execution of a function is driven by its parent program, the execution of the parent program is suspended until the function ends.
Calling function diagram

Defining function and parameter names
The interface of a function must be explicitly defined with a type and a unique name for each of its calling (input) parameters or return (output) parameters. A function has one return parameter. The value of a return parameter for a function block is different for each programming language (structured text, ladder diagram, or function block diagram languages).
Function names and function parameter names can contain up to 128 characters. Function parameter names can begin with a letter or an underscore, followed by letters, numbers, and single underscore characters.
Provide Feedback