Page 1 of 1

Table and spindle Warmup macro

Posted: Fri Oct 30, 2020 10:59 am
by zz0122
Hi,
I tried to to add the macro below to my "AUX 56" button, that I got from other website.
I modified the macro to tailored my machine, went to c:\cncm folder, modified "mfunc56.mac" and saved.
When I run the macro, I received "Syntax Error" on my 1st # (marked below)
DId I do the correct procedure? is the macro wrong?

;----------------------------------------------------------------------------------
;( CNC Machine Warmup Program )

;( Axis travel ranges. Be sure they're right for your machine and setups! )
;----------------------------------------------------------------------------------
#100=25 (Min X Travel) <-----Syntax Error
#101=550 (Max X Travel)
#102=25 (Min Y Travel)
#103=720 (Max Y Travel)
#104=-10 (Min Z Travel)
#105=-100 (Max Z Travel)

;----------------------------------------------------------------------------------
;( Amount of dwell after axis travel. )
;( Adjust so total time at each spindle rpm )
;( is about 200 seconds )
;----------------------------------------------------------------------------------
#106=200

;( Safe Starting Conditions )
G0 G40 G49 G50 G80 G94G17 G20 G40 G49 G54 G64 G80 G90 G98 M05

;( Alternate spindle speed with axis warmup. )
;( Adjust for your spindle's speed ranges. )
G28
S2500 M3
M98 P2000 ;(Warmup axes)
S5000
M98 P2000 ;(Warmup axes)
S7500
M98 P2000 ;(Warmup axes)
S10000
M98 P2000 ;(Warmup axes)
S12000
M98 P2000 ;(Warmup axes)
S12500
M98 P2000 ;(Warmup axes)
S15000
M98 P2000 ;(Warmup axes)
S17500
M98 P2000 ;(Warmup axes)
S20000
M98 P2000 ;(Warmup axes)
S22500
M98 P2000 ;(Warmup axes)
S24000
M98 P2000 ;(Warmup axes)

M5 G28

M30 ;(End of program)

O2000 ;(Axis warm up subprogram)
G28
F50 G01
Z#104 ;(Do Z first and leave Z parked high for the rest )
Z#105
X#101
Y#103
X#100
Y#102
G04 P#106
M99 ;(Return from subprogram)


TIA

Re: Table and spindle Warmup macro

Posted: Fri Oct 30, 2020 11:05 am
by slodat
You need a semi-colon before the beginning of your comment. Change that line and the others like this:

Code: Select all

#100=25 ;(Min X Travel)

Re: Table and spindle Warmup macro

Posted: Fri Oct 30, 2020 11:14 am
by zz0122
Hi slodat,
Thank You

Re: Table and spindle Warmup macro

Posted: Fri Oct 30, 2020 12:09 pm
by zz0122
Now I got "Could not open "O2000.cnc"
and its pointing out to "M98 P2000 ;(Warmup axes)"

sorry for all "New User" questions...

TIA

Re: Table and spindle Warmup macro

Posted: Fri Oct 30, 2020 3:41 pm
by cncsnw
If you want to include a numbered subprogram in the same file that you are going to call it from, then it needs to:
1) Precede the M98 call, and
2) Be numbered between 9100 and 9999

Re: Table and spindle Warmup macro

Posted: Sat Oct 31, 2020 10:35 am
by zz0122
cncsnw wrote: Fri Oct 30, 2020 3:41 pm If you want to include a numbered subprogram in the same file that you are going to call it from, then it needs to:
1) Precede the M98 call, and
2) Be numbered between 9100 and 9999
Hi cncsnw,
I tried, change the # to above 9100 as you said, and now I received "Variable is read only"

;----------------------------------------------------------------------------------
;( CNC Machine Warmup Program )

