Welcome, Guest. Please login or register.
Did you miss your activation email?
November 23, 2008, 10:10:54 AM

Login with username, password and session length
Search:     Advanced search
* Home Help Search Calendar Links Login Register
+  Machsupport Forum
|-+  Mach Discussion
| |-+  FAQs
| | |-+  How to Implement Logical IF Then Expressions in MACH3
Pages: 1   Go Down
Print
Author Topic: How to Implement Logical IF Then Expressions in MACH3  (Read 570 times)
0 Members and 1 Guest are viewing this topic.
Osker
Active Member

Offline Offline

Posts: 5


View Profile
« on: December 25, 2007, 11:47:41 AM »

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 target profile depth of cut is below the current depth of cut, there is no change in the depth of the X axis.  If the target profile depth of cut is greater than the current depth of cut, the profile depth of cut is used.  This approach uses the results of a Logical "IF Less Than or Equal to".  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.  #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

%RH 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 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
Logged
Pages: 1   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.7 | SMF © 2006-2008, Simple Machines LLC Valid XHTML 1.0! Valid CSS!