EasyManua.ls Logo

YASKAWA MP3000 Series - Page 178

YASKAWA MP3000 Series
326 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
4.1 User Program Types and Execution Timing
4.1.5 Registers
4-45
4
Creating User Programs
Local Registers within a User Function
In addition to # registers and D registers, there are local registers that can be used only within
individual user functions.
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.
Typ e Name Designation Methods Description
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
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.
A
Function exter-
nal 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 pro-
vided 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.
D registers
When the function is called, the previously set values 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 startup depends on the setting of the D Register Clear when
Start option. Refer to the following section for details.
Setting the D Register Clear When Start Option (page 4-46)
Important

Table of Contents

Other manuals for YASKAWA MP3000 Series

Related product manuals