Current coordinate system name output in M114

12 views
Skip to first unread message

Henner Zeller

unread,
May 15, 2018, 12:38:49 PM5/15/18
to beagleg-dev
Hi,
Since it is always useful to know in which coordinate system one is in currently, I've now added
this piece of information in the M114 output:

M114
X:0.000 Y:0.000 Z:100.000 E:0.000 (G55) [ABS. MACHINE CUBE X:0.000 Y:0.000 Z:100.000]

... hoping that doesn't mess up someone's parsing of that value in some code.

-h

Hartley Sweeten

unread,
May 15, 2018, 1:07:11 PM5/15/18
to Henner Zeller, beagleg-dev

Henner,

 

Maybe the (G55) should be after the CUBE info in case someone is just using sscanf() to parse

the information. But, that’s a minor issue.

 

The M114 output is basically:

{X/Y/Z/E current position} [ABS. MACHINE CUBE {X/Y/Z cube position}] ({homing state message}

 

So this will parse all the current info using sscanf():

"X:%f Y:%f Z:%f E:%f [ABS. MACHINE CUBE X:%f Y:%f Z:%f] (%s"

 

Adding the coordinate system to the info makes the output something like:

{X/Y/Z/E current position} [ABS. MACHINE CUBE {X/Y/Z cube position}] (G{offset}) ({homing state message}

 

So the new sscanf to get all the info would be:

"X:%f Y:%f Z:%f E:%f [ABS. MACHINE CUBE X:%f Y:%f Z:%f] (G%f) (%s"

 

G%f is needed to get the 59.1, 59.2, 59.3 offsets.

 

But, if the original format is used they will still get the current and cube positions. The final %s will then

get the offset instead of the homing state message.

 

Hartley

--
You received this message because you are subscribed to the Google Groups "beagleg-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleg-dev...@googlegroups.com.
To post to this group, send email to beagl...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleg-dev/CAEQqtJwK1fk1NcALoc%2BtwUbKK6TTnbdxtPaexv9EEU%2Bgqb_g1Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages