587,421 active members*
3,301 visitors online*
Register for free
Login
Results 1 to 6 of 6
  1. #1
    Join Date
    Jan 2008
    Posts
    14

    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

  2. #2
    Join Date
    Apr 2003
    Posts
    332
    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)

  3. #3
    Join Date
    Mar 2004
    Posts
    1543
    Quote 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

  4. #4
    Join Date
    Jan 2008
    Posts
    14
    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.

  5. #5
    Join Date
    Mar 2004
    Posts
    1543
    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

  6. #6
    Join Date
    Jan 2008
    Posts
    14
    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.

Similar Threads

  1. Drill operation problem
    By nomodoh in forum CamBam
    Replies: 1
    Last Post: 07-27-2007, 03:56 PM
  2. protel pcb Drill file problem with mach2 ?
    By NASR1 in forum Mach Mill
    Replies: 0
    Last Post: 06-28-2007, 08:22 PM
  3. VF0E Macro Problem
    By stang5197 in forum Haas Mills
    Replies: 1
    Last Post: 06-14-2007, 11:34 PM
  4. Noob Drill Grid Pattern Macro Question
    By KOzOK in forum Fadal
    Replies: 8
    Last Post: 01-08-2007, 04:11 PM
  5. Problem with drill depth
    By Alan S in forum Post Processors for MC
    Replies: 2
    Last Post: 11-03-2005, 09:23 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •