This program * shows a customer implementation of speed change sequence.
ISO PROGR. EXAMPLE
IF M42 is „on“ (request of second gear step from CNC side) THEN
Attempt=0
Spindle stop command
IF spindle is stopped THEN
WHILE number of attempt <= 4 THEN
Spindle oscillation command
Gear shift forward command
IF M41 switch =1 more than 2 sec THEN
Attempt=9
Gear shift stop command
Spindle stop oscillation command
ELSE
IF M42 switch = 0 more than 2 sec THEN
Gear shift stop command
Wait for 0.3 sec(optional but recommended)
Gear shift reverse command
IF M41 switch = 1 THEN
Gear shift stop command
Wait for 0.3 sec(optional but recommended)
Attempt=Attempt+1
ENDIF
ELSE
IF M42 switch=1 THEN
Gear shift stop command oscillation
Attempt=10
ENDIF
ENDIF
ENDIF
ENDWHILE
ENDIF
ENDIF
IF M42 request is „on“ THEN
IF Attempt = 9 THEN
Error „Gear shift doesn’t move “
ENDIF
IF Attempt = 5 THEN
Error „ Too many attempts “
ENDIF
ENDIF