Hi all
I got the subprogram file for this warmup routine from system data of machine .
;****************************************************************************
; Spindle Warm-Up Cycle for VMCT
;
; MODEL : NEW DNM Series
; AUTHOR : Namseok Kwon
; COMPANY: Doosan Machine Tools
; VERSION: xxxxxxxxxxxxxxxxxxxxxxxxx
; CHANGE : xxxxxxxxxxxxxxxxxxxxxxxxx
;
;****************************************************************************
PROC WARMUP_SP SAVE SBLOF DISPLOF
DEF INT L_SpMaxVelo
DEF INT L_Step0_Time,L_Step1_Time,L_Step2_Time,L_Step3_Time,L_Step4_Time
;---------------------------------------------------------------------------
; Interface Variable (PLC --> NC)
; $A_DBW[620] bit0 : WarmUp Case 1, t < 9HR
; $A_DBW[620] bit1 : WarmUp Case 2, 9HR< t < 72HR
; $A_DBW[620] bit2 : WarmUp Case 3, 72HR < t < 7Days with Lub.
; $A_DBW[620] bit3 : WarmUp Case 4, 7Days < t with Lub.
; $A_DBW[620] bit4 : WarmUp Case 5, 72HR < t < 7Days without Lub.
; $A_DBW[620] bit5 : WarmUp Case 6, 7Days < t without Lub.
; $A_DBW[620] bit6 : WarmUp Case 7, 7Days < t without Lub.(Warm up keep in not uses.)_2016.10.17
; $A_DBW[2012] : Spindle WarmUp Remain Minute_03 170704
; $A_DBW[2012] : Spindle Lubrication Status=0_Lubricating,1_Done_03 170704
;
; Interface Variable (NC --> PLC)
; $A_DBW[14] bit0 : Warm-Up Finish_From Macro
; $A_DBW[14] bit1 : Warm-Up Running_From Macro
; $A_DBW[14] bit2 : Update Sp. Stop Counter
;
;---------------------------------------------------------------------------
; Initialization of Variables
L_SpMaxVelo = $MA_SPIND_VELO_LIMIT[AX4] ; Read Spindle max. speeds
$A_DBW[14] = 1 ; Interface variable to PLC
IF (($P_ISTEST==1)OR($P_SIM==1)) GOTOF SIM_PROG ; If Program Test or Simulation, Jump to SIM_PROG
; If Spindle Warm-Up Case 6, Jump WARM_32MIN
IF $A_DBB[620] B_AND 'B00100000' GOTOF WARM_32MIN ; Warm-up condition change_170630
; If Spindle Warm-Up Case 4, Jump WARM_42MIN
IF $A_DBB[620] B_AND 'B00001000' GOTOF WARM_42MIN ; Warm-up condition change_170630
; If SPindle Warm-Up Case 5, Jump WARM_10MIN
IF $A_DBB[620] B_AND 'B00010000' GOTOF WARM_10MIN ; Warm-up condition change_160721
; If SPindle Warm-Up Case 3, Jump WARM_15MIN
IF $A_DBB[620] B_AND 'B00000100' GOTOF WARM_15MIN ; Warm-up condition change_170630
; If SPindle Warm-Up Case 2, Jump WARM_2MIN
IF $A_DBB[620] B_AND 'B00000010' GOTOF WARM_2MIN ; Warm-up condition change_160721
; If SPindle Warm-Up Case 7, Jump WARM_2MIN
IF $A_DBB[620] B_AND 'B01000000' GOTOF WARM_2LPMIN ; Warm-up condition change_1601014
; If SPindle Warm-Up No-case, Jump ERR
GOTOF ERR
;---------------------------------------------------------------------------
; Spindle warm up CASE-2 (2min) ; Warm-up condition change_160721
; 1. Spindle rotate 10% speed of Max. (1min)
; 2. Spindle rotate 30% speed of Max. (1min)
;
; Total 2 min
WARM_2MIN:
L_Step0_Time=-1 ; N/A (Spindle Lub.)
L_Step1_Time=-1 ; N/A (10 RPM)
L_Step2_Time=1 ; First Step for warming up Spindle (1 minute,10%)
L_Step3_Time=0 ; Second Step for warming up Spindle (1 minute,30%)
L_Step4_Time=-1 ; N/A (50%)
GOTOF WM_START
;---------------------------------------------------------------------------
; Spindle warm up CASE-7 (2min)
; 1. Spindle rotate 10rpm speed (2min)
; Total 2 min
WARM_2LPMIN:
L_Step0_Time=-1 ; N/A (Spindle Lub.)
L_Step1_Time=0 ; First Step for warming up Spindle (2min, 10 RPM)
L_Step2_Time=-1 ; N/A (10%)
L_Step3_Time=-1 ; N/A (30%)
L_Step4_Time=-1 ; N/A (50%)
GOTOF WM_START
;---------------------------------------------------------------------------
; Spindle warm up CASE-5 (10min)
; 1. Spindle rotate 10% speed of Max. (4min)
; 2. Spindle rotate 30% speed of Max. (3min)
; 3. Spindle rotate 50% speed of Max. (3min)
; Total 10 min
WARM_10MIN:
L_Step0_Time=-1 ; N/A (Spindle Lub.)
L_Step1_Time=-1 ; N/A (10 RPM)
L_Step2_Time=6 ; First Step for warming up Spindle (4 minute)
L_Step3_Time=3 ; Second Step for warming up Spindle (3 minute)
L_Step4_Time=0 ; Third Step for warming up Spindle (3 minute)
GOTOF WM_START
;---------------------------------------------------------------------------
; Spindle warm up CASE-3 (15min)
; 0. Spindle Lubrication (5min)
; 1. Spindle rotate 10% speed of Max. (4min)
; 2. Spindle rotate 30% speed of Max. (3min)
; 3. Spindle rotate 50% speed of Max. (3min)
; Total 10 min
WARM_15MIN:
L_Step0_Time=10 ; Spindle Lubrication time (5 minute)
L_Step1_Time=-1 ; N/A (10 RPM)
L_Step2_Time=6 ; First Step for warming up Spindle (4 minute)
L_Step3_Time=3 ; Second Step for warming up Spindle (3 minute)
L_Step4_Time=0 ; Third Step for warming up Spindle (3 minute)
GOTOF WM_START
;---------------------------------------------------------------------------
; Spindle warm up CASE-6 (32min)
; 1. Spindle rotate 10rpm speed (2min)
; 2. Spindle rotate 10% speed of Max. (10min)
; 3. Spindle rotate 30% speed of Max. (10min)
; 4. Spindle rotate 50% speed of Max. (10min)
; Total 32 min
WARM_32MIN:
L_Step0_Time=-1 ; N/A (Spindle Lub.)
L_Step1_Time=30 ; First Step for warming up Spindle (2 minute)_Add. 2016.10.17
L_Step2_Time=20 ; Second Step for warming up Spindle (10 minute)
L_Step3_Time=10 ; Third Step for warming up Spindle (10 minute)
L_Step4_Time=0 ; Fourth Step for warming up Spindle (10 minute)
GOTOF WM_START
;---------------------------------------------------------------------------
; Spindle warm up CASE-4 (42min)
; 0. Spindle Lubrication (10min)
; 1. Spindle rotate 10rpm speed (2min)
; 2. Spindle rotate 10% speed of Max. (10min)
; 3. Spindle rotate 30% speed of Max. (10min)
; 4. Spindle rotate 50% speed of Max. (10min)
; Total 32 min
WARM_42MIN:
L_Step0_Time=32 ; Spindle Lubrication time (10 minute)
L_Step1_Time=30 ; First Step for warming up Spindle (2 minute)_Add. 2016.10.17
L_Step2_Time=20 ; Second Step for warming up Spindle (10 minute)
L_Step3_Time=10 ; Third Step for warming up Spindle (10 minute)
L_Step4_Time=0 ; Fourth Step for warming up Spindle (10 minute)
WM_START:
$A_DBW[14] = $A_DBW[14] B_OR 'B00000010' ; Warm-Up Start (To PLC)
MSG("The spindle starts to warm up. Wait few minutes.")
M102 ; Add. A02
;---------------------------------------------------------------------------
; WARM-UP STEP 0
; SPINDLE LUBRICATION
STEP_0:
IF (($A_DBW[2012]==1) OR (L_Step0_Time<=-1)) GOTOF STEP_1 ; Jump to Step1, If Spindle Lubrication Completed.
G4F0.1
GOTOB STEP_0
;---------------------------------------------------------------------------
; WARM-UP STEP 1
; SPINDLE 10 RPM ROTATION
STEP_1:
IF (($A_DBW[2004]<=L_Step1_Time) OR (L_Step1_Time<=-1)) GOTOF STEP_2 ; Next Step.
M3S10
G4F0.1
GOTOB STEP_1
;---------------------------------------------------------------------------
; WARM-UP STEP 2
; SPINDLE MAX * 10% RPM ROTATION
STEP_2:
IF (($A_DBW[2004]<=L_Step2_Time) OR (L_Step2_Time<=-1)) GOTOF STEP_3 ; Next Step.
M3S = L_SpMaxVelo * 0.1
G4F0.1
GOTOB STEP_2
;---------------------------------------------------------------------------
; WARM-UP STEP 3
; SPINDLE MAX * 30% RPM ROTATION
STEP_3:
IF (($A_DBW[2004]<=L_Step3_Time) OR (L_Step3_Time<=-1)) GOTOF STEP_4 ; Next Step.
M3S = L_SpMaxVelo * 0.3
G4F0.1
GOTOB STEP_3
;---------------------------------------------------------------------------
; WARM-UP STEP 4
; SPINDLE MAX * 50% RPM ROTATION
STEP_4:
IF (($A_DBW[2004]<=L_Step4_Time) OR (L_Step4_Time<=-1)) GOTOF STEP_DONE ; Next Step.
;MSG("SPINDLE WARMUP : Spindle Max * 30% RPM.")
M3S = L_SpMaxVelo * 0.5
G4F0.1
GOTOB STEP_4
M0
;---------------------------------------------------------------------------
; WARM-UP STEP DONE
; SPINDLE WARMING UP COMPLETED
STEP_DONE:
$A_DBW[14] = $A_DBW[14] B_OR 'B00000001' ; Warm-Up Done (To PLC)
$A_DBW[14] = $A_DBW[14] B_AND 'B11111101' ; Set Warm-Up start bit to '0' (To PLC)
M5 ;Stop Spindle
MSG("Warming up spindle is done. Can operate the machine normally.")
G4F2
SIM_PROG:
M17
ERR:
SETAL(65100,"Spindle Warm-Up Failed, Check machine condition.")
M17
Please read the code carefully and help me to modify in such a way that i might be able to limit the warmup time to 10 minutes only on startup. thanks