6
Functions and Function Blocks
Below is a table illustrating the comparison between ‘Functions’ and ‘Function Blocks’:
쎲
Functions are part of the instruction set.
쎲
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.
쎲
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.
6.1
Functions
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
Fahrenheit
=
-
´
32
5
9
The Function will be named “Centigrade” and the input variable will be named “Fahrenheit”.
Functions and Function Blocks
Functions
Training Manual GX IEC Developer
6 - 1
Item
Function Block
Function
Internal variable storage
Storage
No storage
Instancing
Required
Not required
Outputs
앥
No output
앥
One output
앥
Multiple outputs
One output
Repeated execution with same input
values
Does not always deliver the same
output value.
Always delivers the same output
value.
Содержание FX2N-32CAN
Страница 1: ...MITSUBISHI ELECTRIC FACTORY AUTOMATION Programmable Logic Controllers GX IEC Developer ...
Страница 2: ......
Страница 4: ......
Страница 6: ......
Страница 10: ...IV MITSUBISHI ELECTRIC ...
Страница 18: ...Modular PLC Training Hardware Course Overview and Requirements 1 2 MITSUBISHI ELECTRIC ...
Страница 172: ...Monitoring Instances of Function Blocks Advanced Monitoring Functions 7 12 MITSUBISHI ELECTRIC ...
Страница 176: ...Device Edit 8 4 MITSUBISHI ELECTRIC ...
Страница 190: ...Assigning DUT Variables to Function Blocks Data Unit Types DUT 10 10 MITSUBISHI ELECTRIC ...
Страница 198: ...Array Example Single Dimension Array Arrays 11 8 MITSUBISHI ELECTRIC ...
Страница 219: ...Sequential Function Chart SFC SFC Elements Training Manual GX IEC Developer 14 3 ...
Страница 220: ...14 3 SFC configuration examples SFC configuration examples Sequential Function Chart SFC 14 4 MITSUBISHI ELECTRIC ...
Страница 230: ...Structured Text Program Example IEC Structured Text 16 4 MITSUBISHI ELECTRIC ...
Страница 248: ...Configuring GX IEC Developer to access the PLC on Ethernet Ethernet Communications 18 10 MITSUBISHI ELECTRIC ...
Страница 278: ...PLC Components Glossary Appendix A 18 MITSUBISHI ELECTRIC ...
Страница 283: ......