;( Axis travel ranges. Be sure they're right for your machine and setups! )
;----------------------------------------------------------------------------------
#9100=25 ;(Min X Travel) <---- Variable Read-Only
#9101=550 ;(Max X Travel)
#9102=25 ;(Min Y Travel)
#9103=720 ;(Max Y Travel)
#9104=-10 ;(Min Z Travel)
#9105=-100;(Max Z Travel)

;----------------------------------------------------------------------------------
;( Amount of dwell after axis travel. )
;( Adjust so total time at each spindle rpm )
;( is about 200 seconds )
;----------------------------------------------------------------------------------
#9106=200

;( Safe Starting Conditions )
G0 G40 G49 G50 G80 G94G17 G21 G40 G49 G54 G64 G80 G90 G98 M05

;( Alternate spindle speed with axis warmup. )
;( Adjust for your spindle's speed ranges. )


G28
S2500 M3
M98 P9200 ;(Warmup axes)
S5000
M98 P9200 ;(Warmup axes)
S7500
M98 P9200 ;(Warmup axes)
S10000
M98 P9200 ;(Warmup axes)
S12000
M98 P9200 ;(Warmup axes)
S12500
M98 P9200 ;(Warmup axes)
S15000
M98 P9200 ;(Warmup axes)
S17500
M98 P9200 ;(Warmup axes)
S20000
M98 P9200 ;(Warmup axes)
S22500
M98 P9200 ;(Warmup axes)
S24000
M98 P9200 ;(Warmup axes)

M5 G28

M30 ;(End of program)

O9200 ;(Axis warm up subprogram)
G28
F50 G01
Z#9104 ;(Do Z first and leave Z parked high for the rest )
Z#9105
X#9101
Y#9103
X#9100
Y#9102
G04 P#9106
M99 ;(Return from subprogram)


TIA

Re: Table and spindle Warmup macro

Posted: Sat Oct 31, 2020 2:47 pm
by cncsnw
Not the variables. Just the program number. You need to change the variables back to the #100 series.

Re: Table and spindle Warmup macro

Posted: Sat Oct 31, 2020 5:48 pm
by zz0122
Hi cncsnw,
I changed back the variable to 100 series per your advise,

;----------------------------------------------------------------------------------
;( CNC Machine Warmup Program )

;( Axis travel ranges. Be sure they're right for your machine and setups! )
;----------------------------------------------------------------------------------
#100=25 ;(Min X Travel)
#101=550 ;(Max X Travel)
#102=25 ;(Min Y Travel)
#103=720 ;(Max Y Travel)
#104=-10 ;(Min Z Travel)
#105=-100;(Max Z Travel)

;----------------------------------------------------------------------------------
;( Amount of dwell after axis travel. )
;( Adjust so total time at each spindle rpm )
;( is about 200 seconds )
;----------------------------------------------------------------------------------
#106=200

;( Safe Starting Conditions )
G0 G40 G49 G50 G80 G94G17 G21 G40 G49 G54 G64 G80 G90 G98 M05

;( Alternate spindle speed with axis warmup. )
;( Adjust for your spindle's speed ranges. )


G28
S2500 M3
M98 P9200 ;(Warmup axes) <---- Could Not open File O9200
S5000
M98 P9200 ;(Warmup axes)
S7500
M98 P9200 ;(Warmup axes)
S10000
M98 P9200 ;(Warmup axes)
S12000
M98 P9200 ;(Warmup axes)
S12500
M98 P9200 ;(Warmup axes)
S15000
M98 P9200 ;(Warmup axes)
S17500
M98 P9200 ;(Warmup axes)
S20000
M98 P9200 ;(Warmup axes)
S22500
M98 P9200 ;(Warmup axes)
S24000
M98 P9200 ;(Warmup axes)

M5 G28

M30 ;(End of program)

O9200 ;(Axis warm up subprogram)
G28
F50 G01
Z#104 ;(Do Z first and leave Z parked high for the rest )
Z#105
X#101
Y#103
X#100
Y#102
G04 P#106
M99 ;(Return from subprogram)

Im back received could not open file.
Screenshot 2020-10-31 14.43.41.png

Re: Table and spindle Warmup macro

Posted: Sat Oct 31, 2020 5:53 pm
by tblough
The subprogram has to be before any of the M98 calls as CNCSNW already mentioned.

Re: Table and spindle Warmup macro

Posted: Sat Oct 31, 2020 6:40 pm
by zz0122
Hi Tblough....
Thank You...and Thank You, cncsnw...work now....