Can't you just issue a g28.1 and read the current values in 5161-5169?

http://linuxcnc.org/docs/html/gcode/g-code.html#gcode:g28-g28.1

On Mon, Jul 26, 2021, 1:15 PM Rob C <rclandro...@gmail.com> wrote:

> couple of options...
>
> switch to another offset (g59) and that may provide you with the machine
> coordinates, given they are not likely to be offset from m53.... except if
> G91 temp offset has been applied, in which case you could subtract g92 from
> g59 and it "should" (never tried it and not near a machine) provide you
> with g53 coords...
>
> http://linuxcnc.org/docs/html/gcode/overview.html#_parameters
>
> 5321-5330 - Coordinate System 6, G59 for X, Y, Z, A, B, C, U, V, W & R.
> Persistent
>
> *5210* - 1 if "G52" or "G92" offset is currently applied, 0 otherwise.
> Volatile by default; persistent if *DISABLE_G92_PERSISTENCE = 1* in the
> *[RS274NGC]* section of the *.ini* file
>
> *5211-5219* - Shared "G52" and "G92" offset for X, Y, Z, A, B, C, U, V & W.
> Volatile by default; persistent if *DISABLE_G92_PERSISTENCE = 1* in the
> *[RS274NGC]* section of the *.ini* file
>
>
>
>    -
>
>    *5220* - Coordinate System number 1 - 9 for G54 - G59.3. Persistent.
>
> ill have a play later....
>
> On Mon, 26 Jul 2021, 18:31 Feral Engineer, <theferalengin...@gmail.com>
> wrote:
>
> > That's not what I'm looking for.
> >
> > I can position with G53, but I want to read that G53 position into a
> > variable. On fanuc and mits controls, machine position for X is #5021 and
> > absolute position for X from current offset is #5041, much like how skip
> > position is #5061. When you're writing macro programs for things,
> sometimes
> > you want to do calculations from current abs position and relate it back
> to
> > machine coordinate. Only way I can do it currently is store the values i
> > want in an ini (tool setter position, etc) and access it that way, which
> is
> > fine for static values, but sometimes you want to capture a current
> machine
> > position in real time for the macro calculations.
> >
> > An example would be setting a work offset:
> >
> > G10 L2 P1 X#5021 Y#5022
> >
> >
> >
> >
> > Phil T.
> > The Feral Engineer
> >
> > Check out my LinuxCNC tutorials, machine builds and other antics at
> > www.youtube.com/c/theferalengineer
> >
> > Help support my channel efforts and coffee addiction:
> > www.patreon.com/theferalengineer
> >
> > On Mon, Jul 26, 2021, 1:00 PM Nicklas SB Karlsson <n...@nksb.eu> wrote:
> >
> > > >  5420 gives me current position from my work offset zero. I want
> > current
> > > > position from my machine home (g53) position
> > >
> > > Then you use "G53 Move in Machine Coordinates"? Or?
> > >
> > > > Phil T.
> > > > The Feral Engineer
> > > >
> > > > Check out my LinuxCNC tutorials, machine builds and other antics at
> > > > www.youtube.com/c/theferalengineer
> > > >
> > > > Help support my channel efforts and coffee addiction:
> > > > www.patreon.com/theferalengineer
> > > >
> > > > On Sun, Jul 25, 2021, 5:02 PM <fr...@franksworkshop.com.au> wrote:
> > > >
> > > > > Isn't that #5420?
> > > > >
> > > > > -----Original Message-----
> > > > > From: Feral Engineer <theferalengin...@gmail.com>
> > > > > Sent: Sunday, 25 July 2021 7:39 AM
> > > > > To: EMC developers <emc-developers@lists.sourceforge.net>
> > > > > Subject: [Emc-developers] Question for the devs
> > > > >
> > > > > Hello devs,
> > > > >
> > > > > I have a question. In Fanuc land, #5021 is the X axis system
> variable
> > > for
> > > > > machine home position (axis 1, really), 5022 is axis 2, etc.
> Linuxcnc
> > > does
> > > > > not have these variables. I'm wondering how hard it would be to add
> > > them?
> > > > > Having access to the machine coordinate system is helpful in
> writing
> > > logic
> > > > > for various things (as is goto, but I'm not pressing my luck).
> Unless
> > > > > there's an alternate variable I could use, like #<_axis_1_mach_pos>
> > > > > something like that? Also, not sure how familiar you guys are with
> > G65
> > > and
> > > > > G66 macro calls. Is this something up for consideration in the
> > future?
> > > Just
> > > > > curious is all. I'm a macro maniac.
> > > > >
> > > > > Tyia
> > > > >
> > > > >
> > > > > Phil T.
> > > > > The Feral Engineer
> > > > >
> > > > > Check out my LinuxCNC tutorials, machine builds and other antics at
> > > > > www.youtube.com/c/theferalengineer
> > > > >
> > > > > Help support my channel efforts and coffee addiction:
> > > > > www.patreon.com/theferalengineer
> > > > >
> > > > > _______________________________________________
> > > > > Emc-developers mailing list
> > > > > Emc-developers@lists.sourceforge.net
> > > > > https://lists.sourceforge.net/lists/listinfo/emc-developers
> > > > >
> > > > >
> > > > >
> > > > > _______________________________________________
> > > > > Emc-developers mailing list
> > > > > Emc-developers@lists.sourceforge.net
> > > > > https://lists.sourceforge.net/lists/listinfo/emc-developers
> > > > >
> > > >
> > > > _______________________________________________
> > > > Emc-developers mailing list
> > > > Emc-developers@lists.sourceforge.net
> > > > https://lists.sourceforge.net/lists/listinfo/emc-developers
> > >
> > >
> > > --
> > > Nicklas SB Karlsson <n...@nksb.eu>
> > >
> > >
> > > _______________________________________________
> > > Emc-developers mailing list
> > > Emc-developers@lists.sourceforge.net
> > > https://lists.sourceforge.net/lists/listinfo/emc-developers
> > >
> >
> > _______________________________________________
> > Emc-developers mailing list
> > Emc-developers@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/emc-developers
> >
>
> _______________________________________________
> Emc-developers mailing list
> Emc-developers@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/emc-developers
>

_______________________________________________
Emc-developers mailing list
Emc-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-developers

Reply via email to