3.1 Basic Functionality
3.1.2 Registers
3-20
Note: n: decimal digit, h: hexadecimal digit
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.
X
Function
input
registers
XBnnnnnh,
XWnnnnn,
XLnnnnn,
XQnnnnn,
XFnnnnn,
XDnnnnn
These registers are used for inputs to functions.
•
Bit inputs: XB000000 to XB00000F
•
Integer inputs: XW00001 to XW00016
•
Double-length integers: XL00001 to XL00015
•
Quadruple-length integers: XQ00001 to XQ00013
•
Real numbers: XF00001 to XF00015
•
Double-precision real numbers: XD00001 to
XD00013
Function-
specific
Y
Function
output
registers
YBnnnnnh,
YWnnnnn,
YLnnnnn,
YQnnnnn,
YFnnnnn,
YDnnnnn
These registers are used for outputs from functions.
•
Bit outputs: YB000000 to YB00000F
•
Integer outputs: YW00001 to YW00016
•
Double-length integers: YL00001 to YL00015
•
Quadruple-length integers: YQ00001 to YQ00013
•
Real numbers: YF00001 to YF00015
•
Double-precision real numbers: YD00001 to
YD00013
Z
Function
internal
registers
ZBnnnnnh,
ZWnnnnn,
ZLnnnnn,
ZQnnnnn,
ZFnnnnn,
ZDnnnnn
These are internal registers that are unique within each
function. You can use them for internal processing in
functions.
•
Bits: ZB000000 to ZB00063F
•
Integers: ZW00000 to ZW00063
•
Double-length integers: ZL00000 to ZL00062
•
Quadruple-length integers: ZQ00000 to ZQ00060
•
Real numbers: ZF00000 to ZF00062
•
Double-precision real numbers: ZD00000 to
ZD00060
A
Function
external
registers
ABnnnnnh,
AWnnnnn,
ALnnnnn,
AQnnnnn,
AFnnnnn,
ADnnnnn
These are external registers that use the address input
value as the base address.
When the address input value of an M or D register is
provided by the source of the function call, then the
registers of the source of the function call can be
accessed from inside the function by using that
address as the base.
User functions can be called from any programs, any number of times.
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 previously set values 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.
Continued on next page.
Continued from previous page.
Type
Name
Designation
Method
Description
Features
Important