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:

Okuma OSP300M post question


jeff
 Share

Recommended Posts

How can I have my post look at the first tool # that Mastercam spits out, and have it be written as the tool # that I have in red bold below?

I have this after my tool list in my post:

      "IF[VATOL NE 1]N1",e$
      "IF[VATOL EQ 1]N2",e$
      "M1M329",e$
      "T1M6",e$
      "N2",e$

What this does, or what I am trying to accomplish is to "dummy proof" and have the program index to the first tool in the program upon cycle start. No matter what tool is in the spindle, and no matter if there is a Next Tool staged. I know an M64 will clear the staged tool, but it gives an error if there isn't a staged tool.

Link to comment
Share on other sites

The variable that holds the current tool number is "t$". It is formatted to output "T" in front of the value, so I'd recommend creating a User-Defined variable, and setting it equal to the value of "t$". Then you can output your Tool Check/Skip function, and it will take the current value of the tool. "next_tool$" holds the "pre-stage" tool number, and I believe 'first_tool$' holds the "first tool number", so you can output a Tool Change to that tool, at the end of the program.

  • Like 1
Link to comment
Share on other sites

I already have a tool change to my first tool at the end of program. But sometimes we need to index to a tool for an insert change, broken end mill, etc... and as we all know, we've seen operators push cycle start and crashing because they forgot to index back to the starting tool. lol

That's what I'm trying to prevent.

Link to comment
Share on other sites

Why can't all MTB's have it in thier tool change logic to check spindle tool against the tool change and stage commands......  That way you can always command a stage and or tool change for a tool already in the spindle and carry on without a bunch of extra crap to have in the running program.

 

Link to comment
Share on other sites

I think I'm starting to grasp it a little bit.

How do i write my post so that it changes "first_tool$" to the actual tool number? I know that I would have to somehow get rid of the quotation marks in order for this to work.

"IF[VATOL NE first_tool$]N1"

 

I want my program to read

IF[VATOL NE whatevertoolnumber]N1

 

Link to comment
Share on other sites
7 minutes ago, huskermcdoogle said:

I think you need commas.

"IF[VATOL NE", first_tool$,"]"N1"

You are correct! :)

This is what I have now, and am going to try it:

      "IF[VNTOL GT 0]N1",e$
      "IF[VATOL NE " *first_tool$ "]N2",e$ 
      "IF[VATOL EQ " *first_tool$ "]N3",e$
      "N1M64",e$
      "N2M329",e$
      *first_tool$ "M6",e$
      "N3",e$
      "M279(CHIP AUGER ON)",e$

Link to comment
Share on other sites

Jeff,

We normally set up a G116 library file with a custom macro that has all the logic to check the tool requested, spindle tool, and next tool - then make the appropriate action. We then just change our Mcam post to put out G116 T*** instead of T*** M6.

