Skip to main content
1-Visitor
September 30, 2016
Question

G-Post FIL Help

  • September 30, 2016
  • 3 replies
  • 6654 views

After many years of dealing with minor edits to my G-Code, I am trying to put some final touches on my Posts. Does anyone have any ideas on how to get the posts to for out both the X and Y moves after it calls out the Work Offset? We have had issues with changing work offsets but the actual X or Y number is the same as the previous offset. This usual happens when we are running multiples of the same part.

I am also trying to come up with a way to have the post retract every time there is a rotation (both on 3+2 trunnions and on Horizontals). We currently manually put a Go Delta move in at the last toolpath before an index but depending on where the CSYS is for the next work offset the Post processor sometimes uses Retract Logic instead of Approach Logic. Which causes the Z to move into the part before the tombstone rotates. I am thinking that I would like the post to output a G0G90G53Z0. before every rotation but I want to make sure that it knows after the rotation where it is positioned.

Any ideas are greatly appreciated...

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.

3 replies

21-Topaz II
September 30, 2016

You can catch an offset setting and process it to add other things via something like the following:

$$

$$ This is my code to output the G54 to G59 that is valid for our machines.

$$

CIMFIL/ ON, SET, OFSETL

  OFSTYP = POSTF ( 6, 5 )

  OFSREG = POSTF ( 7, 5 )

  IF ( OFSTYP .EQ. 1 ) THEN

    IF ( OFSREG.GE.54.AND.OFSREG.LE.59.AND.CURREG.NE.OFSREG ) THEN

      CURREG = OFSREG

      OFSCMD = TEXT/ 'G', CONVI, OFSREG, 2, '$'

      INSERT/ OFSCMD

    ENDIF

  ENDIF

CIMFIL/ OFF

You could add some other "INSRT/" statements to put, for example, a G00 motion. Unfortunately, I can't seem to find any POSTF register that keeps track of the current X, Y, and Z coordinates (plus B and C, I suppose if you're on a higher degree-of-freedom machine). But if, like me, you handle every "GOTO", you could have a variable that stores the last X, Y, and Z that were seen. So you could then use those stored values to write a G00 or G01 or whatever to the output.

You could do something similar, I suppose, if there is a specific FIL code that is in the CL file to signal a rotation. I do something like this for tool changes (bring the machine home, orient the spindle, then get the tool and for safety, an optional stop, etc.)

1-Visitor
September 30, 2016

Insert a retract line as Kenneth advised then read ahead to get your next move values and create lines for the next move. We handle B values for indexing in the w/o register and a spherical clearance zone for 5axis. This is part of what I use for verticals and horizontals-

    DMY=POSTF(15,0,1)  $$SAVE POINTER LOCATION AND SEE WHAT HAPPENS AFTER W/O CHANGE
    DO/RAH2,RH2=1,10,1
    RH2=1   $$RESET LOOP VAR
    DMY=POSTF(14)  $$GET NEXT RECORD
    TPSRCH=POSTF(7,2)  $$GET 2ND WORD
    GTSRCH=POSTF(7,3)  $$GET 3RD WORD
    IF (TPSRCH.EQ.14000.OR.GTSRCH.EQ.(ICODEF(LOADTL)))THEN    $$END LOOP AT FINI-LOADTL                

     RH2=11
    ENDIF
    IF (TPSRCH.EQ.5000)THEN     $$VERIFY AND CREATE NEXT XYZ MOVES AND END LOOP
     XPOS=POSTF(7,6)
     YPOS=POSTF(7,7)
     ZPOS=POSTF(7,8)
     PREFUN/0,NEXT       $$MOVE TO NEXT X Y
     POSTN/OUT,X,XPOS,Y,YPOS
     REPEAT/Z,G,43
     REPEAT/Z,H,TLADJ                $$PICK UP TOOL L OFFSET - TLADJ IS SET AT LOADTL
     POSTN/OUT,Z,ZPOS   $$MOVE TO NEXT Z
     RH2=11
    ENDIF
    RAH2)CONTIN
    DMY=POSTF(15,0,2)

Josh

1-Visitor
October 5, 2016

That's some good looking FIL code Josh.  You must have been paying attention in the G-Post class. 

Fred

1-Visitor
October 5, 2016

Fred that's the nicest thing anyone has said to me all day!

1-Visitor
October 3, 2016

Ken / Josh,

Thank you for the information... I will try these methods as soon as I can!