479
7
7 Motion Control 7.7 Format and Use of MC Subprograms
Motion
Control
Instruction
Parameter
1
Parameter
2
Parameter
3
Parameter
4
Parameter
5
Parameter
6
Parameter
7
Attribute
Motion
compensation
cancellation
CANC
Subprogram
call
MCALL P integer
Subprogram
return
MRET
X, Y, and Z indicate the positions of the x-axis, y-axis, and z-axis; R indicates the radius; F indicates the
feed speed; I, J, and K indicate the center relative to the current position. For example, "LIN XKK1000
YHH2000 FKK50000" indicates linear interpolation at a speed of 50,000 to move to the X position 1000
and Y position 0x2000 in hexadecimal.
P indicates the subprogram. For example, "MCALL P5" means calling the fth motion control subprogram.
In a motion control subprogram, the integer type uses the pulse unit. The oating-point number type uses
the mechanical unit. It is necessary to set relevant special registers and the pulse-to-mechanical ratio within
the maximum speed or stroke range; otherwise, an error is returned.
Towards the positioning or trajectory control, it supports the setting of acceleration/deceleration type/time,
maximum speed, base speed, and they must be set in the special elements..
Parameters for an axis not used during multi-axes action need not be entered. In such a way, the axis
resources are not occupied, and the axis can be used for positioning or electronic cam running.
The following table lists other additional instructions.
Function Application Instruction Instruction Format
Parameter
Count
Setting MSET MSET S1 1
Reset MRST MRST S1 1
Assignment MMOV MMOV S1 D1 2
Addition (integer/
oating point)
MADD MADD S1 S2 D1 3
Subtraction (integer/
oating point)
MSUB MSUB S1 S2 D1 3
Multiplication
(integer/oating
point)
MMUL MMUL S1 S2 D1 3
Division (integer/
oating point)
MDIV MDIV S1 S2 D1 3
• MSET and MRST support only the M and SM bit elements. Other application instructions support only the word
elements, but do not support bit elements in KnX form or address indexing.
• These instructions can only be used in MC subprograms.