---
tag: m0110
title: Set / Get Line Number
brief: Set or get the current (last-used) host command line number.
author: thinkyhead

group: hosts

codes: [ M110 ]
related: [ M999 ]

notes: "All these are valid host command lines: `N100 M110`, `M110 N100`, `N101 M110 N100`."

parameters:

- tag: N
  optional: false
  description: Line number
  values:
  - tag: line
    type: int

examples:

- pre: Set the last line to 56
  code: M110 N56

- since: 2.1.3
  pre: Report the last-set or last-processed line number
  code: |
    > M110
    Line: 1297

---

Hosts should use `M110` to set the current line number as-needed during a host-controlled print job. The last `N` value found in the line will be applied. Each line number sent by the host must be one higher than the previous line number, or the firmware will ignore the line and send an error requesting a resend of the missing line. This is one technique Marlin uses to keep in sync with hosts.

Since Marlin 2.1.3 this command without parameters reports the last line number processed out of the host command queue.
