Galil Motion Control DMC-21 5 Series User Manual page 126

Table of Contents

Advertisement

ST
A;
AM
A;
SH
A;
RE;
Limit Switch Routine
The DMC-21x5 provides forward and reverse limit switches which inhibit motion in the respective direction. There
is also a special label for automatic execution of a limit switch subroutine. The
the limit switch subroutine. This label causes the statements following to be automatically executed if any limit
switch is activated and that axis motor is moving in that direction. The
The state of the forward and reverse limit switches may also be evaluated with the
operand contains the state of the reverse limit and
The
command can be used to configure the polarity of the limit switches.
CN
#main;
WT
20;
JP
#main; EN;
#LIMSWI;
ST
A;
AM
A;
JP
#lf,(_LFA=0);
JP
#lr,(_LRA=0);
#lf;
MG
"A Axis Forward
PR -1000;BG A;AM
JP
#end;
#lr;
MG
"A Axis Reverse
PR 1000;BG A;AM
#end;
RE;
Chapter 8 Hardware & Software Protection ▫ 121
'stop motion
'wait for motion to finish
'servo motor to clear error
'return to main program
'label for main program
'jump back to main label
'start of limit switch routine
'stop motion, wait for motion to finish
'jump to #LF if forward limit
'jump to #LR if reverse limit
'forward limit label
Limit";
'send message
A;
'move off limit in reverse direction
'jump to end label
'reverse limit label
Limit";
'send message
A;
'move off limit in forward direction
'end label
'return to main program
command ends the subroutine.
RE
operand contains the state of the forward limit for the.
_LFm
label specifies the start of
#LIMSWI
command. The
JP
_LRm
DMC-21x5 User Manual 1.0a1

Advertisement

Table of Contents
loading

Table of Contents