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:

add misc integer


Recommended Posts

Hi everyone:

 

I would like to utilize a misc integer in mastercam that adds M98P0001 to my gcode. It is a bar puller subroutine.

 

I need it to be directly before to M30 at the end of the program.

 

I use mastercam x5 mr1

 

Thank you very much!!

Link to comment
Share on other sites

You can format a variable, lets say Misc Int 9

 

sav_mi9 : 0

 

in the toolchange section

 

sav_mi9 = mi9$

 

the in the peof section before the M30

 

if sav_mi9, M98 P9001, e$

 

 

 

then in the control def you can relabel and set mi9 to note your cycle and 0 =no, 1=yes

Link to comment
Share on other sites

John thank you Sir very much!!

 

I received the error;

17 Jun 2011 02:41:04 PM - <2> - PST LINE (1798) - Label has not been defined[19]

17 Jun 2011 02:41:04 PM - <2> - PST LINE (1798) - Label has not been defined[23].

 

I added this to the tool change format section labeled "Toolchange / NC output Variable Formats" ;

 

sav_mi9 : 0 # FORMAT MISC INT #9 RWH

sav_mi9 = mi9$

 

and

 

in the peof section;

 

peof$ #End of file for non-zero tool

ptoolend$

comment$

if sav_mi9, M98 P9001, e$

n$, "M30", e$

mergesub$

clearsub$

mergeaux$

clearaux$

"%", e$

 

I think I did not define the misc integer correctly or in the right spot. I am learning please bear with me..

 

Thank you again

Link to comment
Share on other sites
Keith, my thinking is you wouldn't want it ALL the time

 

mi9 default is 0 (unless you change it), only set it to 1 if you want it...

I have done it this way a number of places in a couple of my posts (i.e. "if mi3$ = 1, yada yada", or "if mi3$ < 5, yada yada")

 

You can format a variable, lets say Misc Int 9

 

sav_mi9 : 0

 

in the toolchange section

 

sav_mi9 = mi9$

 

wondering why all the sav_mi9 stuff

 

Russh, sorry for the hijack...

Link to comment
Share on other sites
wondering why all the sav_mi9 stuff

 

If you don't catch the value in the tool change, at the end of the tool it has already read the next value so by using the sav_mi9 you can read it early, save it and use it later after the mi9$ variable has already been updated.

Link to comment
Share on other sites

Keith,

 

You are correct, it is unnecessary to save the value of mi9$ at the toolchange.

 

This is perfectly valid (in peof$):

 

if mi9$ = 1, "M98P1000", e$

 

It's really about where you intened to use the Misc. value.

 

Following John's method of saving the mi9$ value to a user defined variable, you would also need to add the "sav_mi9 = mi9$" in ptlchg0$, because if you didn't and your last operation used the same tool as your next to last op, you would not get the correct output.

 

There are cases were it is a very good idea to save the Misc. values, because of the possibility of them being reset, but this is not one of those cases.

Link to comment
Share on other sites

Awesome guys!!!!

 

Thanks so much for all the input....Like to Learn.

 

It is posting the way I intended by Johns method.

 

If you dont use mi9$ = 1, "M98P1000", e$ because if you put a 5 or something it still out puts the m98p0001...

 

What is sav_mi9 : 0 doing?? Is it clearing mi9 to zero?

 

Thanks everyone :rolleyes: ..

Link to comment
Share on other sites

Thank you again..

 

For me the only advantage to "if mi9$ = 1, "M98P1000", e$" is that it will only take a 1, with if "sav_mi9, M98 P1000", e$ it will take any number other than zero will output the m98....

 

 

Thanks again guys...:)

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