Hello Guest it is April 11, 2021, 10:01:16 AM

Author Topic: get and set the G54 ,G55..  (Read 1063 times)

0 Members and 1 Guest are viewing this topic.

get and set the G54 ,G55..
« on: January 02, 2019, 07:01:40 PM »
i want to add 2 DRO or text box ,that i can set thre the offset for that specific gcode file
for this  ,i thought  that first i need read which home the file use(g54 or 55 or...)
then add the offset in the text box(also save in reg file ,so can set back to original value when finish the file)
then just add in X ,Y ,Z the value in text box
but i didn't find in the API how i read the current home value and how i set it
Re: get and set the G54 ,G55..
« Reply #1 on: January 02, 2019, 07:29:46 PM »
the fixture data for the G54-G59 data is in pound variables which are in the registers and can be viewed/editied etc.

This  pic comes from poppabears list:


« Last Edit: January 02, 2019, 07:32:40 PM by joeaverage »
My wife left with my best friend...
     and I miss him!
Re: get and set the G54 ,G55..
« Reply #2 on: January 02, 2019, 08:06:23 PM »
thanks alot
Re: get and set the G54 ,G55..
« Reply #3 on: January 03, 2019, 06:34:18 PM »
#4014 Is your current offset.
Did some testing.  You can change it, but it is a little weird...
Put this in MDI and it will change offset:  

#4014 = 540  Sets G54
#4014 = 550  Sets G55

I was writing a probing macro and found this information.
Starting at #4002 - #4018 there are several machine settings.
Chad Byrd
Re: get and set the G54 ,G55..
« Reply #4 on: January 03, 2019, 06:49:03 PM »
Did some more testing.
This is acting strange.
If you watch the status bar above the message bar; changing #4014 will update the Current Work Offset on the status bar, but it doesn't seem to change the core.
I set X offset for G54 to 1.00 G55 to 2.00 etc... and changed #4014 to 540, 550, 560, etc.. just to test all offsets, it won't update the position, it only changes what is displayed in the status bar.
So, I'm not really sure why you're able to change this and it update the status bar but not what Mach actually sees.
Chad Byrd

Offline smurph

  • *
  •  1,373 1,373
  • "That there... that's an RV."
    • View Profile
Re: get and set the G54 ,G55..
« Reply #5 on: January 13, 2019, 11:08:53 PM »
Those system variables reflect the LAST modal state set through G code.  They are informational only meaning they don't actually set the mode.  However, we do read them for presenting the modal states on the screen.  So changing them basically only changes what is displayed. 

The Fanuc manuals do not specify that those registers are read only.  But they do not state that writing to them has any effect either.  So we don't enforce the read only attribute and we don't allow the modal states to be changed by them either.  Besides, there is already an interface for changing the modal state for #4014.  G54, G55, G56, etc...  :) 

I don't believe setting the offset with the #4014 system variable would work too well with the G54.1 style extended offset either.  So I'm inclined to think that those variables really are for informational purposes only. 

Also, a word of warning:  Be careful with setting system variables with screen elements (DROs or text boxes) while a program is running.  It may not have the desired effects because of the look ahead!