Skip to main content
1-Visitor
June 6, 2017
Solved

How to get Fixture offset value by using FIL?

  • June 6, 2017
  • 1 reply
  • 5665 views

Hello Programmer,

I met a problem of FIL that I need to get "Fixture offset" value by using FIL, I can't find the number code of "Fixture offset" in the Gpost. Can you teach me how to compile FIL to get "fixture offset value?  thanks!!

Have a good day!!

Mark Rao

Best answer by KenFarley

Ah, I see what you're doing. I only use the FIXT_OFFSET_REG setting in my sequences to assign one of the "valid" G54, G55,...,G59 values. For what you are doing, I suppose you could always use G54 and add on the "P" code. It might be easier if you just output the offset with its P code on a line by itself. Maybe with something like

CIMFIL/ ON, SET, OFSETL

  OFSTYP = POSTF ( 6, 5 )

  OFSREG = POSTF ( 7, 5 )

  IF ( OFSTYP .EQ. 1 ) THEN

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

      INSERT/ OFSCMD

  ENDIF

CIMFIL/ OFF

You'll probably have to do a bit of testing to get this to work just right.

1 reply

21-Topaz II
June 6, 2017

Here's the section of code I use to handle this:

--- [ Begin Code ] ---

$$

$$ --[ SET ]------------------------------------------------------------

$$

$$ None of the processors seem to handle the offset register indicated

$$ by the programmer, so this code will output it as the appropriate

$$ G-code.  Note that it is only output once per program or tool change,

$$ to avoid redundant calls from every NC sequence, which can cause

$$ troubles on some 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

--- [ End Code ] ---

Note that I only output the G54, G55, etc if it's a valid offset number (54 - 59), and if it is a "new" offset number. The current offset number is stored in a variable called "CURREG" in my code.

Hope this helps.

mrao1-VisitorAuthor
1-Visitor
June 6, 2017

 

Hello Kenneth,

 

 

Thanks for your help, thanks!!

 

 

After testing, I still can't post G54 in the CNC program. Do you know why?

 

 

I would like to use FIL to generate G54P1 or P2 etc when I was set up deference fixture offset in each cog of my machining part. ( Like following illustration ).

 

   

 

1st, I set up 1 into “FIXT_OFFSET_REG” parameter so that CL generated “SET/OFSETL, 1”.

 

   

 

2nd, I set up Minimum for 54, Maximum for 59 and Default for 54. Please note the default.

 

   

3rd, I used this POST to generate a CNC program like following contents.

 

   

 

My purpose, I want to know how to get “FIXT_OFFSET_REG” parameter value then insert a text “P” and the value in the G54 (Default value) by the side?  (Like G0G54P1X-.915Y-24.803)

Thanks so much for your help!!

Have a good day!!

Mark Rao

 

KenFarley21-Topaz IIAnswer
21-Topaz II
June 6, 2017

Ah, I see what you're doing. I only use the FIXT_OFFSET_REG setting in my sequences to assign one of the "valid" G54, G55,...,G59 values. For what you are doing, I suppose you could always use G54 and add on the "P" code. It might be easier if you just output the offset with its P code on a line by itself. Maybe with something like

CIMFIL/ ON, SET, OFSETL

  OFSTYP = POSTF ( 6, 5 )

  OFSREG = POSTF ( 7, 5 )

  IF ( OFSTYP .EQ. 1 ) THEN

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

      INSERT/ OFSCMD

  ENDIF

CIMFIL/ OFF

You'll probably have to do a bit of testing to get this to work just right.