Skip to content

Report extensions

Terje edited this page Feb 25, 2021 · 17 revisions

Typographical conventions

Convention Description
{ } Braces indicates the items within them are optional.
< > Chevrons indicates the item within is a variable or a constant.
<axis bitmask> A bitfield where bit 0 represents the X-axis, bit 1 the Y-axis etc...
<axis values> A comma separated list of decimal values
| Used within < > as a separator for allowed literal values.

Realtime report

[<Idle|Run|Hold|Jog|Alarm|Door|Check|Home|Sleep|Tool>{:<substatus>}|<WPos:|MPos:><axis positions>{|Bf:<block buffers free>,<RX characters free>}{|Ln:<line number>}{|FS:<feed rate>,<programmed rpm>{,<actual rpm>}}{|PN:<signals>}{|WCO:<axis offsets>}{|WCS:G<coordinate system>}{|Ov:<overrides>}{|A:<accessory status>}{|MPG:<0|1>}{|H:<0|1>{,<axis bitmask>}}{|D:<0|1>}{|Sc:<axisletters>}{|TLR:<0|1>}{|FW:<firmware>}]

A new status, Tool has been added for the tool change protocol.

Note that a report with the Home status is now pushed before the homing sequence starts. While homing status report requests are queued and not responded to.

Optional substatuses can be added to some statuses depending on $10 setting flags.

Run{:<1|2>} - feed hold pending or probing.
1 - feed hold pending. A feed hold issued during a spindle synchronized motion will be delayed until this is finished. Until then this substate will be added.
2 - is probing motion.

Alarm{:<alarm code>} - current alarm code. Note that is is always added starting from build 20201212 if alarm code is > 0 and the report is requested by sending 0x87.

Enhanced element |PN:<signals>
<signals> is a string containing any of the following letters:

P - probe triggered
O - probe disconnected, new
X - X limit switch asserted
Y - Y limit switch asserted
Z - Z limit switch asserted
A - A limit switch asserted, new
B - B limit switch asserted, new
C - C limit switch asserted, new
D - Door switch asserted
R - Reset switch asserted
H - Feed hold switch asserted
S - Cycle start switch asserted
E - E-Stop switch asserted, new
L - Block delete switch asserted, new
T - Optional program stop switch asserted, new
W - Motor warning, new
M - Motor fault, new

Enhanced element |A:<accessory status
<accessory status> is a string containing any of the following letters:

S - spindle is running in a clockwise direction (M3)
C - spindle is running in a counterclockwise direction (M4)
M - mist coolant is on (M7)
F - flood coolant is on (M8)
T - tool change is pending (M6), new

New element |WCS:G<coordinate system> added on a coordinate system change.

New element |MPG:<0|1> used to inform that a pendant has released/taken control of the input stream.
0 - pendant has released control, senders should resume normal operation - pendant enters listening mode.
1 - pendant has taken over input stream, senders should disable UI but still update controls.

New element |SD:<pct complete>{,<filename>} used to inform status when streaming from SD card.

New element |H:<0|1>{,<axis bitmask>} used to report homing status changes.
0 - homing is not complete.
1 - homing complete.
<axis bitmask> is only added if single axis homing commands are enabled, if so this contains which axes are currently homed.

This element is only added when homing is enabled and then on homing status changes.

New element |D:<0|1> used to report radius/diameter mode changes.
0 - G8: radius mode (default).
1 - G7: diameter mode.

This status is only reported when lathe mode is enabled.

New element |Sc:<axisletters> used to report which axes are scaled, only added on changes.

New element |TLR:<0|1> used to report tool length reference offset status, only added on changes.
0 - Not set.
1 - Set.

New element |FW:<firmware> used to report firmware type, only added to full report requested by 0x87.

This element is always reported as |FW:grblHAL and only when COMPATIBILITY_LEVEL is less than 2. Available from build 20210112.

Since some of the elements are only sent on changes an additional real time request character, 0x87, has been added for getting the complete status.

NOTE: Drivers and/or plugins may extend this report with additional elements. Senders should be able to handle that, as a minimum by ignoring them.

Other request responses or push messages

NOTE: all request responses are delimited with (ends with) ok after the last line.

Controller information extensions

$I response:

Number of supported axes and tool table entries added to the first line:
[OPT:<options>,<block buffer size>,<RX buffer size>{,<number of axes>{,<number of tool table entries>}}]

$I+ extended response adds these tags:

A second line of options is added:
[NEWOPT:<comma separated list>]

<comma separated list> can contain any of the following values:

ATC - Automatic tool change (M6) available.
BD - Block delete signal/handling available.
BT - Bluetooth streaming available.
ENUMS - code enumerations are available.
ES - E-stop signal available.
ETH - Ethernet streaming available.
HOME - Homing is enabled.
LATHE - Lathe mode configured.
MPG - MPG mode available (via secondary UART input).
NOPROBE - probe input not available.
ODO - odometer data is available.
OS - Optional stop signal/handling available.
PC - Probe connected signal/handling available.
PID - PID log data available.
RT+ or RT- - Top bit set versions of printable real-time commands plus some additional ones are available.
SD - SD Card streaming available.
SS - Spindle sync available.
TC - Manual tool change (M6) available.
WIFI - Wi-Fi streaming available.

