
6.6 Function and Function Block
Functions and function blocks can be invoked from programs. Functions and function blocks
can be created with POU objects.
The differences between functions and function blocks are as below.
■
Function (FUN)
● Functions can be used without being declared in the declaration section.
● Only one output is generated. However, additional outputs can be defined.
● Output variable and internal variable values are not saved.
■
Function block (FB)
● Function blocks can be used by declaring instances in the declaration section.
● Multiple outputs can be generated.
● Output variable and internal variable values are saved.
● Object-oriented definitions can be made by using EXTENDS (inheritance), IMPLEMENTS
(interface implementation), or access qualifiers.
6.6.1 Function
A function generates one output in response to one or more inputs. Functions can be used
without declaring variables.
For example, use the following procedure to create and invoke function "ADD_SUB", which
uses three INT type arguments as inputs, calculates (first argument) + (second argument) -
(third argument), and output the result.
1.
Right-click the [Application] object in the navigator pane and then select
Add Object
>
POU
from the context-sensitive menu that is displayed.
The "Add POU" dialog box will be displayed.
6.6 Function and Function Block
6-32
WUME-GM1RTXOP-01
Содержание GM1 Series
Страница 1: ...Motion Controller GM1 Controller RTEX User s Manual Operation WUME GM1RTXOP 01 2021 2 ...
Страница 2: ... MEMO 2 WUME GM1RTXOP 01 ...
Страница 6: ... MEMO vi WUME GM1RTXOP 01 ...
Страница 16: ... MEMO xvi WUME GM1RTXOP 01 ...
Страница 20: ...1 3 Software License Agreement 1 3 Software License Agreement 1 4 WUME GM1RTXOP 01 ...
Страница 21: ...1 3 Software License Agreement WUME GM1RTXOP 01 1 5 ...
Страница 22: ...1 3 Software License Agreement 1 6 WUME GM1RTXOP 01 ...
Страница 23: ...2 Operation Flow 2 1 System Configuration Diagram 2 2 2 2 Work Flowchart 2 4 WUME GM1RTXOP 01 2 1 ...
Страница 28: ... MEMO 2 6 WUME GM1RTXOP 01 ...
Страница 66: ... MEMO 3 38 WUME GM1RTXOP 01 ...
Страница 76: ...4 6 Project Configuration 4 6 Project Configuration 4 10 WUME GM1RTXOP 01 ...
Страница 83: ...The Modbus COM object will be added to the navigator pane 4 7 Adding an Object WUME GM1RTXOP 01 4 17 ...
Страница 102: ... MEMO 4 36 WUME GM1RTXOP 01 ...
Страница 184: ...Example Single line and multiple line comments 7 2 Programming in Structured Text ST 7 18 WUME GM1RTXOP 01 ...
Страница 231: ...The POU object of the program will be added to the task 7 9 Tasks WUME GM1RTXOP 01 7 65 ...
Страница 240: ...8 2 Connecting the GM1 Controller and PC 8 4 WUME GM1RTXOP 01 ...
Страница 261: ...3 Select the check boxes of the items to be checked 4 Click the OK button 8 8 Login Logout WUME GM1RTXOP 01 8 25 ...
Страница 270: ... MEMO 8 34 WUME GM1RTXOP 01 ...
Страница 287: ...9 4 Monitoring Function WUME GM1RTXOP 01 9 17 ...
Страница 299: ...9 7 Device Trace Function WUME GM1RTXOP 01 9 29 ...
Страница 300: ...9 7 Device Trace Function 9 30 WUME GM1RTXOP 01 ...
Страница 314: ... MEMO 9 44 WUME GM1RTXOP 01 ...
Страница 362: ... MEMO 10 48 WUME GM1RTXOP 01 ...
Страница 372: ...When Modulo is selected 11 1 RTEX Axis Setting 11 10 WUME GM1RTXOP 01 ...
Страница 394: ...11 3 Single axis Operation 11 32 WUME GM1RTXOP 01 ...
Страница 397: ...ST program 11 3 Single axis Operation WUME GM1RTXOP 01 11 35 ...
Страница 399: ...ST program 11 3 Single axis Operation WUME GM1RTXOP 01 11 37 ...
Страница 407: ...11 4 Synchronous Operation WUME GM1RTXOP 01 11 45 ...
Страница 418: ... Preinterpolation tab 11 5 Multi axis Operation 11 56 WUME GM1RTXOP 01 ...
Страница 419: ... Table editor tab 11 5 Multi axis Operation WUME GM1RTXOP 01 11 57 ...
Страница 421: ... Common tab Build tab 11 5 Multi axis Operation WUME GM1RTXOP 01 11 59 ...
Страница 422: ... Access Control tab 11 5 Multi axis Operation 11 60 WUME GM1RTXOP 01 ...
Страница 424: ...This window is used to configure initial settings for CNC operation 11 5 Multi axis Operation 11 62 WUME GM1RTXOP 01 ...
Страница 462: ... MEMO 11 100 WUME GM1RTXOP 01 ...
Страница 479: ...ST program 12 5 PWM Output WUME GM1RTXOP 01 12 17 ...
Страница 526: ... MEMO 12 64 WUME GM1RTXOP 01 ...
Страница 534: ...Declaration section common to ST and LD programming languages 13 2 General purpose Communication 13 8 WUME GM1RTXOP 01 ...
Страница 535: ...Implementation section ST programming language 13 2 General purpose Communication WUME GM1RTXOP 01 13 9 ...
Страница 536: ...Implementation section LD programming language 13 2 General purpose Communication 13 10 WUME GM1RTXOP 01 ...
Страница 539: ...Implementation section ST programming language 13 2 General purpose Communication WUME GM1RTXOP 01 13 13 ...
Страница 540: ...Implementation section LD programming language 13 2 General purpose Communication 13 14 WUME GM1RTXOP 01 ...
Страница 543: ...Declaration section common to ST and LD programming languages 13 2 General purpose Communication WUME GM1RTXOP 01 13 17 ...
Страница 544: ...Implementation section ST programming language 13 2 General purpose Communication 13 18 WUME GM1RTXOP 01 ...
Страница 545: ...Implementation section LD programming language 13 2 General purpose Communication WUME GM1RTXOP 01 13 19 ...
Страница 548: ...Implementation section ST programming language 13 2 General purpose Communication 13 22 WUME GM1RTXOP 01 ...
Страница 549: ...Implementation section LD programming language 13 2 General purpose Communication WUME GM1RTXOP 01 13 23 ...
Страница 586: ...Declaration section common to ST and LD programming languages 14 1 SD Card Access 14 4 WUME GM1RTXOP 01 ...
Страница 587: ...Implementation section ST programming language 14 1 SD Card Access WUME GM1RTXOP 01 14 5 ...
Страница 588: ...Implementation section LD programming language 14 1 SD Card Access 14 6 WUME GM1RTXOP 01 ...
Страница 591: ...Implementation section LD programming language 14 1 SD Card Access WUME GM1RTXOP 01 14 9 ...
Страница 598: ... MEMO 14 16 WUME GM1RTXOP 01 ...
Страница 646: ... MEMO App 4 WUME GM1RTXOP 01 ...
Страница 648: ... MEMO WUME GM1RTXOP 01 ...
Страница 649: ... MEMO WUME GM1RTXOP 01 ...
Страница 650: ...Panasonic Corporation 2021 February 2021 WUME GM1RTXOP 01 ...