Hello Guest it is March 28, 2024, 10:44:22 AM

Author Topic: Tool Path Generation Error  (Read 5872 times)

0 Members and 1 Guest are viewing this topic.

Tool Path Generation Error
« on: July 17, 2012, 09:06:31 AM »
I have macros that have branches with END statements which rely on captured data from the machine to make them work.

the issue is that when i load a toolpath into mach these branches are causing the machine to stop processing the toolpath.

The simplest example is if you had a door which opens during tool change, and you check that it is open before changing the tool.

i have tried the following

if _____
else

message "ERROR"
code "M0"
dobutton(3)
END

END IF

the do button 3 just generated and error, I am trying to activate cycle stop but vb manual does not refference it.

the end cause the program not to generate so it cannot be run

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Tool Path Generation Error
« Reply #1 on: July 19, 2012, 04:15:58 PM »
You are trying to mix motion control in both CB and Gcode. It does not mix well. IF you want to stop then use the feedhold stop method as the M0 routine may or may not do anything in that situation.


If Not (door open) then
message "ERROR, DOOR NOT OPEN"
DoButton(1)
Whle Ismoving()
Wend
dobutton(3)
END
END IF



Re: Tool Path Generation Error
« Reply #2 on: July 19, 2012, 04:21:08 PM »
but the issue is that when the macro is called in the gcode the end will not allow the gcode to pre-process and there for run.

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Tool Path Generation Error
« Reply #3 on: July 19, 2012, 05:33:47 PM »
The "end" statement  in a CB macro has nothing to do with the  G code side of mach3.

Please post an example of how you think it applies.

(;-) TP
Re: Tool Path Generation Error
« Reply #4 on: July 20, 2012, 02:12:39 AM »
create a g-code program that call the macro and try and run it.


G code
g1z10
g1 x10 y10
m1000 (macro call)
g1x0y0
m30
%

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Tool Path Generation Error
« Reply #5 on: July 20, 2012, 09:28:40 AM »
OK did that runs fine. What is IN your M1000 macro??? Obviously something is in  your macro that kills the G code side as well.

(;-) TP
Re: Tool Path Generation Error
« Reply #6 on: July 20, 2012, 09:59:33 AM »
the m1000 macro would contain the code

If Not (door open) then
message "ERROR, DOOR NOT OPEN"
DoButton(1)
Whle Ismoving()
Wend
dobutton(3)
END
END IF

or is there a better way of calling the macro.

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Tool Path Generation Error
« Reply #7 on: July 20, 2012, 10:34:32 AM »
IF you use that code then of course you stopped the Gcode program with the DoButton(1) and Dobutton(3). IT is not going to restart on its own(;-).

IF you want it to contunue after you have opened the door you have to provide code to do so. Or Create Code to wait on a response like open the door. These piece of code gives you one chance to open the door then ends the program. The Msgbox will prompt you to open the door . IF you do, then press OK then it ends the macro and the G code continues if not then it ENDS the Gcode program and you have to start all over again as the DOOR switch has failed.

If  NOT Isactive(signal1) then                  'The Door Open statement was just an example of you calling the state of the Door Switch it is NOT real code to be used
MsgBox" Door Not Open, Please Close To Continue or ELSE program will stop"
End IF

If NOT  Isactive(signal1)  Then
Message" G Code Program has ENDED due to Door ERROR. CHECK door switch "
DoButton(3)
End
End IF


THERE ARE many ways to do this you just have to pick a method then follow up with the correct macro code.

Just a thought, (;-) TP

« Last Edit: July 20, 2012, 10:36:10 AM by BR549 »
Re: Tool Path Generation Error
« Reply #8 on: July 21, 2012, 09:18:57 AM »
you are not understanding my point

if you embed the code in a g-code program it carries out a preproses of the code before it runs.

that then prevents further action or running of the code.

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Tool Path Generation Error
« Reply #9 on: July 21, 2012, 09:27:16 AM »
Go to Gen Config page , Do you have "Ignore Mcalls when loading " checked??

(;-) TP