Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; parameter: last_slot
- o<tool_get_move> sub
- ; (MSG, Tool_get_move started)
- o100 if [#1 EQ 0]
- G04 P0.5
- o100 elseif [#1 GE 1 AND #1 LE 7] (take the tool from one of tool slots)
- M66 P02 L3 Q3 (check if spindle is in top position)
- o1001 if [#5399 EQ -1]
- (MSG, Spindle is not lifted up, will try to do that)
- M64 P00 (raise spindle up in top position)
- M64 P03
- G04 P0.5
- M65 P00
- M65 P03
- M66 P00 L3 Q3 (check if spindle is in top position)
- o10011 if [#5399 EQ -1]
- (MSG, Spindle is not lifted up, cycle paused)
- M0
- o10011 endif
- o1001 else
- G04 P0.1
- o1001 endif
- M66 P18 L0 (make sure spindle is empty)
- o101 if [#5399 EQ 1]
- (MSG, There is a tool in spindle, cycle paused)
- M0
- o101 else
- G04 P0.1
- o101 endif
- ;o110 if [#1 EQ 1]
- ; G53 G0 C205.7 (move carousel slot under tool presence sensor)
- ;o110 elseif [#1 EQ 2]
- ; G53 G0 C154.1
- ;o110 elseif [#1 EQ 3]
- ; G53 G0 C102.7
- ;o110 elseif [#1 EQ 4]
- ; G53 G0 C51.5
- ;o110 elseif [#1 EQ 5]
- ; G53 G0 C-0.7
- ;o110 elseif [#1 EQ 6]
- ; G53 G0 C308.3
- ;o110 elseif [#1 EQ 7]
- ; G53 G0 C256.9
- ;o110 endif
- ; M66 P06 L3 Q1 (check if carousel slot is empty)
- ;o111 if [#5399 NE 1]
- ; (DEBUG, Tool slot is empty, cycle paused)
- ; M0
- ;o111 else
- ; G04 P0.5
- ;o111 endif
- o120 if [#1 EQ 1]
- G53 G0 C264.810 (move carousel slot to match the spindle)
- o120 elseif [#1 EQ 2]
- G53 G0 C213.394
- o120 elseif [#1 EQ 3]
- G53 G0 C162.407
- o120 elseif [#1 EQ 4]
- G53 G0 C110.910
- o120 elseif [#1 EQ 5]
- G53 G0 C59.390
- o120 elseif [#1 EQ 6]
- G53 G0 C7.852
- o120 elseif [#1 EQ 7]
- G53 G0 C316.352
- o120 endif
- M66 P04 L3 Q2 (check if carousel is in)
- o121 if [#5399 EQ -1]
- (MSG, Carousel is not in, will try to do that)
- M64 P05 (move carousel in)
- G04 P0.5
- M65 P05
- M66 P04 L3 Q2 (check if carousel is in)
- o1211 if [#5399 EQ -1]
- (DEBUG, Carousel is not in position for spindle to take the tool, cycle paused)
- M0
- o1211 else
- G04 P0.5
- o1211 endif
- o121 else
- G04 P0.5
- o121 endif
- M64 P10 (release the spindle so that it can take the tool)
- G04 P0.5
- M65 P10
- G04 P0.2
- M66 P16 L3 Q1 (check if spindle is released)
- o122 if [#5399 EQ -1]
- (DEBUG, Tool is not released, cycle paused)
- M0
- o122 else
- G04 P0.1
- o122 endif
- M64 P04 (lower spindle to middle position)
- G04 P0.5
- M65 P04
- M66 P00 L3 Q3 (check if spindle is in middle position)
- o123 if [#5399 EQ -1]
- (MSG, Spindle is not in middle position, cycle paused)
- M0
- o123 else
- G04 P0.4
- o123 endif
- M64 P11 (lock the tool in spindle)
- G04 P0.5
- M65 P11
- M66 P18 L3 Q1 (check if there is tool in spindle)
- o124 if [#5399 EQ -1]
- (MSG, There is no tool in spindle, cycle paused)
- M0
- o124 else
- G04 P0.1
- o124 endif
- M64 P06 (move carousel out)
- G04 P0.5
- M65 P06
- M66 P05 L3 Q3 (check if carousel is out and does not interfere with spindle)
- o125 if [#5399 NE 1]
- (MSG, Carousel is not out, will try to do that)
- M64 P06 (move carousel out)
- G04 P0.5
- M65 P06
- M66 P05 L3 Q4 (check if carousel is out and does not interfere with spindle)
- o1251 if [#5399 EQ -1]
- (MSG, Carousel is not out, cycle paused)
- M0
- o1251 endif
- o125 else
- G04 P0.1
- o125 endif
- M64 P03 (lower the chip guard)
- G04 P0.5
- M65 P03
- G04 P0.2
- M64 P01 (lower spindle down to working position)
- M64 P04
- G04 P0.5
- M65 P01
- M65 P04
- o100 elseif [#1 GE 51 AND #1 LE 84] (use one of the drills)
- M66 P00 L0 (check if spindle is in middle)
- o1002 if [#5399 NE 1]
- (MSG, Spindle is not lifted up, will try to do that)
- M64 P00 (raise spindle up)
- G04 P0.5
- M65 P00
- M66 P02 L3 Q3 (make sure that spindle is middle)
- o10021 if [#5399 EQ -1]
- (MSG, Spindle is not lifted up, cycle paused)
- M0
- o10021 endif
- o1002 else
- G04 P0.1
- o1002 endif
- M64 P[#1 - 30]
- M64 P55
- o100 else (manually insert tool in spindle)
- M66 P01 L0 (check if spindle is down)
- o1004 if [#5399 NE 1]
- (MSG, Spindle is not down, will try to do that)
- M64 P01 (lower the spindle)
- G04 P0.5
- M65 P01
- M66 P01 L3 Q10 (make sure that cover is closed)
- o10041 if [#5399 EQ -1]
- (MSG, Spindle1 is not down!!!)
- M0
- o10041 endif
- o1004 else
- G04 P0.1
- o1004 endif
- G53 G0 Z95
- G53 G0 Y250
- (MSG, Insert tool #1 in spindle)
- M0
- o100 endif
- o<tool_get_move> endsub
- m2
Add Comment
Please, Sign In to add comment