top of page

Improving the fixture offset recording custom macro

Updated: May 21, 2019

Suggested by Alejandro Garcia of Extreme Machine, Inc.


In a previous blog post, we published a custom macro to record the settings for fixture offsets one through six (G54 through G59). The custom macro actually creates a program that will allow the user to reset fixture offsets to their current values at some future date. It does so by outputting the commands through the communications port using a DPRNT command.


While this program is very helpful, we recently had a request for doing the same thing with the extended fixture offset option (when users have a total of 54 fixture offsets). What follows is the program that does this – outputting the standard fixture offsets (G54 though G59) as well as the additional 48 fixture offsets. And again, a program is created that – when reloaded and executed once – will reset all fixture offset registers to their current settings.


Two notes:

First, the program uses system variables to attain fixture offset settings. As you know, system variables vary from one Fanuc control model to another. This program is for a 16M control. You’ll have to determine which system variables are related to your control if it is not a 16M and modify the program accordingly.


Second, and in similar fashion, the L word of G10 (which is being used to reload fixture offsets) also varies from one Fanuc control model to another. You will have to determine which L word is related to the extended fixture offset option and modify the program accordingly.

  • O9069(OUTPUT ALL FIXTURE OFFSETS)

  • (*************)

  • (G54 THRU G59)

  • (THEN)

  • (G54.1P1 THRU G54.1P48)

  • (************)

  • #9=6.(SET NO. OF FIXTURE OFFSETS -- MAX VALUE=6)

  • #18=4.(SET NO. OF AXIS REGISTERS -- MAX VALUE=15)

  • #4=1.(INITIALIZE FIXTURE OFFSET COUNTER)

  • POPEN(OPEN THE OUTPUT PORT)

  • DPRNT[]

  • DPRNT[O1010]

  • DPRNT[]

  • DPRNT[M00]

  • WHILE[#4LE#9]DO1(WRITE A FIXTURE OFFSET PROGRAM)

  • #33=5200.+[#4*20.](SET FIXTURE OFFSET POINTER #)

  • #24=#[#33+1.](GET THE X-AXIS REGISTER DATA)

  • 25=#[#33+2.](GET THE Y-AXIS REGISTER DATA)

  • #26=#[#33+3.](GET THE Z-AXIS REGISTER DATA)

  • #2=#[#33+4.](GET THE B-AXIS REGISTER DATA)

  • DPRNT[G90*G10*L2*P#4[10]*X#24[34]*Y#25[34]*Z#26[34]*B#2[43]]

  • #4=#4+1.(INCREMENT FIXTURE OFFSET COUNTER)

  • END1

  • (OUTPUT G54.1P1 THRU P48 WO)

  • #9=48.(SET NO. OF FIXTURE OFFSETS -- MAX VALUE=48)

  • #18=4.(SET NO. OF AXIS REGISTERS -- MAX VALUE=15)

  • #4=0.

  • DPRNT[]

  • DPRNT[M00]

  • WHILE[#4LT#9]DO2(WRITE A FIXTURE OFFSET PROGRAM)

  • #33=7000.+[#4*20.](SET FIXTURE OFFSET POINTER #)

  • #24=#[#33+1.](GET THE X-AXIS REGISTER DATA)

  • #25=#[#33+2.](GET THE Y-AXIS REGISTER DATA)

  • #26=#[#33+3.](GET THE Z-AXIS REGISTER DATA)

  • #2=#[#33+4.](GET THE B-AXIS REGISTER DATA)

  • #5=#4+1

  • DPRNT[G90*G10*L20*P#5[20]*X#24[34]*Y#25[34]*Z#26[34]*B#2[43]]

  • #4=#4+1.

  • (INCREMENT FIXTURE OFFSET COUNTER)

  • END2

  • DPRNT[]

  • DPRNT[M30]

  • PCLOS(CLOSE THE OUTPUT PORT)

  • M30


212 views0 comments

Recent Posts

See All

Commentaires


bottom of page