
7 Operation
112
Version: 1.2.1
MS249E
C-863.12 Mercury Controller
Action
Command
Result
JON 1 0
▪
Deactivate joystick 1
DIO 0 0
▪
Switch all LEDs on the pushbutton box off
MAC END
Record the TESTDION
macro on the
controller.
MAC BEG testdion
The macro has the following tasks:
MEX VAR? 0 != 1
▪
Stop macro execution if the number of local
variables given when starting TESTDION is not 1
MEX DIO? $1 = 0
▪
Stop macro execution if the button specified via
local variable 1 on the pushbutton box is no
longer pressed (corresponding input line has the
low state)
DEL 300
▪
Wait 300 ms
JRC 3 DIO? $1 = 1
▪
If the button is still pressed, jump 3 lines forward
(to
DEL 400
)
MAC START MVAX2ST
$1
▪
Start the MVAX2ST macro because the button
was only briefly pressed. The value of the local
variable 1 is also used for local variable 1 in
MVAX2ST. MVAX2ST moves axis 1 to the position
assigned for the button.
MEX DIO? $1 = 0
▪
Stop macro execution if button is no longer
pressed
DEL 400
▪
Wait 400 ms
MEX DIO? $1 = 0
▪
Stop macro execution if button is no longer
pressed
DIO $1 1
▪
Switch the pushbutton box LED on that is
associated with the button pressed to indicate
storing of the current position
WAC DIO? $1 = 0
▪
The macro is executed further only if the button
is no longer pressed
DIO $1 0
▪
Switch LED off
CPY STORE$1 POS? 1
▪
Save the current position of axis 1 in the global
variable designated via local variable 1
MAC END
Record the MVAX2ST
macro on the
controller.
MAC BEG MVAX2ST
The macro has the following tasks:
CPY 2 VAR? STORE$1
▪
Get the storage variable designated via local
variable 1 and copies its value to local variable 2
MOV 1 $2
▪
Start motion of axis 1 to the target position
specified via local variable 2