cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X

Gpost Fil help request for Fanuc Oi

gbaggett
1-Visitor

Gpost Fil help request for Fanuc Oi

I am trying to get the text from the PPRINT to come after the tool change and just cant seem to figure it out.  I can get the Tool Name to go there (I've gotten the Tool Offset Number there as

well) but I would really like it all there.  Here is what I have now in the Cimfil section:

CIMFIL/ON,PPRINT $$ starts on all PPRINT

MESS = TEXT/CLW $$ extract the text of the PPRINT

TESTV=TEXT/'TOOL NAME'$$ Value to test for

RSLT=INDXF(MESS,TESTV)$$ Test if TESTV is in MESS

IF(RSLT.EQ.0) THEN

PPRINT/MESS $$ process the PPRINT

ELSE

OKTOOL=1 $$ flag tool name programmed

TOOLNM=TEXT/MESS $$ store tool name

ENDIF

CIMFIL/OFF $$ end of CIMFIL on PPRINT

 

CIMFIL/ON,LOADTL $$ starts on all LOADTL

DMY = POSTF(20) $$ save current CL record

IF(FTOOL.EQ.0) THEN $$ check if first tool change

FTOOL=1 $$ reset the flag

SEQNO/OFF $$ stop sequence numbering

SEQNO/10,INCR,10 $$ restart sequence numbering

ENDIF

DMY=POSTF(21) $$ restore saved record (LOADTL)

DMY=POSTF(13) $$ process LOADTL

IF(OKTOOL.EQ.1) THEN

OKTOOL=0 $$ reset the flag

PPRINT/TOOLNM $$ output the message

INSERT/'G57 X0.0 Y0.0;'

ENDIF

CIMFIL / OFF $$ end of CIMFIL on LOADTL

Which results in:

N4510 G0 Z0.25;

N4520 M5;

(TOOL POSITION NUMBER : 9);

(               TOOL COMMENTS);

(90 CHAMFER TOOL);

(TOOL OFFSET NUMBER : 9);

N4530 M9;

N4540 G28G91Z0.0;

N4550 G28G91Y0.0;

N4560 G90G00;

N4570 G20;

N4580 T9 M6;

N4590 T7;

N4600 M01;

(TOOL NAME : 45-CARB-CHAMFER-T9-H9);

N4610 G57 X0.0 Y0.0;

N4620 S4000 M3;

N4630 G0 X0.0911 Y-1.0783;

N4640 G43 Z0.25 H9 M8;

If I add the section (below) to remove the TOOL COMMENTS line,

CIMFIL/ON,PPRINT

$$ macro to remove PPRINT with the word COMMENTS

MESS=TEXT/CLW           $$ Extract text of PPRINT

TEST=TEXT/'COMMENTS'

OK=INDXF(MESS,TEST)

IF (OK.EQ.0) THEN

  $$ PPRINT text does not include COMMENTS

  XX=POSTF(13)  $$ Process CL rec.

ENDIF

CIMFIL/OFF

I get results with none of the text being below the tool change.

N4490 G0 Z0.25;

N4500 M5;

(TOOL NAME : 45-CARB-CHAMFER-T9-H9);

(TOOL POSITION NUMBER : 9);

(90 CHAMFER TOOL);

(TOOL OFFSET NUMBER : 9);

N4510 M9;

N4520 G28G91Z0.0;

N4530 G28G91Y0.0;

N4540 G90G00;

N4550 G20;

N4560 T9 M6;

N4570 T7;

N4580 M01;

N4590 S4000 M3;

N4600 G0 X0.0911 Y-1.0783;

N4610 G43 Z0.25 H9 M8;

What I would really like to achieve is this (below) so the tool can change and stop at the M01 and, the operator can see the tool information before it scrolls up too far.  Without having to copy and paste.

N4500 G0 Z0.25;

N4510 M5;

N4520 M9;

N4530 G28G91Z0.0;

N4540 G28G91Y0.0;

N4550 G90G00;

N4560 G20;

N4570 T9 M6;

N4580 T7;

N4590 M01;

(TOOL NAME : 45-CARB-CHAMFER-T9-H9);

(TOOL POSITION NUMBER : 9);

(90 CHAMFER TOOL);

(TOOL OFFSET NUMBER : 9);

N4600 S4000 M3;

N4610 G0 X0.0911 Y-1.0783;

N4620 G43 Z0.25 H9 M8;

Any help would be greatly appreciated.  I have many hours working on this and I just cant seem to figure it out.  Thanks.


