CNCzone.com-The Largest Machinist Community on the net!



Home Page Mark Forums Read Today's Posts My Replies Classifieds Reviews Photo Gallery Web Links Share Files Advertise With Us Ad List
Go Back   CNCzone.com-The Largest Machinist Community on the net! > Machine Controllers Software and Solutions > Mach Software (ArtSoft software) > Mach Wizards, Macros, & Addons



This forum is sponsored by:

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Ban this user!
Old 11-27-2008, 10:54 PM
 
Join Date: Oct 2006
Location: USA
Posts: 90
Mr. Technical is on a distinguished road
How do you tell a macro to wait?

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.
Tweet this Post!Share on Facebook
Reply With Quote

  #2   Ban this user!
Old 11-27-2008, 11:35 PM
 
Join Date: Jan 2008
Location: USA
Posts: 48
LeftCoastCNC is on a distinguished road

M1 is optional program stop, is the control set to look for the M1? Did you try M0?
Tweet this Post!Share on Facebook
Reply With Quote

  #3   Ban this user!
Old 11-28-2008, 01:53 PM
 
Join Date: Oct 2006
Location: USA
Posts: 90
Mr. Technical is on a distinguished road

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.
Tweet this Post!Share on Facebook
Reply With Quote

Reply

Tags
code, macro, wait




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


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




All times are GMT -5. The time now is 02:42 PM.





Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
Content Relevant URLs by vBSEO
Template-Modifications by TMS

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353