OATC1
(TOOL CHANGE MACRO)
(COMMAND IS G116 T?? Q??)
(T=DESIRED TOOL #, Q=NEXT TOOL #)
(G116 T0 WILL CLEAR TOOL FROM SPINDLE)
(FEB 5, 2004)
M329
M5
G0Z5000
IF[PT EQ 0]NMT
IF[VTLCN EQ PT] NFIN
IF[VNTOL EQ PT] NCH
IF[VNTOL EQ 0] NCHG
M64
NCHG T=PT M6
NFIN IF[VNTOL EQ 0] NTL
IF[VNTOL NE PQ] NCLR
GOTO NEND
NCH M6
GOTO NFIN
NCLR M64
NTL T=PQ
GOTO NEND
NMT IF[VNTOL EQ 0]NRID
M64
NRID M63
M6
NEND RTS

 

  • Like 3
Link to comment
Share on other sites
On 4/28/2017 at 4:28 PM, YoDoug® said:

Jeff,

We normally set up a G116 library file with a custom macro that has all the logic to check the tool requested, spindle tool, and next tool - then make the appropriate action. We then just change our Mcam post to put out G116 T*** instead of T*** M6.

OATC1
(TOOL CHANGE MACRO)
(COMMAND IS G116 T?? Q??)
(T=DESIRED TOOL #, Q=NEXT TOOL #)
(G116 T0 WILL CLEAR TOOL FROM SPINDLE)
(FEB 5, 2004)
M329
M5
G0Z5000
IF[PT EQ 0]NMT
IF[VTLCN EQ PT] NFIN
IF[VNTOL EQ PT] NCH
IF[VNTOL EQ 0] NCHG
M64
NCHG T=PT M6
NFIN IF[VNTOL EQ 0] NTL
IF[VNTOL NE PQ] NCLR
GOTO NEND
NCH M6
GOTO NFIN
NCLR M64
NTL T=PQ
GOTO NEND
NMT IF[VNTOL EQ 0]NRID
M64
NRID M63
M6
NEND RTS

 

My brain just exploded. lol 

I'll dive into this and see if I can implement this.

Where does the library file go?

Link to comment
Share on other sites
On 4/28/2017 at 3:04 PM, huskermcdoogle said:

Still need commas!  

    "IF[VNTOL GT 0]N1",e$
      "IF[VATOL NE ", *first_tool$, "]N2",e$ 
      "IF[VATOL EQ ", *first_tool$, "]N3",e$
      "N1M64",e$
      "N2M329",e$
      *first_tool$, "M6",e$
      "N3",e$
      "M279(CHIP AUGER ON)",e$

 

Or did it work without?

This is how it's spitting out the code, it looks fine to me, but it's giving an error on the 2nd line. It doesn't like the way it's worded I guess.

IF[VNTOL GT 0]N1
IF[VATOL NE T20]N2
IF[VATOL EQ T20]N3
N1M64
N2M329
T20M6
N3

Link to comment
Share on other sites

You are getting a "T" prefix character for the 'first_tool$' variable. You need to create your own "user-defined" variable, with a different Format Assignment, to output just the numeric value, and not output the "T" prefix.

At the top of your post, create a new variable:

my_tool : 0

Then, go to the Format Assignment area of the post, and add this line (after the other FMT lines...):

fmt ""  4  my_tool

Now, before your block of output code, set your variable equal to the 'first_tool$' variable, and use it for output:

      my_tool = first_tool$

      "IF[VNTOL GT 0]N1",e$
      "IF[VATOL NE ", *my_tool, "]N2",e$ 
      "IF[VATOL EQ ", *my_tool, "]N3",e$
      "N1M64",e$
      "N2M329",e$
      *first_tool$, "M6",e$
      "N3",e$
      "M279(CHIP AUGER ON)",e$ 

 

 

  • Like 1
Link to comment
Share on other sites
37 minutes ago, jeff said:

My brain just exploded. lol 

I'll dive into this and see if I can implement this.

Where does the library file go?

The Library file (.LIB extension) goes into the MD1 directory. When you are in auto or MDI there is a button on the screen bottom for Library programs. The procedure to register is in the special programming manual. I can also send you a pdf on it if you PM me your email address.

 

 

  • Like 1
Link to comment
Share on other sites
1 hour ago, Colin Gilchrist said:

You are getting a "T" prefix character for the 'first_tool$' variable. You need to create your own "user-defined" variable, with a different Format Assignment, to output just the numeric value, and not output the "T" prefix.

At the top of your post, create a new variable:


my_tool : 0

Then, go to the Format Assignment area of the post, and add this line (after the other FMT lines...):


fmt ""  4  my_tool

Now, before your block of output code, set your variable equal to the 'first_tool$' variable, and use it for output:


      my_tool = first_tool$

      "IF[VNTOL GT 0]N1",e$
      "IF[VATOL NE ", *my_tool, "]N2",e$ 
      "IF[VATOL EQ ", *my_tool, "]N3",e$
      "N1M64",e$
      "N2M329",e$
      *first_tool$, "M6",e$
      "N3",e$
      "M279(CHIP AUGER ON)",e$ 

 

 

OHH!! I didn't even notice the T in there!   :bonk:

 

 

  • Like 1
Link to comment
Share on other sites
7 hours ago, Greg Williams said:

Just change the parameter to alarm D, problem solved

 

MC user Parameter

no7 ATC/Tool exchange

Tick no 22 "The same T command as act tool is made alarm D"

 

Interesting. Is the D alarm something that lights the Red light but still allows the program to run?

 

EDIT: tested it.. yes it does run with the alarm :)

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