3 PROGRAM ORGANIZATION UNIT (POU)
3.2 Function Block (FB)
21
3
EN/ENO
The following table lists the number of steps required for EN/ENO.
The number of steps may increase or decrease, depending on the following conditions.
• The actual argument or return value of the function block are index-modified.
• The address specifying the device exceeds 16 bits in length.
• Nibble specification is performed.
■Program
The number of steps required for a function block program is the total number of instruction steps, like normal programs.
For the number of steps required for each instruction, refer to the following.
Programming manual (Instructions, Standard Functions/Function Blocks)
Precautions
■Global pointer/pointer type global labels
Global pointer and pointer type global labels cannot be used as labels indicating program steps in the function block program.
■When an index register is used
When an index register is used in the function block program, ladder programs for saving and returning the index register
values are required to protect the values.
Setting the index register data to 0 after saving can prevent an error that could be caused by an index modification validity
check. (Whether the device number exceeds the device range or not is checked.)
A program that saves the values in the index registers Z1 and Z2 before the program execution and returns the saved values
after the program execution
Item Number of steps
EN 6
ENO 4
SM400
Z1MOV index_reg_tmp1
Z2
MOV
index_reg_tmp2
K0MOV Z1
K0MOV Z2
SM400
Z1MOV index_reg_tmp1
Z2
MOV
index_reg_tmp2
Before the program execution,
save the index register values in
index_reg_tmp.
Set 0 to the index register areas.
After the program execution, return the
values saved in index_reg_tmp to the
index register.
Program execution
Save the index register values.
Clear the index register values.
Return the register values.