This thread is inactive and closed by the PTC Community Management Team. If you would like to provide a reply and re-open this thread, please notify the moderator and reference the thread. You may also use "Start a topic" button to ask a new question. Please be sure to include what version of the PTC product you are using so another community member knowledgeable about your version may be able to assist.
ACCEPTED SOLUTION

Accepted Solutions

Graeme,

You basically have to replicate what you did for the TOOL NAME for the other three types of PPRINT messages into the PPRINT CIMFIL section and add modify the LOADTL CIMFIL section the same way to output these messages where you want them.  You also need to incorporate the code to skip the COMMENTS messages into the PPRINT section also.  You cannot have more than one CIMFIL/ON,... section for any type of CL record since the first one in the FIL file will be the only one that runs.

Fred

View solution in original post

9 REPLIES 9

Are you using the Option File Gen to put these lines in before the tool change:

N4540 G28G91Z0.0;

N4550 G28G91Y0.0;

N4560 G90G00;

N4570 G20;

Try using FIL only for these kind of things, otherwise it is difficult to figure out which file wins the battle of where to place modified data.

Josh

Yes, I am using the Option File Gen to put those lines in before the tool change.  I was wondering if doing it through the FIL might be a better idea but, since i am having such a hard time with it, I shelved that idea.  I will try to incorporate those lines into it instead.  Thank you.

Graeme,

You basically have to replicate what you did for the TOOL NAME for the other three types of PPRINT messages into the PPRINT CIMFIL section and add modify the LOADTL CIMFIL section the same way to output these messages where you want them.  You also need to incorporate the code to skip the COMMENTS messages into the PPRINT section also.  You cannot have more than one CIMFIL/ON,... section for any type of CL record since the first one in the FIL file will be the only one that runs.

Fred

Thanks Fred,  I did try that with little success but I may have just given up too early as I wasn't sure that was the correct path.  I also tried multiple CIMFIL/ON's but, as you know, that was a failure.  I didn't realize you can't have more than one.  That explains a lot of my frustration.

GabrielZaha
13-Aquamarine
(To:gbaggett)

You can disable the output of the tool comment from the manufacturing assembly (Machine Tool Setup / PPRINT / Modify)

pprint_1.jpg

Select the TOOL_COMMENTS row and click the "No" button.

pprint_2.jpg

This way the tool comments are not going to be output to the CL file.

Thank you for the reply but I do want the actual tool comments (i.e. (90 CHAMFER TOOL);),  I just don't want the (               TOOL COMMENTS); line.

Graeme, listening to Fred is always a good place to start. If you have the time and will be doing a lot of post work, I highly recommend getting down to Austin to take his class.

Kenneth Farley has some helpful pieces of FIL code posted in the forum, it may help you to track them down.

It is also funny how much time we spend on things that are inconsequential to the functioning of the code.

Josh

Hi Graeme,

Instead of just stripping out the tool comment, look for the tool comments line, and then save the next 4 comment lines in global variables.  Then exit the PPrint without running or without the POSTF(13) command.

Then in the loadtool routine, print out the 4 variables after completing POSTF(13) since the cimfil does not end until you reach the CIMFIL/OFF line.

You seem to know the language so it won't be hard for you to complete.

I don't put my comment after the tool, but before, so I don't have to do this, but my code comes out a lot different than yours (I did a lot of manipulation).  For example:

N10 (OP 10 - OUTER PROFILE)

N20 (1/2 CARBIDE END MILL)

T23 M6

M1

N25 G0 G43 G54 G90 X.263 Y-4.8837 Z4. H23 S2291 M3

Z2. T12 D23

Z.2

...

You write your code the way that you and your employees are comfortable with, but this format will work fine on your Oi.

Like Fred said, there can only be one CIMFIL/ON routine for each major word.

Have fun!

I was able to finish it primarily using Fred's advise and used the same format over and over for each of the text lines within one CIMFIL/PPRINT.  I left the other lines in using the option file generator because it is working and I have spent enough time on this already.

I appreciate the help and probably couldn't have figured it out without it.  I thought I would post the result in case there is anyone else that could use it in the future.

$$ ****************************************************

$$ *         C i m f i l    S e c t i o n s           *

$$ ****************************************************

CIMFIL/ON,PPRINT $$ Starts on all PPRINT

   DMY=POSTF(20) $$Save Current CL Record

TTEXT=TEXT/CLW $$ extract the text

NAME=TEXT/'PART NAME' $$ Value to test for

PTNM=INDXF(TTEXT,NAME) $$ Extract NAME from TTEXT

IF(PTNM.EQ.0) THEN $$ Test if PART NAME in TTEXT

ELSE

PARTNM=TEXT/TTEXT $$ store PART NAME

