Jump to content

Welcome to eMastercam

Register now to participate in the forums, access the download area, buy Mastercam training materials, post processors and more. This message will be removed once you have signed in.

Use your display name or email address to sign in:

Macro Facing program


Recommended Posts

Hi,


 


I Have been starting to learn some macro programming but I have hit a snag with a format error.  Could anyone help me out?


Here is the basic facing program that I have started.


 


%

O0001( PROGRAM: FACING PROGRAM )

( 11/15/2015 AT 10:11 AM )

(MACRO FACING PROGRAM)

 

#500=1 (TOOL NUMBER)

#501=3 (TOOL DIA)

#502=9000 (SPINDLE SPEED)

#503=90. (FEED RATE)

#504=.05 (DEPTH OF CUT)

#505=.1 (TOTAL AMOUT TO BE REMOVED)

#506=59 (WORK OFFSET)

#507=2 (LENGTH OF PART)

#508=2 (WIDTH OF PART)

#509=1 (OUT OF VICE, PHYSICALLY MEASURE!)

#510=0 (NUMBER OF Y PASSES)

#511=0.0(DO NOT CHANGE)

 

N1G0G20G40G80G49G17G94G98

G90

T#500M6

G0G90G#506X[#507/2+#501]Y0

S#502M3

M8

G43Z4.H#500

Z1.

N2WHILE[-#505LE#511]DO1

#511=[#511-#504]

IF[#511GE#509*-1]THEN#3000=1

IF[-#505GT#511]GOTO20 (this is where it seems to be hanging up)

G1Z#511F[#503/4]

X-[#507/2-#501]F#503

G0Z.1

X[#507/2+#501]

END1

N20#511=-#505

IF[#511GE#509*-1]THEN#3000=1

G1Z#511F[#503/4]

X-[#507/2-#501]F#503

G0Z.1

M9

G49G53Z0

M5

G91G28X0.Y0.

M30

%

 

any input would be greatly appreciated , Thanks

 

Link to comment
Share on other sites

Change --> IF[#511GE#509*-1]THEN#3000=1

 

to

 

IF[#511LE#509*-1]THEN#3000=1

 

 

This will allow the program to run. I am not sure if it will run quite as you intend it but it no longer hangs. You can also simply set #509 to a negative value.
 

#504=.05 (DEPTH OF CUT)
#509=1 (OUT OF VICE, PHYSICALLY MEASURE!)
#510=0 (NUMBER OF Y PASSES)
#511=0.0(DO NOT CHANGE)
 
#511=[#511-#504] -----> #511= -0.05
IF[#511GE#509*-1]THEN#3000=1 ---> If -0.05 GE -1.0 (which it is, and always will be when #509 is a positive value) then alarm out.
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.

Join us!

eMastercam - your online source for all things Mastercam.

Together, we are the strongest Mastercam community on the web with over 56,000 members, and our online store offers a wide selection of training materials for all applications and skill levels.

Follow us

×
×
  • Create New...