Omron NJ-series User Manual page 288

Machine automation controller cpu unit software
Hide thumbs Also See for NJ-series:
Table of Contents

Advertisement

Reserved Words: None
Statement Structure:
Give the argument specifications (to pass the values of the specified variables to the input variables
of the called function block) and the return value specification (to specify the variable that will receive
the value of the output variable of the called function block) in parenthesis after the instance name of
the function block. There are two methods of writing this statement, as shown in (1) and (2) below.
We recommend method 1 for program readability.
Notation Method 1:
Give both the variable names of the called function block and the parameter names of the calling POU.
ABC(A:=x1, B:=x2, C=>y1);
ABC: Function block instance name
A and B: Input or in-out variable names of called function block
x1 and x2: Input or in-out parameter of calling POU (can be a constant)
C: Output variable of called function block
y1: Output parameter of calling POU
• Ladder Diagram Expression
x1
x2
• You can give the arguments and return values in any order.
• You can omit the input variable names and input parameter names. If you omit these names, the
values assigned to the input variables for the previous call are assigned to the input variables
again. If this is the first time that the function block is called, the input variables are set to their ini-
tial values.
• You can omit the output variables and output parameters. If they are omitted, the value of the out-
put variable is not assigned to anything.
Notation Method 2:
Omit the variable names of the called function block and give the parameter names of the calling
POU.
ABC(x1, x2, y1);
ABC: Function block instance name
A and B: Omitted. (Input or in-out variable of called function block)
x1 and x2: Input or in-out parameter of calling POU (can be a constant)
C: Omitted. (Output variable of called function block or constant)
y1: Output parameter of calling POU
• Ladder Diagram Expression
x1
x2
• The order of parameters is based on the function block definition. The order is the same as the
local variable definition for the function block, from top to bottom.
Application:
This statement calls a function block.
NJ-series CPU Unit Software User's Manual (W501)
ABC
y1
MyFB
A
C
B
ABC
y1
MyFB
A
C
B
6 Programming
6
6-101

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents