Omron NJ-series User Manual page 205

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

Advertisement

6 Programming
 Local Variable Table
A local variable table defines the input variables, output variables, in-out variables, internal variables,
and external variables.
Refer to Variable Designations for Functions on page 6-19 for details.
 Parameters
Input Parameters to Input Variables
An input parameter passes a value to an input variable in a function when function execution begins.
An input parameter can be either a variable or a constant.
Output Parameters from Output Variables
An output parameter receives a value from an output variable in a function when function execution
is completed. A variable is given as the parameter.
In-Out Parameters Shared between In-Out Variables
The value of the in-out parameter changes within the function. The same variable is used for both
the input and output.
Expressing Functions in ST
The following example shows how to call functions from ST.
return_value:=function_name (input_variable_1:=input_parameter_1, ...
input_variable_N:=input_parameter_N,in-out_variable_1:=in-out_parameter_1, ... in-
out_variable_N:=in-out_parameter_N,output_variable_1=>output_parameter_1, ...
output_variable_N=>output_parameter_N);
However, you can also omit the return value.
You can also omit input variable names and other variable names, and give only the parameters. (If you
do, the parameters must be given in the order that they are given in the function definition.) Also, the
number of parameters must match the number of input variables and other variables in the function def-
inition.
Functions Expressed in ST:
EN
Para1
In1
Para2
In2
Para_MAX := MAX(In1:=Para1, In2:=Para2);
Para_MAX := MAX(Para1, Para2);
Refer to Function Calls on page 6-103 for details.
6-18
MAX
ENO
Para_MAX
Function name
(*The input variables are omitted here.*)
NJ-series CPU Unit Software User's Manual (W501)

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents