Specifications
Applications Ver. 0002 AP - 23
; -- EXAMPLE OF A PLC PROGRAM FOR A GEAR CHANGE AT THE MAIN SPINDLE --
;
; Information on resources in use:
;
; I41 = Detector for first gear (M41)
; I42 = Detector for second gear (M42)
; I79 = “Drive OK” Spindle Drive
;
; O141 = Electric valve to activate the first gear (M41)
; O142 = Electric valve to activate the second gear (M42)
;
; M41 = Decoding of "M41" from CNC: Change to first gear
; M42 = Decoding of "M42" from CNC: Change to second gear
;
; With parameter PLC P28 (R700) = 3.33172, we define the SERCOS identifier Fagor Diagnostics,
; because in this case, at the spindle, SERCOSID = 3
; B10R700 = SV3. This bit is activated when the spindle speed is lower than the minimum "N" (SP40).
;
CY1
;
END
;
PRG
REA
;
;---------- DRIVE STATUS ---------
;
DRSTAFS = B1R104
DRSTASS = B0R104 ; Reading of the spindle drive running status.
;
CPS R104 GE 1 = M104 ; Spindle drive OK
;
M104 ;Drive OK (by software)
AND I79 ;Drive OK (by hardware)
= M200 ;Drive OK.
;
CPS R104 GE 2 = M114 ; Spindle drive under power
;
I1 AND M200 = /EMERGEN ; Emergency to the CNC
/EMERGEN AND /ALARM = O1 ;Emergency contact to the electrical cabinet
;
;---------- GEAR CHANGE ---------
;
M2047 = AND R700 $0F R45 ;Read variable GV25 «ActualGearRatio»
;
B9R700 = TG2 30 200 ; Confirmation delay N=0
B10R700 = TG2 31 200 ; Confirmation delay N=Nmin
T30 = M155 ; N=0
T31 = M156 ; N=Nmin
I41 AND NOT I42 = TG2 41 200 ;Confirmation delay for 1st gear
I42 AND NOT I41 = TG2 42 200 ;Confirmation delay for 2nd gear
;
T41 = GEAR1 ;Confirmation of 1st gear at the machine
T42 = GEAR2 ;Confirmation of 2nd gear at the machine
;
M114 AND M41
AND NOT GEAR1
= SET M141 ;Request for change into first gear
;
M114 AND M42
AND NOT GEAR2
= SET M142 ;Request for change into second gear
;
M141 OR M142 = M150 ;Spindle gear change in progress
= TG2 10 5000