Hello, I am transitioning from TurboCNC to MACH3 and need assistance with implementing Logical IF Then Statements within MACH3. The following code snippet within TurboCNC would be used to cut a profile on a lathe (Radius, with X.0 being the Center) by comparing the current cutting depth to the targeted profile depth of cut. If the profile depth of the X-axis is below or equal to the current depth of cut, there is no change in the depth of the cutting tool. If the profile depth of cut is above the current depth of cut, the cutting tool moves to the profile depth of cut. Each coordinate of the profile is evaluated in the same manner to complete the desired shape.
If there is a way within MACH3 to implement a similar approach, please point me in the right direction.
Thanks in advance for your consideration.
Regards,
Dan
The concept is to start as some X position that is greater than the stock radius, and decrement the value each pass, until the target depth is achieved. In the following example #3 is the starting radius, #4 is the target X profile coordinate. #6 is the target Z profile depth of cut. For example,
N10 #3 = 0.1
N20 #4 = 0.0375 #6 = -0.2878 M98o770
N30 #4 = 0.0575 #6 = -0.3108 M98o770
and so on for each coordinate of the profile.
After the last coordinate, the depth of the pass would be decremented, and the routine would loop again
% Profile Subroutine
N770 If #4 LE #3 M97o800 //If target X <= Current X , then cut at current X depth
N780 G01 X#4 Z#6 F#2 //Else cut at profile X & Z coordinates
N790 M99 //Return to Main Program
N800 G01 X#3 Z#6 F#2 //Cut at current X depth
N810 M99 //Return to Main Program