![background image](http://html1.mh-extra.com/html/omron/sysmac-cx-programmer-9/sysmac-cx-programmer-9_operation-manual_744241059.webp)
33
Function Block Specifications
Section 2-1
Example
Note
1.
The same name cannot be assigned to an input variable and output vari-
able. If it is necessary to receive a value from an external variable, change
the variable inside the function block, and then return the result to the ex-
ternal variable, use an input-output variable.
2.
When the instance is executed, input values are passed from parameters
to input variables before the algorithm is processed. Consequently, values
cannot be read from parameters to input variables within the algorithm. If
it is necessary to read a value within the execution cycle of the algorithm,
do not pass the value from a parameter. Assign the value to an internal
variable and use an AT setting (specified addresses). Alternatively, refer-
ence the global symbol as external variables.
Initial Value
Initial values can be set for input variables, but the value of the input parame-
ter will be enabled (the input parameter value will be set when the parameter
for input variable EN goes ON and the instance is executed).
Note
The input parameter setting cannot be omitted when using the CX-
Programmer.
EN (Enable) Variable
When an input variable is created, the default input variable is the EN variable.
The instance will be executed when the parameter for input variable EN is ON.
■
Output Variables
Output variables pass return values from the instance to external applications.
The output variables are displayed on the right side of the instance.
After the instance is executed, the value of the output variable is passed to the
specified parameter.
P_On
1.0
FB
EN
ENO
PV CV
D0
D100
The value of the parameter specified as the input (value of D0)
is passed to the instance’s input variable (PV).
D1000
0.0
10.0
D200
ADD_INT_DINT
EN
ENO
IN16 OUT32
IN32
D100
tmp
DINT
EN
BOOL
IN16
INT
IN32
DINT
ENO
BOOL
OUT32
DINT
SIGN IN16 tmp
P_On
+L IN32 tmp OUT32
IN16 is an INT variable, so the content of D100 is used.
IN32 is a DINT variable, so the content of D200 and
D201 is used.
Algorithm (Body)
Variable table
Name
Internal
Input
Input
Input
Output
Output
Type
Usage
Summary of Contents for SYSMAC CX-Programmer 9
Page 2: ......
Page 4: ...iv ...
Page 6: ...vi ...
Page 8: ......
Page 16: ...xvi ...
Page 20: ...xx ...
Page 26: ...xxvi Application Precautions 4 ...
Page 27: ...Part 1 Function Blocks ...
Page 28: ......
Page 154: ...128 Procedures Section 3 2 ...
Page 155: ...Part 2 Structured Text ST ...
Page 156: ......
Page 160: ...134 CX Programmer Specifications Section 4 2 ...
Page 206: ...180 Procedures Section 6 1 ...
Page 208: ...182 System defined external variables supported in function blocks Appendix A ...
Page 230: ...204 Revision History ...
Page 231: ......