Thanks Danny!
Works like a charm =)

/Peter




2017-02-07 7:43 GMT+01:00 Danny Miller <dan...@austin.rr.com>:

> This has troubled me for awhile.  I have the XHC-HB04 pendant. On it is
> a "1/2" button.  It is very useful when your CNC job uses center datum
> and you want to place it in the center of your stock.  e.g. you've got a
> X=10" wide board, you do X=0 at one side, move to the other size and
> X=10, hit "1/2" and you want the current work coords to shift so X=5
> there and now X=0 is the center of the board.
>
> Troubles are, LinuxCNC doesn't provide clear access to absolute value of
> current work coords.  It can't be work offsets, and it needs to apply to
> the currently selected work coord system.  I THOUGHT I had a solution
> but I later discovered it was bugged and useless.
>
> But here's the solution!
>
> #18
> MDI_COMMAND = G10 L20 P0 X[#5420/2]
> #19
> MDI_COMMAND = G10 L20 P0 Y[#5421/2]
>
> G10 L20 = "set to a calculated value that makes the current coordinates
> become the given value"
>
> P0 = "in the active coordinate system"
>
> #5420= "Current relative position in the active coordinate system
> including all offsets and in the current program units for X, Y, Z, A,
> B, C, U, V & W, volatile."
>
> Boom.  That was way too hard to figure out.
>
> Danny
>
>
>
>
> ------------------------------------------------------------
> ------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> _______________________________________________
> Emc-users mailing list
> Emc-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/emc-users
>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to