![]() | |
| Home Page | Mark Forums Read | Today's Posts | My Replies | Classifieds | Reviews | Photo Gallery | Web Links | Share Files | Advertise With Us | Ad List |
| |||||||
| This forum is sponsored by: |
![]() |
| | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
| |||
| |||
Hi guys, I'm using a tool change macro that, when called, goes to X0 Y0. It pauses there for 5 seconds, and then starts lowering the Z slowly while looking for an input from a touch-off. Once it reads a touch-off, it zeros the Z axis and raises it to .3, then returns to the position it was at when the tool change was called.The problem is that once it gets to X0 Y0, I'd like it to wait for me to manually switch out the tool and hit Cycle Start to go to the tool zeroing portion of the macro. I have tried entering Code "M1", but that has no effect. The macro appears below. I would like to add the command to wait for input from me in the area where I've posted the comment in all caps (before the Tool Zero Macro). Can anyone tell me what I'm doing wrong here? 'ToolChange Macro Sub Main() OldTool = GetOEMDRO (1200) 'Tool In spindle DRO You must add this to your settings screen x = GetToolChangeStart( 0 ) y = GetToolChangeStart( 1 ) z = GetToolChangeStart( 2 ) a = GetToolChangeStart( 3 ) b = GetToolChangeStart( 4 ) c = GetToolChangeStart( 5 ) tool = GetSelectedTool() NewTool = tool 'Tool Changer Macro MaxToolNum = 40 'Max number of tools for the changer If NewTool = OldTool Then Exit Sub End If While NewTool > MaxToolNum NewTool = Question ("Enter New Tool Number up to " & MaxToolNum) Wend Code "G00 G53 Z0.0" 'Absolute positioning (machine coords) to Z home While IsMoving() Wend Code "G00 G53 X0.00 Y0.00" 'G53 added to this line to select absolute positioning for X and Y too by Ian While IsMoving() Wend Code "G4 P5.0" 'Pause for actual tool change out 'HOW CAN I ADD A COMMAND HERE TO WAIT UNTIL THE CYCLE START BUTTON IS PUSHED BEFORE PROCEEDING? While IsMoving() Wend 'Begin tool zero macro here PlateThickness = GetUserDRO(1151) 'Z-plate thickness DRO If GetOemLed (825)=0 Then 'Check to see if the probe is already grounded or faulty DoOEMButton (1010) 'zero the Z axis so the probe move will start from here Code "G4 P2.0" ' this delay gives me time to get from computer to hold probe in place Code "G40" 'Ian is testing this Code "G31Z-2 F5" 'probing move, can set the feed rate here as well as how far to move While IsMoving() 'wait while it happens Wend ZProbePos = GetVar(2002) 'get the exact point the probe was hit Code "G0 Z" &ZProbePos 'go back to that point, always a very small amount of overrun While IsMoving () Wend Call SetDro (2, PlateThickness) 'set the Z axis DRO to whatever is set as plate thickness Code "G4 P0.25" 'Pause for Dro to update. Code "G0 Z.3" 'put the Z retract height you want here Code "(Z axis is now zeroed)" 'puts this message in the status bar Else Code "(Z-Plate is grounded, check connection and try again)" 'this goes in the status bar if aplicable Exit Sub End If 'End of tool length macro here Call SetUserDRO (1200,NewTool) SetCurrentTool( NewTool ) Code "G00 X" & x & " Y" & y 'Move back to where the tool change was prompted End Sub Main 'Soft limits will trip if turned on and the probe move is not allowed to move below -.3 (in machine coords). This will mess up process, since the retract in Tool Zero Macro retracts .3 inches. |
|
#3
| |||
| |||
| Good question. Yes the M1 box is checked, and will work if I command an M1 stop in the g code itself or from the MDI. M0 doesn't work in the macro either. Here is the way that I am calling the M1 code (look for the lines followed by 'AAAAAAAAAA). Is the proper way to call those codes? 'ToolChange Macro Sub Main() OldTool = GetOEMDRO (1200) 'Tool In spindle DRO You must add this to your settings screen x = GetToolChangeStart( 0 ) y = GetToolChangeStart( 1 ) z = GetToolChangeStart( 2 ) a = GetToolChangeStart( 3 ) b = GetToolChangeStart( 4 ) c = GetToolChangeStart( 5 ) tool = GetSelectedTool() NewTool = tool 'Tool Changer Macro MaxToolNum = 40 'Max number of tools for the changer If NewTool = OldTool Then Exit Sub End If While NewTool > MaxToolNum NewTool = Question ("Enter New Tool Number up to " & MaxToolNum) Wend Code "G00 G53 Z0.0" 'Absolute positioning (machine coords) to Z home While IsMoving() Wend Code "G00 G53 X0.00 Y0.00" 'G53 added to this line to select absolute positioning for X and Y too by Ian While IsMoving() Wend Code "G4 P5.0" 'Pause for actual tool change out HOW CAN I ADD A COMMAND HERE TO WAIT UNTIL THE CYCLE START BUTTON IS PUSHED BEFORE PROCEEDING? While IsMoving() Wend Code "M1" 'AAAAAAAAAAAAAAA While IsMoving() 'AAAAAAAAAAAAAAAA Wend 'AAAAAAAAAAAAAAAAA 'Begin tool zero macro here PlateThickness = GetUserDRO(1151) 'Z-plate thickness DRO If GetOemLed (825)=0 Then 'Check to see if the probe is already grounded or faulty DoOEMButton (1010) 'zero the Z axis so the probe move will start from here Code "G4 P2.0" ' this delay gives me time to get from computer to hold probe in place Code "G40" 'Ian is testing this Code "G31Z-2 F5" 'probing move, can set the feed rate here as well as how far to move While IsMoving() 'wait while it happens Wend ZProbePos = GetVar(2002) 'get the exact point the probe was hit Code "G0 Z" &ZProbePos 'go back to that point, always a very small amount of overrun While IsMoving () Wend Call SetDro (2, PlateThickness) 'set the Z axis DRO to whatever is set as plate thickness Code "G4 P0.25" 'Pause for Dro to update. Code "G0 Z.3" 'put the Z retract height you want here Code "(Z axis is now zeroed)" 'puts this message in the status bar Else Code "(Z-Plate is grounded, check connection and try again)" 'this goes in the status bar if aplicable Exit Sub End If 'End of tool length macro here Call SetUserDRO (1200,NewTool) SetCurrentTool( NewTool ) Code "G00 X" & x & " Y" & y 'Move back to where the tool change was prompted End Sub Main 'Soft limits will trip if turned on and the probe move is not allowed to move below -.3 (in machine coords). This will mess up process, since the retract in Tool Zero Macro retracts .3 inches. |
![]() |
| Tags |
| code, macro, wait |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Need Help!- how to pause mach 3 to wait for an input from pasma | bthomps5 | Mach Software (ArtSoft software) | 2 | 09-01-2008 12:44 AM |
| can't wait | clammy23 | JGRO Router Table Design | 3 | 03-02-2008 07:16 PM |
| Boss5 Wait and Hold Led light | frog | Bridgeport and Hardinge Mills | 2 | 12-19-2007 10:33 PM |
| Should I get 5.0 or wait for 6.0, or | fc911c | Visual Mill | 10 | 03-01-2007 10:26 AM |
| R2E3 Boss 8 Display says E!!!! WAIT | hrhoward | Bridgeport and Hardinge Mills | 1 | 09-07-2006 11:13 PM |