Functions And Function Blocks; Functions; Example: Creating A Function - Mitsubishi Electric FX Series Training Manual

Programmable logic controllers
Hide thumbs Also See for FX Series:
Table of Contents

Advertisement

Functions and Function Blocks

6
Functions and Function Blocks
Below is a table illustrating the comparison between 'Functions' and 'Function Blocks':
Item
Internal variable storage
Instancing
Outputs
Repeated execution with same input
values
b Functions are part of the instruction set.
b Functions are included in the standard and manufacturers libraries. i.e. TIMER_M is a
function, as is MOV_M, PLUS_M etc. from the Mitsubishi Instruction Set in the Manufactur-
ers Library.
b User defined functions can easily be created out of tested program parts.
This means that functions can be created i.e. for system/process calculations, and can be
stored in libraries and reused many times, with different variable declarations. This would
be in the same way that i.e. a MOV instruction would be used but with the advantage of be-
ing user specific.

Functions

6.1
Most control programs have some form of maths within them, i.e. for analogue signal condition-
ing, displaying engineering units etc. These are frequently reused within the program structure.
By using user defined functions, program design time can be dramatically reduced.
6.1.1

Example: Creating a Function

Objective:
Build a Function to change Fahrenheit to Centigrade.
Formula is:
Centigrade
The Function will be named "Centigrade" and the input variable will be named "Fahrenheit".
Training Manual GX IEC Developer
Function Block
Storage
Required
No output
One output
Multiple outputs
Does not always deliver the same
output value.
(
)
-
´
Fahrenheit
32
5
=
9
Functions
Function
No storage
Not required
One output
Always delivers the same output
value.
6 - 1

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents