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:

Post variables


romer
 Share

Recommended Posts

Since numeric variables are modal and the post won't output unless prv_var and var are different, if an update is not forced, how can you determine exactly when it is updated using the debugging tools?

(I hope that makes sense).

Also, when a post line uses the statement:

sav_var=var such as in the line

sav_coolant=coolant

what exactly is the post writer trying to accomplish?

Thank you for any help,

Romer

Link to comment
Share on other sites

Thank you for your help guys.

The use of the ~ is something I've read about in the post book but it didn't dawn on me to try.

It told me what I was looking for. I will use that more often in the future. Thanks for pointing that out James.

As to my second question, I have not found anything that references the sav_var that I see used in posts. Can anyone shed some light?

Thanks,

Romer

Link to comment
Share on other sites

Romer,

When programming, from time to time we like to keep in memory the value of certain variables to be able to recall them up later. Here's an example:

If I want to return my machine to it's home position before starting the next operation, like in a toolchange, I would want an output like this:

G00 G90 Z1.0 M05

G91 G28 Z0.0

T01 M06

G00 G90 G54 X1.0 Y1.0 S1000 M03

...

the 'absinc' variable, if used, needs to be saved momentarily so we can recall it's value after the toolchange (we are outputting a G91 for the home position movement), so here it goes:

"%", e

*progno, e

"(PROGRAM NAME - ", progname, ")", e

"(DATE=DD-MM-YY - ", date, " TIME=HH:MM - ", time, ")", e

pbld, n, *smetric, e

pbld, n, *sgcode, *sgplane, "G40", "G49", "G80", *sgabsinc, e

sav_absinc = absinc

if mi1 <= one, #Work coordinate system

[

absinc = one

pfbld, n, sgabsinc, *sg28ref, "Z0.", e

pfbld, n, *sg28ref, "X0.", "Y0.", e

pfbld, n, "G92", *xh, *yh, *zh, e

absinc = sav_absinc

]

pcom_moveb

Taken from the MPFAN post, if you notice the absinc variable was set to 1, absinc = one, so the G91 will output for the reference position. If the initial setting was 0, this value is saved 'sav_absinc = absinc' to be recalled later 'absinc = sav_absinc'.

Hope this helps!

Luc

Link to comment
Share on other sites

Romer - In an Mpfan based post, there aren't a lot of forced variables used. Instead of using flags, counters, or other logic - for instance to catch the first move after a tool change - you can simply leave the variable unforced in plinout and prapidout, but force the output by using a prv_feed = c9k line during the toolchange. Run on sentence. A short one to compensate. Hope this makes sense.

Link to comment
Share on other sites

I thought I might be trying to find the meaning of something that wasn't there.

Thanks for all the help.

Romer

Some people can read WAR and PEACE and think it a simple adventure story while others can read a Bazooka Joe bubble gum wrapper and unlock the secrets of the universe. - Lex Luther

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