<p>This is simply the formalised definition of the syntax, so that a parser can be written to interpret any legal G-code. Without this, there is ambiguity - not in the general operation, but in the bounds of what is 'legal' and what should be rejected.</p>

<p>Taking the example <code>X+053</code>, this is not a position of 53 units, it is:</p>

<ul>
<li>Address <code>X</code></li>
<li>Sign is required (in this implementation)</li>
<li>Leading zeros can be ommitted</li>
<li>Up to 5 orders of magnitude before the decimal</li>
<li>Up to 3 digits of precision after the decimal</li>
</ul>

<p>This means that X can range from +99999.999 to -99999.999 - an interpretation which matches the verbiage at the bottom of the page.</p>

<p>As hinted at in the text, it is <em>possible</em> to use various fixed precision number systems (think using integer milimetres rather than decimal metres), and also to anchor at the most significant bit, so <code>001</code> could represent <code>00100.000</code>. It may help to remember that these specifications were designed in the days of dedicated hardware rather than general purpose computers, when the standard portable storage medium held ~600 kB, and relate to actual machines that had been developed long before that.</p>

CC BY-SA 4.0
2018-08-14T07:00:57.213Z
`The second digit indicates the number of decimal decades ahead of the decimal sign` This does not seem the usual meaning of the address: e.g. X+053 usually indicates position/increment to X53, not that there are 5 digits ahead of the decimal sign. Am I understanding it totally wrong?
Adrian Maire
CC BY-SA 4.0
2018-08-14T07:03:40.533Z
Additionally, the format is formalised in the chapter 5 already.
Adrian Maire
CC BY-SA 4.0
2018-08-14T10:20:56.080Z
Updated my answer to explain now I realise what is going on...
Sean Houlihane
CC BY-SA 4.0
2018-08-14T14:03:59.063Z
Thanks for your answer. But why is required this syntax, why to invent an X+053 when it could say "The system has to specify/document if leading zeros can be omitted"
Adrian Maire
CC BY-SA 4.0
2018-08-14T14:10:35.107Z
It's not specifying _if_ leading zeros can be omitted, it's specifying an international notation for capturing the number system in use - written ~50 years after these codes started to evolve. Imagine you want a modern machine to consume old G-code, you need a clear way to define _how_ to parse it.
Sean Houlihane
CC BY-SA 4.0
2018-08-14T14:20:43.910Z
Sorry to be a bit slow to get it. Where would you write this `%:/DS N03 G02 X+053..`? In you g-code program? Is it a setting in the user interface of the machine? Maybe a `#define` in the parser implementation?
Adrian Maire
CC BY-SA 4.0
2018-08-14T14:23:35.897Z
I'm not sure this code would ever have been intended to be _directly_ consumed in a machine readable form. The closest (I think) would be the #define for the parser. Think of it as kind of similar to the LOCALE settings.
Sean Houlihane
CC BY-SA 4.0
2018-08-14T14:24:57.583Z
Let us [continue this discussion in chat](https://chat.stackexchange.com/rooms/81644/discussion-between-adrian-maire-and-sean-houlihane).
Adrian Maire
CC BY-SA 4.0
2018-08-13T19:06:16.817Z
2018-08-14T14:25:51.347Z
2018-08-14T14:25:51.347Z
Sean Houlihane
<p>For developing a CNC system, I am reading the "ISO 6983-1:2009". </p>

<p>In it, there are several references to what they call "Detailed format classification" which I struggle to understand:</p>

<blockquote>
  <p>A classification of the data in a block shall be used to specify the programming detail for a system and machine configuration. This is called the detailed format classification and is described in Annex C.</p>
</blockquote>

<p>...</p>

<blockquote>
  <p>Zero omission shall be specified in the detailed format classification (see Annex C).  </p>
</blockquote>

<p>...</p>

<blockquote>
  <p>The number of digits shall be designated by the detailed format classification ( see Annex C).</p>
</blockquote>

<p>...</p>

<p>It seem this "Detailed format classification" is sort of a definition of the machine on which the program will run. But in this case, I do not understand why this is something part of the program and not some values of the control system.</p>

<p>My question is: What exactly is this "Detailed format classification"?</p>

<ul>
<li>Is it part of the program?</li>
<li>What is it purpose?</li>
</ul>

<p><a href="https://i.sstatic.net/lXEJv.png" rel="noreferrer"><img src="https://i.sstatic.net/lXEJv.png" alt="enter image description here"></a></p>

CC BY-SA 4.0
2018-08-11T20:19:29.230Z
Detailed information is on each line sequence, for example N01 is the number of line command, then N02 is the other line sequence, then N03; the user or the interfase to create his own code determines if the line number commands are one by one or 10 by 10 to insert manually inside other line commands like S parameters, `M03` and `M04` functions to enable or disable other mechanism that the G-code generator can't do. This command lines N01 to N9999999. When an ISO is called is to standarize the way document some procedure or instruction; this way everybody who knows the code can read it easily.
Fernando Baltazar
CC BY-SA 4.0
2018-08-12T08:45:40.783Z
@FernandoBaltazar Please refrain from answering via comments. Make it a full answer.
Trish
CC BY-SA 4.0
2018-08-12T08:51:03.140Z
@Trish: His comment IMO does not answer the question, that is why it is a comment and not an answer. Or do I understand it wrong?
Adrian Maire
CC BY-SA 4.0
2018-08-12T08:57:08.863Z
it is more than just a comment, but an answer attempt.
Trish
CC BY-SA 4.0
2018-08-13T05:06:18.167Z
@Trish This is a hint to read the detailed ISO-6983 classification, not an attempt to answer the full question. A tip normally gives a direction where the people  want to go. But if the people who ask has no notion about ISO Standars and  Programming at least Gcode they will not understand the hint; probably they will comment that the answer has no their answer and I could get a vote down. Also my comment suggest that is a part of the program and the purpose according his questions.
Fernando Baltazar
CC BY-SA 4.0
2018-08-13T06:28:19.660Z
For clarification: the question is specifically about the annex C: "Detailed format classification". In other words, I can read/write g-code and have a decent knowledge about standards entities like ISO. The comment of @FernandoBaltazar, seem to me to address the general G-code and ISO topic, more than the "Annex C".  

For example, usually G02 is for circular motion, but in this case, the x+053 does not indicate relative/absolute position, but the number of digits left/right of the decimal sign?
Adrian Maire
CC BY-SA 4.0
2018-08-13T21:00:47.833Z
@AdrianMaire :D a previous line should have the position of the new hole, if is indicated the position then is absolute, if not the position is relative; the movements +053 are relative to the position. Thanks God you can read and write gcode.
Fernando Baltazar
CC BY-SA 4.0
2018-08-14T10:23:48.247Z
@FernandoBaltazar Don't fear the down votes. You have the choice to delete any answer which gains too many downvotes or turns out to be wrong. Answers in comments that turn into discussions are bad, can't be edited (and I think in this case are actually wrong)
Sean Houlihane
<g-code><cnc>
What is the "Detailed format classification" of the ISO 6983 (G-Code spec)
Adrian Maire
# What is the "Detailed format classification" of the ISO 6983 (G-Code spec)

(Asked by: username_0 on 2018-08-11)

For developing a CNC system, I am reading the "ISO 6983-1:2009".

In it, there are several references to what they call "Detailed format classification" which I struggle to understand:

> A classification of the data in a block shall be used to specify the programming detail for a system and machine configuration. This is called the detailed format classification and is described in Annex C.

...

> Zero omission shall be specified in the detailed format classification (see Annex C).

...

> The number of digits shall be designated by the detailed format classification ( see Annex C).

...

It seem this "Detailed format classification" is sort of a definition of the machine on which the program will run. But in this case, I do not understand why this is something part of the program and not some values of the control system.

My question is: What exactly is this "Detailed format classification"?

* Is it part of the program?
* What is it purpose?

[![enter image description here](https://i.sstatic.net/lXEJv.png)](https://i.sstatic.net/lXEJv.png)

**Tags:** g-code, cnc

> **Comments:**
> **username_1**: Detailed information is on each line sequence, for example N01 is the number of line command, then N02 is the other line sequence, then N03; the user or the interfase to create his own code determines if the line number commands are one by one or 10 by 10 to insert manually inside other line commands like S parameters, `M03` and `M04` functions to enable or disable other mechanism that the G-code generator can't do. This command lines N01 to N9999999. When an ISO is called is to standarize the way document some procedure or instruction; this way everybody who knows the code can read it easily.  
> **username_2**: @username_1 Please refrain from answering via comments. Make it a full answer.  
> **username_0**: @username_2: His comment IMO does not answer the question, that is why it is a comment and not an answer. Or do I understand it wrong?  
> **username_2**: it is more than just a comment, but an answer attempt.  
> **username_1**: @username_2 This is a hint to read the detailed ISO-6983 classification, not an attempt to answer the full question. A tip normally gives a direction where the people  want to go. But if the people who ask has no notion about ISO Standars and  Programming at least Gcode they will not understand the hint; probably they will comment that the answer has no their answer and I could get a vote down. Also my comment suggest that is a part of the program and the purpose according his questions.  
> **username_0**: For clarification: the question is specifically about the annex C: "Detailed format classification". In other words, I can read/write g-code and have a decent knowledge about standards entities like ISO. The comment of @username_1, seem to me to address the general G-code and ISO topic, more than the "Annex C".    For example, usually G02 is for circular motion, but in this case, the x+053 does not indicate relative/absolute position, but the number of digits left/right of the decimal sign?  
> **username_1**: @username_0 :D a previous line should have the position of the new hole, if is indicated the position then is absolute, if not the position is relative; the movements +053 are relative to the position. Thanks God you can read and write gcode.  
> **username_3**: @username_1 Don't fear the down votes. You have the choice to delete any answer which gains too many downvotes or turns out to be wrong. Answers in comments that turn into discussions are bad, can't be edited (and I think in this case are actually wrong)  

---

## 1 answers

### Answer by username_3 on 2018-08-13. Score: 4 | Accepted answer

This is simply the formalised definition of the syntax, so that a parser can be written to interpret any legal G-code. Without this, there is ambiguity - not in the general operation, but in the bounds of what is 'legal' and what should be rejected.

Taking the example `X+053`, this is not a position of 53 units, it is:

* Address `X`
* Sign is required (in this implementation)
* Leading zeros can be ommitted
* Up to 5 orders of magnitude before the decimal
* Up to 3 digits of precision after the decimal

This means that X can range from +99999.999 to -99999.999 - an interpretation which matches the verbiage at the bottom of the page.

As hinted at in the text, it is *possible* to use various fixed precision number systems (think using integer milimetres rather than decimal metres), and also to anchor at the most significant bit, so `001` could represent `00100.000`. It may help to remember that these specifications were designed in the days of dedicated hardware rather than general purpose computers, when the standard portable storage medium held ~600 kB, and relate to actual machines that had been developed long before that.

> **Comments:**
> **username_0**: `The second digit indicates the number of decimal decades ahead of the decimal sign` This does not seem the usual meaning of the address: e.g. X+053 usually indicates position/increment to X53, not that there are 5 digits ahead of the decimal sign. Am I understanding it totally wrong?  
> **username_0**: Additionally, the format is formalised in the chapter 5 already.  
> **username_3**: Updated my answer to explain now I realise what is going on...  
> **username_0**: Thanks for your answer. But why is required this syntax, why to invent an X+053 when it could say "The system has to specify/document if leading zeros can be omitted"  
> **username_3**: It's not specifying _if_ leading zeros can be omitted, it's specifying an international notation for capturing the number system in use - written ~50 years after these codes started to evolve. Imagine you want a modern machine to consume old G-code, you need a clear way to define _how_ to parse it.  
> **username_0**: Sorry to be a bit slow to get it. Where would you write this `%:/DS N03 G02 X+053..`? In you g-code program? Is it a setting in the user interface of the machine? Maybe a `#define` in the parser implementation?  
> **username_3**: I'm not sure this code would ever have been intended to be _directly_ consumed in a machine readable form. The closest (I think) would be the #define for the parser. Think of it as kind of similar to the LOCALE settings.  
> **username_0**: Let us [continue this discussion in chat](https://chat.stackexchange.com/rooms/81644/discussion-between-username_0-and-username_3).  

---