ENDIF

DATE=TEXT/'DATE TIME' $$ Value to test for

DTTM=INDXF(TTEXT,DATE) $$ Extract DATE from TTEXT

IF(DTTM.EQ.0) THEN $$ Test if DATE TIME in TTEXT

ELSE

DATETM=TEXT/TTEXT $$ store DATE TIME

ENDIF 

CC=TEXT/'CUTCOM REGISTER' $$ Value to test for

CTCM=INDXF(TTEXT,CC) $$ Extract CUTCOM from TTEXT

IF(CTCM.EQ.0) THEN  $$ Test if CUTCOM in TTEXT

ELSE

CRGSTR=TEXT/TTEXT $$ store CUTCOM REGISTER

ENDIF 

TESTV=TEXT/'TOOL NAME' $$ Value to test for

RSLT=INDXF(TTEXT,TESTV) $$ Extract the text TOOL NAME

IF(RSLT.EQ.0) THEN  $$ Test if TOOL NAME in TTEXT

ELSE

OKTOOL=1 $$ flag tool name programmed

TOOLNM=TEXT/TTEXT $$ store TOOL NAME

ENDIF

         

TEXTP=TEXT/'TOOL POSITION NUMBER'$$ Value to test for

POSIT=INDXF(TTEXT,TEXTP) $$ Extract the text TOOL POSITION NUMBER

IF(POSIT.EQ.0) THEN $$ Test if TOOL POSITION NUMBER in TTEXT

ELSE

TOOLPO=TEXT/TTEXT $$ store TOOL POSITION NUMBER

ENDIF

TEXTO=TEXT/'TOOL OFFSET NUMBER'$$ Value to test for

OFST=INDXF(TTEXT,TEXTO)$$ Extract the text  TOOL OFFSET NUMBER

IF(OFST.EQ.0) THEN  $$ Test if TOOL OFFSET NUMBER in TTEXT

TOOLOF=TEXT/TTEXT $$ store TOOL OFFSET NUMBER

ENDIF

TCOM=TEXT/'COMMENTS' $$ Value to test for

OK=INDXF(TTEXT,TCOM) $$ Extract the text TOOL COMMENTS

IF(OK.EQ.0) THEN $$ Test if TOOL COMMENTS in TTEXT

TOOLCM=TEXT/TTEXT $$ store COMMENTS

ENDIF

CIMFIL/OFF $$ end of CIMFIL on PPRINT

CIMFIL/ON,LOADTL $$ starts on all LOADTL

DMY = POSTF(20) $$ save current CL record

IF(FTOOL.EQ.0) THEN $$ check if first tool change

   PPRINT/PARTNM

   PPRINT/DATETM

FTOOL=1 $$ reset the flag

SEQNO/OFF $$ stop sequence numbering

SEQNO/20,INCR,10 $$ restart sequence numbering

ENDIF

DMY=POSTF(21) $$ restore saved record (LOADTL)

DMY=POSTF(13) $$ process LOADTL

IF(OKTOOL.EQ.1) THEN

OKTOOL=0 $$ reset the flag

PPRINT/TOOLNM $$ output the message

PPRINT/TOOLOF $$ output the message

PPRINT/TOOLPO $$ output the message

PPRINT/TOOLCM $$ output the message

PPRINT/CRGSTR $$ output the message

INSERT/'G57 X0.0 Y0.0;'

ENDIF

CIMFIL / OFF $$ end of CIMFIL on LOADTL

The output is code that we are familiar with.  The tool name having dedicated numbers is the way we have always done things in our small production shop.  Getting the processor to also output the numbers underneath helps to ensure I have programmed it correctly and not missed a bad call-out.  The machinist should also be able to catch it more easily.  I wish Creo would let me keep numbers attached to specific tools without always trying to change them to the next available pocket as it is easy to miss.

Now, when the code stops at the M01, the tool info just fits in the controls Program Check screen where we usually run it.

O3978;

N10 G00G17G20G40G49G80G90;

(PART NAME : CS-3978-DC-REV00);

(DATE TIME : 15-APR-16 10:52:59);

N20 G20;

N30 T1 M6;

N40 T5;

N50 M01;

(TOOL NAME : 750-SPOTDRILL-T1-H1);

(SPOT DRILL);

(TOOL POSITION NUMBER : 1);

(TOOL OFFSET NUMBER : 1);

(CUTCOM REGISTER : N/A);

N60 G57 X0.0 Y0.0;

N70 S600 M3;

N80 G0 X2.8921 Y2.8921;

N90 G43 Z0.1 H1 M8;

Announcements


Top Tags