Call Functions or Function Blocks
When finalized, you can drag-and-drop UDFBs from the library in the (Project) node to a program just like any other function block. A new instance is automatically created.
Figure 5-98: Create an Instance of UDFB in a Program
-
-
- A single data type parameter defined as IN is passed by the calling program to the UDFB"User Defined Function Block"
UDFB can be used as a sub-function block in another program of the application. It is described using FBD, LD, ST or IL language. Input / output parameters of a UDFB (as well as private variables) are declared in the variable editor as local variables of the UDFB and the body UDFB cannot change its value
- A single data type parameter defined as OUT is set in the body UDFB and always actuated in the calling program after the call
- A parameter which is an array or a structure is always declared as IN (visible on the left of the block). Both the calling program and the body of the UDFB can read and write such a parameter
- A single data type parameter defined as IN is passed by the calling program to the UDFB"User Defined Function Block"
UDFB can be used as a sub-function block in another program of the application. It is described using FBD, LD, ST or IL language. Input / output parameters of a UDFB (as well as private variables) are declared in the variable editor as local variables of the UDFB and the body UDFB cannot change its value
See also: