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 > CamSoft Products


CamSoft Products Discuss Camsoft PC based CNC controller products here!


This forum is sponsored by:

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Ban this user!
Old 03-31-2008, 12:18 PM
 
Join Date: Jan 2008
Location: usa
Posts: 14
toolmanwaz is on a distinguished road
Drill Macro problem

Hello Camsoft Users;
I have an unusual problem that I did not run into before today. I am able to turn on/off the mist coolant and the flood coolant from on screen buttons. Forthermore, you can turn on the mist coolant from the handheld pendent unit and by using M07 and M08 commands.
To simplify code, I created a Macro to turn them off and handle the lights and on screen messages that needed to be addressed. Now the problem. If the [M9] macro runs during the drill cycle, the machine will halt and tell you that the axis have not reached their commanded positions. I did change the code so that it is everywhere I could think of and I do not get the error, but I am wondering if/why a drill Macro (or any other Macro) will be interrupted if another request is made to run a macro. the code is as follows:
[[G81]]
' G81
\200=f 'CAPTURE FEEDRATE
IF\775>0THENIF\525=1THEN GOTO :W DRILL ' Still in W-axis drill mode.
ISTHERE R;\28;\29
IF\28>0THEN\30=\29
ISTHERE W;\500;\501
IF\500>0THEN\777=\501:GOTO :W DRILL
ISTHERE Z;\400;\401
IF\400>0THEN\776=\401
\20=r
COMMAND VS \3
DECELSTOP:RAPID x;y;;w
COMMAND VS \3
DECELSTOP :RAPID ;;\20;w:SLEEP .1
DECELSTOP:GO x;y;\776;w:SLEEP .1
COMMAND VS \3
DECELSTOP
IF\998=0THENz=\30:RAPID x;y;\30;w:SLEEP .1:EXIT
IF\998=1THENz=\132:RAPID x;y;\132;w:SLEEP .1:EXIT
:W DRILL
\525=1 ' W-axis drill mode flag
IF\500>0THEN\777=\501
\134=\133
COMMAND VS \3
DECELSTOP:RAPID x;y;;w
COMMAND VS \3
DECELSTOP:RAPID ;;;r :SLEEP .1
DECELSTOP:GO x;y;;\777 :SLEEP .1
COMMAND VS \3
DECELSTOP
IF\998=0THENRAPID x;y;;\30:w=\30:EXIT
IF\998=1THENRAPID x;y;;\133:w=\133:EXIT


[[M9]]
'coolant off
BUTTON18 ;;;COOLANTOFF.BMP
BUTTON14 ;;;MISTCOOLANTOFF.BMP:\340=1'mist coolant interlock
#24=1:#103=0:#102=0:MESSAGE ALL COOLANT OFF
\91=0

Thank you
Reply With Quote

  #2   Ban this user!
Old 03-31-2008, 12:25 PM
 
Join Date: Apr 2003
Location: United States
Posts: 279
camsoft is on a distinguished road

You're missing something Jim all we original saw was the word Hello.
__________________
(Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)

Last edited by camsoft; 04-01-2008 at 12:13 PM.
Reply With Quote

  #3   Ban this user!
Old 03-31-2008, 09:18 PM
Karl_T's Avatar  
Join Date: Mar 2004
Location: Dassel,MN,USA
Posts: 1,318
Karl_T is on a distinguished road

Originally Posted by camsoft View Post
You're missing something Jim
Well da.

Trying to find the program error in event driven programming can drive you nuts. You got to have a way to quickly isolate what has happened right at the error and just before. The Logfile can be very useful but its just too much data to narrow your search quickly.

I have found it very useful to have MESSAGE everywhere in the code to identify what's running when. Only turn it on when needed by using an on screen button. here' how I did it:

'*********Mcodes for button8

'Set flag for extra messaging to screen
\140=1
BUTTON8 IN; Full Messaging
-----M31
'Clear extra messaging to screen
\140=0
BUTTON8 OUT;No Messages
-----M32


'*****PUT A BUTTON ON THE SCREEN


[BUTTON8]
VISIBLE=TRUE
TOP= 1795
LEFT= 8935
HEIGHT=500
WIDTH=2000
FKEY= 0
CAPTION=Error Messaging
MFUNC1ST=31
MFUNC2ND=32
BITMAP=



'***typical example, put these EVERYWHERE

IF \140=1 THEN MESSAGE . Estop.fil just ran
'***note I found it helpful to begin all these messages with a . and three spaces to keep separate on the screen.



Good luck in your quest. I just had a problem where I was losing "home" on my lathe. Turns out I had re-used a variable number in my air lube injection routine that only turns the motor off 4 timer.fil scans after a collet open/close command. I NEVER would have found this without the above trick.

Karl
Reply With Quote

  #4   Ban this user!
Old 04-01-2008, 06:58 AM
 
Join Date: Jan 2008
Location: usa
Posts: 14
toolmanwaz is on a distinguished road

Hi Karl T.
What is puzzeling is I coppied the same exact code for the [M9] macro and placed it in the M7 code (turn on mist coolant) so that if it were the second push of any button ( on screen, hard button or M code) it would turn off. That works all day. The G81 macro will continue to work and you will not get an in position error.
When I was using the [M9] macro, I went to diagnostics and pressed why am I not moving? Reply, axis have not reached final position. out of tolerance on axis 3. It is almost like it was washing the dishes, was asked to take out the garbage and then forgot what it was doing. When you use the M code, it looks like you are asking someone else to take the garbage out. Any thoughts would be appreciated.
Reply With Quote

  #5   Ban this user!
Old 04-01-2008, 10:31 AM
Karl_T's Avatar  
Join Date: Mar 2004
Location: Dassel,MN,USA
Posts: 1,318
Karl_T is on a distinguished road

I'll put this under the title of "wierd ****". **** happens. If I were you, start over,find a different way to do it.

For example, just put everything you need in an M code. get rid of macro. You've got a button calling an M code calling a macro. Worth a shot. No promise though.

In general, I've had issues with on screen buttons. I find an operator button far more reliable. If you think about it you've bypassing a lot of stuff by using inputio. My machine just has a "coolant off" button. Works like a charm. There only the output#=0 and a couple of light commands.

I've got a ton of inputs and inputio commands. Everything event driven. They fire all the time during motion without issue.

Karl
Reply With Quote

Sponsored Links
  #6   Ban this user!
Old 04-01-2008, 10:47 AM
 
Join Date: Jan 2008
Location: usa
Posts: 14
toolmanwaz is on a distinguished road

Amen Karl. That is what I ended up doing. There are no issues with the G81 macro. You can turn the coolant pump and the mist coolant on and off without any issues. I was just wondering why it would happen. It is a 3.33 GHz computer with 2 Gig of ram running Windows XP pro. No other programs are loaded so I feel confident that it is not for lack of computing power.
Reply With Quote

Reply




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
Drill operation problem nomodoh CamBam 1 07-27-2007 09:56 AM
protel pcb Drill file problem with mach2 ? NASR1 Mach Mill 0 06-28-2007 02:22 PM
VF0E Macro Problem stang5197 Haas Mills 1 06-14-2007 05:34 PM
Noob Drill Grid Pattern Macro Question KOzOK Fadal 8 01-08-2007 09:11 AM
Problem with drill depth Alan S Post Processors for MC 2 11-03-2005 02:23 AM




All times are GMT -5. The time now is 01:44 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 354 355 356 357 358 359 360 361