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:

If, then, else logic


Zoober
 Share

Recommended Posts

I've been editing our posts - mostly 4 and 5 axis - and I have been pretty successfull so far, but now I need to get into some logic checking.

I've looked into the post parameter pdf and the forums, but I can't find a ref for the if,then, else,and,or,not,null,while,wend,blah,yada, etc... logic.

Thru trial and error (and looking at existing posts)I have figured & means AND, and some other stuff, but it's taking up time 'cyfering. Is there any code ref for the logic symbols?? Or at least is it C based, VB based, or ?? headscratch.gif

Can one of you Gurus point me in the right direction please.

All help is appreciated. I already learned a lot from this place about MC posts, and they seem to be pretty configuable, but we have some GE (2000, not Fanuc) and Siemens controls that need to do some goofy stuff. cuckoo.gif

 

Robert

Link to comment
Share on other sites

Here's a sample of a nested IF/ELSE statement.

 

code:

           if opcountpg = ops_per_pg & page_breaks,

[

#Page break

"<br style=", 34, "page-break-before:always;", 34, ">", e

if list_type = 0, "<p><b><font SIZE=+1>OPERATION LIST - CONTINUED...</font></b></p>", e

else, "<p><b><font SIZE=+1>TOOL LIST - CONTINUED...</font></b></p>", e

opcountpg = 0

]

HTH.

Link to comment
Share on other sites

Here's another good example.

 

code:

pwcs       # G54+ coordinate setting at toolchange

if wcstype < two, "G92"

if wcstype = two | wcstype > three,

[

if workofs < 0, workofs = 0

if workofs < 6,

[

g_wcs = workofs + 54

*g_wcs

]

else,

[

p_wcs = workofs - five

"G54.1", *p_wcs

]

!workofs

]

if wcstype = three, "-"

Link to comment
Share on other sites

Thanks guys.

Rob, I kinda thought the pipe was "or", but by the code I was looking at, it coulda been "or" or a range.

That helps.

Rekd, Good choice of code clip. I am checking for fixture offsets g54-59, g505-600, etc... A little different than g54 p..

Again, thanks!

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