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:

using IF and ELSE statments


mayday
 Share

Recommended Posts

What am I missing here. I've set up the post as follows

p_wcs =

 

1=front plane

2=top

3=right side

4= left side

5=bottom side

in the machine I have label calls (or subs)for the head rotation

the machine can change tools at a front or top plane.

anything but a 1 or 2 plane, the shortest index postion is to the top

for tool change

 

 

Im using p_wcs position to see if the head

needs to rotate to do a tool change.

 

this is from my ptlchg_com section

 

if p_wcs <2, pbld, pn, "TOOL CALL ", *t, *sgplane, *speed, feed, peob, e

else,

pbld, pn, "CALL LBL 2 ; TOOL CHANGE", e

pbld, pn, "TOOL CALL ", *t, *sgplane, *speed, feed, peob, e

 

this output is good

53 ; ROUGH SOUTH END

54 ;

55 CALL LBL 2 ; TOOL CHANGE

56 TOOL CALL 22 Z S800 F2032

57 CALL LBL 4

58 ; 6" ROUGH FACE MILL

 

this works except when beginning the program if the initial plane is 1 or 2

I get a double tool call like this

 

2 CALL LBL 1

3 ; SPOT PART FRONT

4 ;

5 TOOL CALL 58 Z S800 F64

6 TOOL CALL 58 Z S800

7 ; 58 SPOT DRILL

 

not sure if I set up the IF and ELSE statments correctly

Link to comment
Share on other sites

You need these to close the equation is all [] then I think it will ifx your problem like this.

 

if p_wcs <2, pbld, pn, "TOOL CALL ", *t, *sgplane, *speed, feed, peob, e

else,

[

pbld, pn, "CALL LBL 2 ; TOOL CHANGE", e

pbld, pn, "TOOL CALL ", *t, *sgplane, *speed, feed, peob, e

]

try that and see fi it fixes it.

 

Crazy Millman or take out the * in the secone line and that should keep it from double posting.

 

Crazy Millman

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...