Function (Fun) - Mitsubishi Electric MELSEC iQ-F FX5 Programming Manual

Program design
Hide thumbs Also See for MELSEC iQ-F FX5:
Table of Contents

Advertisement

3.1

Function (FUN)

Functions are a type of POU used by program blocks, function blocks, or other functions.
The function sends back a value to the call source after execution. The value is called return values.
The function always outputs the same return value as the processing result in response to the same input.
The function can be re-used effectively by defining a simple, independent, and frequently used algorithm.
Function
Input variable and output variable
For a function, input variables and output variables can be defined. Output variable can be created to output data separate
from the return value.
Case of ladder diagram
For classes for which input variables or output variables can be set, refer to the following.
Page 23 Class
Variables defined in a function are overwritten every time the function is called.
To retain the variable values at each call, use a function block or design a program so that an output variable
is saved in a different variable.
3 PROGRAM ORGANIZATION UNIT (POU)
12
3.1 Function (FUN)
Function block
or function
FUN
Case of FBD/LD language
(1)
(2)
(3)
Program block
FUN
Program block
FB or FUN
(1) Function name
(1)
(2) Input variables
(2)
(3) Output variables
(3)

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents