Yaskawa LEGEND-MC User Manual

Page 347

Advertising
background image

337

LEGEND-MC User’s Manual

The following is the #LIMSWI special label for handling situations where limit switches ar hit during
motion. This label automatically executes if an axis is in motion and a limit switch in the direction of
motion is hit, or a software limit is exceeded. Without this special label, if a limit switch is hit during
motion, such as a position absolute move, the motor will decelerate to a stop with NO ERROR. if an AM
command is used, it will be cleared. The example as shown does not recover from the limit switch error,
but a recovery method that woks well is the use of a status flag variable. For example if the machine was
in a manual jog operation, a variable could be used to indicate that it was in jog mode (JOGMODE=1).
The first line in the #LIMSWI could jump to #PROBLEM if JOGMODE <>1, otherwise return from the
error. The two commented lines below demonstrate this. (The JOGMODE variable can be set to “1” in
the jog routine and set back to “0” at the end of the jog routine.)

Instruction

Limit= “+”

Axis=”X”; JS #HARD,_LFX=0; JS#SOFT,_FLX<_TPX

Axis=”Y”; JS #HARD,_LFY=0; JS#SOFT,_FLY<_TPY

Limit=“-”

Axis=“X”; JS#HARD,_LRX=0; JS#SOFT, _BLX>_TPX

Axis=“Y”; JS#HARD,_LRY=0; JS#SOFT, _BLY>_TPY

(JP#PROBLEM,JOGMODE=0;REI)

(#PROBLEM)

AB1; HX1; HX2; HX3

ZS

MG “PROGRAM HALTED! (LIMSWI)”

EN

#HARD;MG Limit {S}, “,Axis,“HARDWARE LIMIT HIT!”;EN

#SOFT;MG Limit {S}, “,Axis,“SOFTWARE LIMIT HIT!”;EN

Advertising