A third line with firmware name added:

[FIRMWARE:grblHAL]

Optional driver info, e.g:

[DRIVER:MSP432]
[DRIVER VERSION:200928]
[DRIVER OPTIONS:USB]
[BOARD:CNC BoosterPack]

Optional plugin info, e.g.:

[PLUGIN:KEYPAD v1.00]

etc. for each plugin deciding to report itself.

Parser state report extensions

$G response:

[GC:<parser state>]

Some missing from legacy grbl and new gcodes added, these are:

G5 G7 G8 G43 G49 G50 G51 G73 G81 G82 G83 G85 G86 G89 G96 G97 G98 G99 M1 M50 M51 M53 M56 M60

A new setting flag has been added to $10 for pushing this report on changes (following a status report request).

NOTE: Further codes may be added to this list as they become supported.

NGC parameters report extensions

$# response:

Offsets for G59.1, G59.2 and G59.3 has been added.

If scaling is active scaling factors are added:
[G51:<axis scaling factors>]

If homing is enabled axis home positions in machine coordinates are added together with a bitmask indicating which axis values are valid.

[HOME:<axis home positions>:<axis bitmask>]

If a tool table is available (a compile time option in grbl/config.h) tool table contents is added.

[T:<tool number>,<axis offsets>]

TLO report may include offsets for all axes, dependent on compatibility level.

[TLO:<<offset>|<axis offsets>>]

If tool length reference offset is set with the $TLR command, offset for the linear axis is added .
NOTE: This may change in future versions to include offsets for all axes. Senders parsing this tag should be coded to handle that.

[TLR:<tool length reference offset>]

Code sets and enumerations

Code sets and translations can be fetched from the controller, superseding the use of files that has to be kept in sync. Since grblHAL supports plugins and driver specific extensions it will be hard to keep senders up to date via files that has to be updated.

Alarm codes

Alarms can be enumerated with the $EA system command. Response is a line for each alarm.

[ALARMCODE:<code>|<message>|<description>]

[ALARMCODE:1|Hard limit|Hard limit has been triggered. Machine position is likely lost due to sudden halt. Re-homing is highly recommended.]

Error codes

Error codes can be enumerated with the $EA system command. Response is a line for each alarm.

[ERRORCODE:<code>|<message>|<description>]

[ERRORCODE:1|Expected command letter|G-code words consist of a letter and a value. Letter was not found.]

Settings

Settings can be enumerated with the $ES system command. Response is a line for each alarm.

[SETTING:<id>|<group id>|<name>|{<unit>}|<data type>|{<format}]|{<min>}|{<max>}]

  • <id> - setting id or number
  • <group id> - id to setting group the setting belongs to, see below. For advanced settings handling.
  • <name> - name or short description of setting.
  • <unit> - optional unit for setting.
  • <data type> - code for data type, see below.
  • <format> - format string or comma separated list of allowed values/labels for data type 1, 2, and 3.
  • <min> - optional minimum value allowed.
  • <max> - optional maximum value allowed.

Data types:

  • 0 - Boolean, typically rendered as a check box.
  • 1 - Bitfield, typically rendered as a column of check boxes.
    The <format> field contains a comma separated list of labels: the first corresponds to bit 0, second to bit 1 and so on.
  • 2 - Exlusive bitfield, typically rendered as a column of check boxes.
    The <format> field contains a comma separated list of labels: the first corresponds to bit 0, second to bit 1 and so on. When bit 0 is not set checkboxes for other bits should be disabled.
  • 3 - Radio buttons The <format> field contains a comma separated list of labels: the first corresponds to the value 0, second to value 1 and so on.
  • 4 - Axis mask, a bit field typically rendered as a column of check boxes. Number of check boxes corresponds to number of axes, bit 0 is for the X-axis, bit 1 for Y and so on.
  • 5 - Integer, typically rendered as a numeric input field.
  • 6 - Decimal, typically rendered as a numeric input field.
  • 7 - String.
  • 8 - Password, as string except data entry could be hidden.
  • 9 - IPv4, IP v4 address as a string in dot notation.

Data formats:

  • Numeric: start with - if negative values are allowed, a number of # or 0 characters, . for decimal point followed by a number of 0 characters.
    # - suppress if character in position is 0
    0 - do not suppress if character in position is 0
  • Strings: x(<n>) where <n> is the maximum number of characters allowed. E.g. x(32).

[SETTING:0|18|Step pulse time|microseconds|6|#0.0|2.0|]

Setting groups

Setting groups can be enumerated with the $EG system command. Response is a line for each group. Setting groups are hierachical and can be used for presenting settings in a grouped manner (treeview).

[SETTINGGROUP:<id>|<parent id>|<name>]

[SETTINGGROUP:1|0|General]


2021-01-20