EasyManua.ls Logo

Omron NJ Series

Omron NJ Series
668 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
6-21
6 Programming
NJ-series CPU Unit Software User’s Manual (W501)
6-2 POUs (Program Organization Units)
6
6-2-6 Details on Functions
Return Values
Return values are blank in ladder diagrams.
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.
A function is executed when EN is TRUE. The function stops processing when EN changes to FALSE.
Case Ladder diagram notation ST language notation
Using return values variable_q:=
MyFUN1(variable_i);
Not using a return
value
MyFUN2(In1:=variable_i1,In2:=v
ariable_i2,
OutEQ=>variable_q1,
OutNE=>variable_q4 );
Execution Conditions for Functions
Input variables Algorithm in FUN ENO Operations other than ENO
EN = TRUE Executed. Normal end TRUE Output parameters: Values are updated according to
the internal algorithm.
In-out parameters: Values are updated according to
the internal algorithm.
Error end FALSE Output parameters: Values are retained.
In-out parameters: Values are updated according to
the internal algorithm.
EN = FALSE Not executed. FALSE Output parameters and in-out parameters: Values
are retained.
Inside a master
control region
Not executed. FALSE Output parameters and in-out parameters: Values
are retained.
Variable
q
MyFUN1
EN ENO
IN
Variable i
Variable q1
Variable q
4
Variable i1
Variable i2
MyFUN2
EN
In1
In2 OutEQ
OutGT
OutGE
OutNE
OutLT
OutLE
Variable q
MyFUN
EN ENO
IN
Variable i
Definition of MyFUN
IF IN>100
MyFUN:=100;
MyFUN:=IN;
ELSE
END_IF;

Table of Contents

Other manuals for Omron NJ Series

Related product manuals