7.1 User Program Types and Execution Timing
7.1.5 Registers
7
Cr
eating U
s
er Pr
ogram
s
7-31
Precautions When Using Local Registers within a User Function
When you call a user function, consider what values could be in the local registers, and perform
initialization as needed.
•
Setting the
D Register Clear When Start
Option
1.
Select
File
−
Environment Setting
from the menu bar of the MPE720 Window.
2.
Select
Setup
−
System Setting
.
3.
Select
Enable
or
Disable
for the
D Register Clear when Start
Box.
Disable: The initial values will be uncertain.
Enable: The initial values will be 0.
Name
Precautions
X registers (function
input registers)
If input values are not set, the values will be uncertain.
Do not use X registers that are outside of the range that is specified in the input defi-
nitions.
Y registers (function
output registers)
If output values are not set, the values will be uncertain.
Always set the values of the range of Y registers that is specified in the output defini-
tions.
Z registers (function
internal registers)
When the function is called, the previous settings will be lost and the values will be
uncertain.
These registers are not appropriate for instructions if the previous value must be
retained.
Use them only after initializing them within the function.
# registers
These are constant registers. Their values cannot be changed.
D registers
When the function is called, the previous settings are preserved.
If a previous value is not necessary, initialize the value, or use a Z register instead.
D registers retain the data until the power is turned OFF.
The default value after restart depends on the setting of the
D Register Clear when
Start
option. Refer to the following section for details.