Omron NJ-series User Manual page 208

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

Advertisement

 Return Values
• Return values are blank in ladder diagrams.
Case
Using return values
Not using a return
value
• The calling instruction is not required to use the return value in either a ladder diagram or ST.
• If you set the return value within a function algorithm, set the value to a variable with the same
name as the function.
For example, the return value of a function called MyFUN is MyFUN.
EN
Variable i
IN
Execution Conditions for Functions
A function is executed when EN is TRUE. The function stops processing when EN changes to FALSE.
Input variables
EN = TRUE
EN = FALSE
Inside a master
control region
NJ-series CPU Unit Software User's Manual (W501)
Ladder diagram notation
EN
Variable i
IN
EN
Variable i1
In1
Variable i2
In2
MyFUN
ENO
Variable q
Algorithm in FUN
Executed.
Normal end
Error end
Not executed.
Not executed.
MyFUN1
ENO
Variable q
MyFUN2
Variable q1
OutEQ
OutGT
OutGE
Variable q4
OutNE
OutLT
OutLE
Definition of MyFUN
IF IN>100
MyFUN:=100;
ELSE
MyFUN:=IN;
END_IF;
ENO
Operations other than ENO
TRUE
Output parameters: Values are updated according to
the internal algorithm.
In-out parameters: Values are updated according to
the internal algorithm.
FALSE
Output parameters: Values are retained.
In-out parameters: Values are updated according to
the internal algorithm.
FALSE
Output parameters and in-out parameters: Values
are retained.
FALSE
Output parameters and in-out parameters: Values
are retained.
6 Programming
ST language notation
variable_q:=
MyFUN1(variable_i);
MyFUN2(In1:=variable_i1,In2:=v
ariable_i2,
OutEQ=>variable_q1,
OutNE=>variable_q4 );
6
6-21

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents