-
Notifications
You must be signed in to change notification settings - Fork 293
TinyG Status Reports
Status reports return the dynamic gcode model state so the UI can know what's happening in the machine. They can be automatically generated by the system and they can be requested directly.
The following variables can be reported in a status report
Request | Response | Description
---------|--------------|-------------
n | line_number | Gcode line number (N word)
vel | velocity | actual velocity - may be different than programmed feed rate
feed | feed_rate | gcode programmed feed rate (F word)
stat | machine_state | 0=reset, 2=stop, 3=end, 4=run, 5=hold, 6=homing
unit | units_mode | 0=inch, 1=mm
coor | coordinate_system | 0=g53, 1=g54, 2=g55, 3=g56, 4=g57, 5=g58, 6=g59
momo | motion_mode | 0=traverse, 1=straight feed, 2=cw arc, 3=ccw arc
plan | plane_select | 0=XY plane, 1=XZ plane, 2=YZ plane
path | path_control_mode | 0=exact stop, 1=exact path, 2=continuous
dist | distance_mode | 0=absolute distance, 1=incremental distance
frmo | feed_rate_mode | 0=units-per-minute-mode, 1=inverse-time-mode
gc | gcode_block | gcode block currently being run
posx | x work position | X work position in prevailing units (mm or inch)
posy | y work position
posz | z work position
posa | a work position
posb | b work position
posc | c work position
mpox | x absolute position | X machine position in absolute coordinate system (mm or inch). Also Y,Z,A,B,C
g92x | offset | G92 origin offset for X axis (also Y,Z,A,B,C)
g54x | coord system 1 offset | X axis G54 coordinate system offset (also Y,Z,A,B,C)
g55x | coord system 2 offset | X axis G55 coordinate system offset (also Y,Z,A,B,C)
g56x | coord system 3 offset | X axis G56 coordinate system offset (also Y,Z,A,B,C)
g57x | coord system 4 offset | X axis G57 coordinate system offset (also Y,Z,A,B,C)
g58x | coord system 5 offset | X axis G58 coordinate system offset (also Y,Z,A,B,C)
g59x | coord system 6 offset | X axis G59 coordinate system offset (also Y,Z,A,B,C)
g28x | G28 home position | X axis G28 home position (also Y,Z,A,B,C)
g30x | G30 home position | X axis G30 home position (also Y,Z,A,B,C)
It's worth noting that any gettable variable can be put in a status report - the above variables are listed as they represent the Gcode model state. For example {"fv":""} would return the firmware version.
It's also worth noting that any variable can be independently queried as an individual variable, and axis variables (e.g. pos, G55) can be queried as a group, e.g. {"pos":""}, or {"g55":""}
are parent/child objects with a "sr" parent and one or more child NV pairs, as in the example below.
{"sr": {"line":1245, "xpos":23.4352, "ypos":-9.4386, "zpos":0.125, "vel":600, "unit":"1", "stat":"5"}"f":[1,0,19,2131]}}
The following use-cases are supported:
*SET status report fields. The elements to be included in a status reports may be specified by setting values to 'true'. The elements will be returned on subsequent SR requests in the order they were provided in the SET command. (I know, dictionaries are supposed to be unordered, but the firmware will record and return back the attributes in the order listed). There is no incremental setting of elements - all attributes are reset and must be specified in a single SET command. For example, the string below could be used to set up the status report in the example above, and eliminate any previously recorded settings. Note that the 'true' term is not in quotes - it is actually the JSON value for true, not a string that says "true". Examples:
{"sr":{"line":true,"xpos":true, "ypos":true,"zpos":true, "vel":true, "unit":true, "stat":true}} {"status_report":{"line":true,"xpos":true, "ypos":true,"zpos":true, "vel":true, "unit":true, "stat":true}} - this is the same as the above but using the friendly name
*GET an on-demand status report - this will return a single status report. All forms below are equivalent. The first two use friendly names, the last two use mnemonic tokens.
{"status_report":""} {"status_report":null} the 'null' value is used instead of "" in this case. Either are accepted. {"sr":""} {"sr":null}
*Request an ad-hoc report. An ad-hoc query for one or more name/value pairs can be performed. This is technically not a "status report", but it's useful. This is really just multiple GET requests in a single JSON object.
{"line":"","xpos":"","ypos":"","zpos":"","vel":"","unit":"","stat":""} request GETS for the listed values {"line":1245, "xpos":23.4352, "ypos":-9.4386, "zpos":0.125, "vel":600, "unit":"mm", "stat":"run"} returns the NV pairs. Note the absence of the SR parent object.
*Automatic status reports. Status reports may also be automatically generated by setting the status report interval to a non-zero value. Reports will be generated during movement every N milliseconds, and at the end of each Gcode bloack that causes a movement, and when the machine has stopped (i.e. at the end of the final move in the buffer).
{"status_interval":0} disable automatic status reports {"status_interval":200} request status reports every 200 ms during movement {"si":200} same as above
Getting Started Pages
- Home
- What is TinyG?
- Getting Started
- Connecting TinyG
- Configuring TinyG
- Sending Gcode Files
- Flashing TinyG
- Chilipeppr
Reference Pages
- TinyG Help Page
- TinyG Tuning
- TinyG Command Line
- TinyG JSON
- Gcode Support
- Homing and Limits
- Inch and MM Units
- Alarms and Exceptions
- Coordinate Systems
- Status Codes
- Status Reports
- Power Management
- Feedhold and Resume
- Licensing
- TinyG v8 Data Sheet
Discussion Topics
- Test-Drive-TinyG
- Jerk Controlled Motion
- Gcode Parsing
- Shapeoko Setup
- OX CNC TinyG Guide
- Creating Gcode Files
- Milling With Noisy Spindles
- Stepper Motors and Power Supplies
- Text Wrappers and Transaction IDs
- Using External Drivers
- TinyG Projects
Chilipeppr
- Chilipeppr
- Chilipeppr Advanced Usage
- Chilipeppr Archive and Restore Parameters
- ChiliPeppr PCB Auto Level
- Automatic Z Homing When Milling PCBs
Troubleshooting
Developer Pages