|
From: John T. <gi...@gi...> - 2011-12-14 13:41:37
|
Docs: markup fixes Signed-off-by: John Thornton <jth...@gn...> http://git.linuxcnc.org/?p=emc2.git;a=commitdiff;h=366b850 --- docs/src/gcode/overview.txt | 141 ++++++++++++++++++++------------------ docs/src/gcode/overview_de.txt | 148 +++++++++++++++++++++------------------- docs/src/gcode/overview_es.txt | 148 +++++++++++++++++++++------------------- docs/src/gcode/overview_pl.txt | 144 ++++++++++++++++++++------------------ 4 files changed, 304 insertions(+), 277 deletions(-) diff --git a/docs/src/gcode/overview.txt b/docs/src/gcode/overview.txt index 7653aee..3717fb3 100644 --- a/docs/src/gcode/overview.txt +++ b/docs/src/gcode/overview.txt @@ -3,35 +3,35 @@ The EMC2 G Code language is based on the RS274/NGC language. The G Code language is based on lines of code. Each line (also called a -"block") may include commands to do several different things. Lines of +'block') may include commands to do several different things. Lines of code may be collected in a file to make a program. A typical line of code consists of an optional line number at the -beginning followed by one or more "words". A word consists of a letter +beginning followed by one or more 'words'. A word consists of a letter followed by a number (or something that evaluates to a number). A word may either give a command or provide an argument to a command. For -example, "`G1 X3`" is a valid line of code with two words. "`G1`" is a -command meaning "move in a straight line at the programmed feed -rate to the programmed end point", and "`X3`" provides an argument +example, 'G1 X3' is a valid line of code with two words. 'G1' is a +command meaning 'move in a straight line at the programmed feed +rate to the programmed end point', and 'X3' provides an argument value (the value of X should be 3 at the end of the move). Most EMC2 G Code commands start with either G or M (for -General and Miscellaneous). The words for these commands are called "G -codes" and "M codes." +General and Miscellaneous). The words for these commands are called 'G +codes' and 'M codes.' The EMC2 language has no indicator for the start of a program. The Interpreter, however, deals with files. A single program may be in a single file, or a program may be spread across several files. A file may demarcated with percents in the following way. The first non-blank -line of a file may contain nothing but a percent sign, "%", possibly +line of a file may contain nothing but a percent sign, '%', possibly surrounded by white space, and later in the file (normally at the end of the file) there may be a similar line. Demarcating a file with -percents is optional if the file has an `M2` or `M30` in it, but is +percents is optional if the file has an 'M2' or 'M30' in it, but is required if not. An error will be signalled if a file has a percent line at the beginning but not at the end. The useful contents of a file demarcated by percents stop after the second percent line. Anything after that is ignored. -The EMC2 G Code language has two commands (`M2` or `M30`), either of +The EMC2 G Code language has two commands ('M2' or 'M30'), either of which ends a program. A program may end before the end of a file. Lines of a file that occur after the end of a program are not to be executed. The interpreter does not even read them. @@ -42,7 +42,7 @@ A permissible line of input code consists of the following, in order, with the restriction that there is a maximum (currently 256) to the number of characters allowed on a line. - . an optional block delete character, which is a slash "/" . + . an optional block delete character, which is a slash '/' . . an optional line number. . any number of words, parameter settings, and comments. . an end of line marker (carriage return or line feed or both). @@ -52,8 +52,8 @@ Interpreter to signal an error. Spaces and tabs are allowed anywhere on a line of code and do not change the meaning of the line, except inside comments. This makes some -strange-looking input legal. The line "`G0X +0. 12 34Y 7`" is -equivalent to "`G0 x+0.1234 Y7`", for example. +strange-looking input legal. The line 'G0X +0. 12 34Y 7' is +equivalent to 'G0 x+0.1234 Y7', for example. Blank lines are allowed in the input. They are to be ignored. @@ -150,26 +150,29 @@ it is within 0.0001 of an integer. [[sub:Numbered-Parameters]] == Numbered Parameters -A numbered parameter is the pound character `#` followed by an +A numbered parameter is the pound character '#' followed by an integer between 1 and 5399. The parameter is referred to by this integer, and its value is whatever number is stored in the parameter. -A value is stored in a parameter with the = operator; for example "`#3 -= 15`" means "set parameter 3 to 15." A parameter setting does not -take +A value is stored in a parameter with the = operator; for example: +---- +#3 = 15 (set parameter 3 to 15) +---- + +A parameter setting does not take effect until after all parameter values on the same line have been found. For example, if parameter 3 has been previously set to 15 and - the line "`#3=6 G1 X#3`" is interpreted, a straight move to a point + the line '#3=6 G1 X#3' is interpreted, a straight move to a point where X equals 15 will occur and the value of parameter 3 will be 6. -The `#` character takes precedence over other operations, so that, for - example, "`#1+2`" means the number found by adding 2 to the value of +The '#' character takes precedence over other operations, so that, for + example, '#1+2' means the number found by adding 2 to the value of parameter 1, not - the value found in parameter 3. Of course, `#[1+2]` does mean the -value found in parameter 3. The `#` character may be repeated; for -example `##2` means the value of the parameter whose index is the + the value found in parameter 3. Of course, '#[1+2]' does mean the +value found in parameter 3. The '#' character may be repeated; for +example '##2' means the value of the parameter whose index is the (integer) value of parameter 2. The interpreter maintains a number of read-only parameters for a loaded @@ -195,16 +198,16 @@ tool: Named parameters work like numbered parameters but are easier to read. All parameter names are converted to lower case and have spaces and -tabs removed. Named parameters must be enclosed with `< >` marks. +tabs removed. Named parameters must be enclosed with '< >' marks. -`#<named parameter here>` is a local named parameter. By default, a +'#<named parameter here>' is a local named parameter. By default, a named parameter is local to the scope in which it is assigned. You can't access a local parameter outside of its subroutine - this is so that two subroutines can use the same parameter names without fear of one subroutine overwriting the values in another. -`#<_global named parameter here>` is a global named parameter. They +'#<_global named parameter here>' is a global named parameter. They are accessible from within called subroutines and may set values within subroutines that are accessible to the caller. As far as scope is concerned, they act just like regular @@ -245,38 +248,38 @@ version is running from G Code. [[sec:Expressions]] == Expressions -An expression is a set of characters starting with a left bracket `[` -and ending with a balancing right bracket `]` . In between the brackets +An expression is a set of characters starting with a left bracket '[' +and ending with a balancing right bracket ']' . In between the brackets are numbers, parameter values, mathematical operations, and other expressions. An expression is evaluated to produce a number. The expressions on a line are evaluated when the line is read, before anything on the line is executed. An example of an -expression is `[1 + acos[0] - [#3 ** [4.0/2]]]`. +expression is '[1 + acos[0] - [#3 ** [4.0/2]]]'. [[sec:Binary-Operators]] == Binary Operators Binary operators only appear inside expressions. There are four basic -mathematical operations: addition (`+`), subtraction (`-`), -multiplication (`*`), and division (`/`). There are three logical -operations: non-exclusive or (`OR`), exclusive or (`XOR`), and logical -and (`AND`). The eighth operation is the modulus operation (`MOD`). The -ninth operation is the "power" operation (`**`) of raising the number +mathematical operations: addition ('+'), subtraction ('-'), +multiplication ('\*'), and division ('/'). There are three logical +operations: non-exclusive or ('OR'), exclusive or ('XOR'), and logical +and ('AND'). The eighth operation is the modulus operation ('MOD'). The +ninth operation is the 'power' operation ('**') of raising the number on the left of the operation to the power on - the right. The relational operators are equality (`EQ`), inequality -(`NE`), strictly greater than (`GT`), greater than or equal to (`GE`), -strictly less than (`LT`), and less than or equal to (`LE`). + the right. The relational operators are equality ('EQ'), inequality +('NE'), strictly greater than ('GT'), greater than or equal to ('GE'), +strictly less than ('LT'), and less than or equal to ('LE'). The binary operations are divided into several groups according to their precedence. (see table <<cap:Operator-Precedence>>) If operations in different precedence groups are strung together (for -example in the expression `[2.0 / 3 * 1.5 - 5.5 / 11.0]`), operations +example in the expression '[2.0 / 3 * 1.5 - 5.5 / 11.0]'), operations in a higher group are to be performed before operations in a lower group. If an expression contains more than one operation - from the same group (such as the first `/` and `*` in the example), + from the same group (such as the first '/' and '*' in the example), the operation on the left is performed first. Thus, - the example is equivalent to: `[[[2.0 / 3] * 1.5] - [5.5 / 11.0]]` , -which is equivalent to to `[1.0 - 0.5]` , which is `0.5`. + the example is equivalent to: '[ [ [2.0 / 3] * 1.5] - [5.5 / 11.0] ]' , +which is equivalent to to '[1.0 - 0.5]' , which is '0.5'. The logical operations and modulus are to be performed on any real numbers, not just on integers. The number zero is equivalent to logical @@ -297,15 +300,15 @@ false, and any non-zero number is equivalent to logical true. [[sub:Unary-Operation-Value]] == Functions -A function is either "`ATAN` " followed by one expression divided by +A function is either 'ATAN' followed by one expression divided by another expression (for - example "`ATAN[2]/[1+3]`") or any other function name followed by an -expression (for example "`SIN[90]` "). The available functions are + example 'ATAN[2]/[1+3]') or any other function name followed by an +expression (for example 'SIN[90]'). The available functions are shown in table <<cap:Functions>>. - Arguments to unary operations which take angle measures (`COS`, `SIN`, -and `TAN` ) are in degrees. Values returned by unary operations which + Arguments to unary operations which take angle measures ('COS', 'SIN', +and 'TAN' ) are in degrees. Values returned by unary operations which return -angle measures (`ACOS`, `ASIN`, and `ATAN`) are also in degrees. +angle measures ('ACOS', 'ASIN', and 'ATAN') are also in degrees. .Functions[[cap:Functions]] @@ -328,12 +331,12 @@ angle measures (`ACOS`, `ASIN`, and `ATAN`) are also in degrees. |EXISTS[arg] | Check named Parameter |======================================== -The `FIX` function rounds towards the left (less positive or more +The 'FIX' function rounds towards the left (less positive or more negative) on -a number line, so that `FIX[2.8] =2` and `FIX[-2.8] = -3`, for -example. The `FUP` operation rounds towards the right (more positive +a number line, so that 'FIX[2.8] =2' and 'FIX[-2.8] = -3', for +example. The 'FUP' operation rounds towards the right (more positive or less negative) -on a number line; `FUP[2.8] = 3` and `FUP[-2.8] = -2`, for example. +on a number line; 'FUP[2.8] = 3' and 'FUP[-2.8] = -2', for example. The EXISTS function checks for the existence of a single named parameter. It takes only one named parameter and returns 1 if it exists @@ -353,7 +356,7 @@ For all other legal letters, a line may have only one word beginning with that letter. If a parameter setting of the same parameter is repeated on a line, -"`#3=15 #3=6`", for example, only the last setting will take effect. +'#3=15 #3=6', for example, only the last setting will take effect. It is silly, but not illegal, to set the same parameter twice on the same line. @@ -375,9 +378,9 @@ changing the meaning of the line. If the second group (the parameter settings) is reordered, there will be no change in the meaning of the line unless the same parameter is set more than once. In this case, only the last setting of the -parameter will take effect. For example, after the line "`#3=15 #3=6` " +parameter will take effect. For example, after the line '#3=15 #3=6' has been interpreted, the value of parameter 3 will be 6. If the - order is reversed to "`#3=6 #3=15`" and the line is interpreted, the + order is reversed to '#3=6 #3=15' and the line is interpreted, the value of parameter 3 will be 15. If the third group (the comments) contains more than one comment and @@ -386,16 +389,16 @@ is reordered, only the last comment will be used. If each group is kept in order or reordered without changing the meaning of the line, then the three groups may be interleaved in any way without changing the meaning of the line. For example, the line -"`g40 g1 #3=15 (foo) #4=-7.0`" has five items and means exactly the +'g40 g1 #3=15 (foo) #4=-7.0' has five items and means exactly the same thing in any of the 120 - possible orders (such as "`#4=-7.0 g1 #3=15 g40 (foo)`") for the five + possible orders (such as '#4=-7.0 g1 #3=15 g40 (foo)') for the five items. == Commands and Machine Modes Many commands cause the controller to change from one mode to another, and the mode stays active until some other command changes it -implicitly or explicitly. Such commands are called "modal". For +implicitly or explicitly. Such commands are called 'modal'. For example, if coolant is turned on, it stays on until it is explicitly turned off. The G codes for motion are also modal. If a G1 (straight move) command is given on one line, for example, it will be executed @@ -403,14 +406,14 @@ again on the next line if one or more axis words is available on the line, unless an explicit command is given on that next line using the axis words or canceling motion. -"Non-modal" codes have effect only on the lines on which they occur. +'Non-modal' codes have effect only on the lines on which they occur. For example, G4 (dwell) is non-modal. [[sec:Modal-Groups]] == Modal Groups (((Modal Groups))) -Modal commands are arranged in sets called "modal groups", and only +Modal commands are arranged in sets called 'modal groups', and only one member of a modal group may be in force at any given time. In general, a modal group contains commands for which it is logically impossible for two members to be in effect at the same time - like @@ -465,7 +468,7 @@ words appears on the line, the activity of the group 1 G-code is suspended for that line. The axis word-using G-codes from group 0 are G10, G28, G30, and G92. -It is an error to include any unrelated words on a line with `O-` flow +It is an error to include any unrelated words on a line with 'O-' flow control. == Comments @@ -476,9 +479,11 @@ parentheses () or for the remainder of a line using a semi-colon. The semi-colon is not treated as the start of a comment when enclosed in parentheses. - G0 (Rapid to start) X1 Y1 - G0 X1 Y1 (Rapid to start; but don't forget the coolant) - M2 ; End of program. +---- +G0 (Rapid to start) X1 Y1 +G0 X1 Y1 (Rapid to start; but don't forget the coolant) +M2 ; End of program. +---- == File Size @@ -538,9 +543,9 @@ G-code is most legible when at least one space appears before words. While it is permitted to insert white space in the middle of numbers, there is no reason to do so. -== Use "Center-format" arcs +== Use Center-format arcs -Center-format arcs (which use `I- J- K-` instead of `R-` ) behave more +Center-format arcs (which use 'I- J- K-' instead of 'R-' ) behave more consistently than R-format arcs, particularly for included angles near 180 or 360 degrees. @@ -553,7 +558,9 @@ over from previous programs and from the MDI commands. As a good preventative measure, put a line similar to the following at the top of all your programs: - G17 G20 G40 G49 G54 G80 G90 G94 +---- +G17 G20 G40 G49 G54 G80 G90 G94 +---- (XY plane, inch mode, cancel diameter compensation, cancel length offset, coordinate system 1, cancel motion, non-incremental motion, @@ -573,7 +580,7 @@ write no line of code that is the slightest bit ambiguous. Don't use and set a parameter on the same line, even though the semantics are well defined. Updating a variable to a new value, such as -`#1=[#1+#2`] is ok. +'#1=[#1+#2'] is ok. == Don't use line numbers diff --git a/docs/src/gcode/overview_de.txt b/docs/src/gcode/overview_de.txt index a065149..3717fb3 100644 --- a/docs/src/gcode/overview_de.txt +++ b/docs/src/gcode/overview_de.txt @@ -1,36 +1,37 @@ -= G Code Overview[[cha:Language-Overview]] +[[cha:Language-Overview]] += G Code Overview The EMC2 G Code language is based on the RS274/NGC language. The G Code language is based on lines of code. Each line (also called a -"block") may include commands to do several different things. Lines of +'block') may include commands to do several different things. Lines of code may be collected in a file to make a program. A typical line of code consists of an optional line number at the -beginning followed by one or more "words". A word consists of a letter +beginning followed by one or more 'words'. A word consists of a letter followed by a number (or something that evaluates to a number). A word may either give a command or provide an argument to a command. For -example, "`G1 X3`" is a valid line of code with two words. "`G1`" is a -command meaning "move in a straight line at the programmed feed -rate to the programmed end point", and "`X3`" provides an argument +example, 'G1 X3' is a valid line of code with two words. 'G1' is a +command meaning 'move in a straight line at the programmed feed +rate to the programmed end point', and 'X3' provides an argument value (the value of X should be 3 at the end of the move). Most EMC2 G Code commands start with either G or M (for -General and Miscellaneous). The words for these commands are called "G -codes" and "M codes." +General and Miscellaneous). The words for these commands are called 'G +codes' and 'M codes.' The EMC2 language has no indicator for the start of a program. The Interpreter, however, deals with files. A single program may be in a single file, or a program may be spread across several files. A file may demarcated with percents in the following way. The first non-blank -line of a file may contain nothing but a percent sign, "%", possibly +line of a file may contain nothing but a percent sign, '%', possibly surrounded by white space, and later in the file (normally at the end of the file) there may be a similar line. Demarcating a file with -percents is optional if the file has an `M2` or `M30` in it, but is +percents is optional if the file has an 'M2' or 'M30' in it, but is required if not. An error will be signalled if a file has a percent line at the beginning but not at the end. The useful contents of a file demarcated by percents stop after the second percent line. Anything after that is ignored. -The EMC2 G Code language has two commands (`M2` or `M30`), either of +The EMC2 G Code language has two commands ('M2' or 'M30'), either of which ends a program. A program may end before the end of a file. Lines of a file that occur after the end of a program are not to be executed. The interpreter does not even read them. @@ -41,7 +42,7 @@ A permissible line of input code consists of the following, in order, with the restriction that there is a maximum (currently 256) to the number of characters allowed on a line. - . an optional block delete character, which is a slash "/" . + . an optional block delete character, which is a slash '/' . . an optional line number. . any number of words, parameter settings, and comments. . an end of line marker (carriage return or line feed or both). @@ -51,8 +52,8 @@ Interpreter to signal an error. Spaces and tabs are allowed anywhere on a line of code and do not change the meaning of the line, except inside comments. This makes some -strange-looking input legal. The line "`G0X +0. 12 34Y 7`" is -equivalent to "`G0 x+0.1234 Y7`", for example. +strange-looking input legal. The line 'G0X +0. 12 34Y 7' is +equivalent to 'G0 x+0.1234 Y7', for example. Blank lines are allowed in the input. They are to be ignored. @@ -149,26 +150,29 @@ it is within 0.0001 of an integer. [[sub:Numbered-Parameters]] == Numbered Parameters -A numbered parameter is the pound character `#` followed by an +A numbered parameter is the pound character '#' followed by an integer between 1 and 5399. The parameter is referred to by this integer, and its value is whatever number is stored in the parameter. -A value is stored in a parameter with the = operator; for example "`#3 -= 15`" means "set parameter 3 to 15." A parameter setting does not -take +A value is stored in a parameter with the = operator; for example: +---- +#3 = 15 (set parameter 3 to 15) +---- + +A parameter setting does not take effect until after all parameter values on the same line have been found. For example, if parameter 3 has been previously set to 15 and - the line "`#3=6 G1 X#3`" is interpreted, a straight move to a point + the line '#3=6 G1 X#3' is interpreted, a straight move to a point where X equals 15 will occur and the value of parameter 3 will be 6. -The `#` character takes precedence over other operations, so that, for - example, "`#1+2`" means the number found by adding 2 to the value of +The '#' character takes precedence over other operations, so that, for + example, '#1+2' means the number found by adding 2 to the value of parameter 1, not - the value found in parameter 3. Of course, `#[1+2]` does mean the -value found in parameter 3. The `#` character may be repeated; for -example `##2` means the value of the parameter whose index is the + the value found in parameter 3. Of course, '#[1+2]' does mean the +value found in parameter 3. The '#' character may be repeated; for +example '##2' means the value of the parameter whose index is the (integer) value of parameter 2. The interpreter maintains a number of read-only parameters for a loaded @@ -194,16 +198,16 @@ tool: Named parameters work like numbered parameters but are easier to read. All parameter names are converted to lower case and have spaces and -tabs removed. Named parameters must be enclosed with `< >` marks. +tabs removed. Named parameters must be enclosed with '< >' marks. -`#<named parameter here>` is a local named parameter. By default, a +'#<named parameter here>' is a local named parameter. By default, a named parameter is local to the scope in which it is assigned. You can't access a local parameter outside of its subroutine - this is so that two subroutines can use the same parameter names without fear of one subroutine overwriting the values in another. -`#<_global named parameter here>` is a global named parameter. They +'#<_global named parameter here>' is a global named parameter. They are accessible from within called subroutines and may set values within subroutines that are accessible to the caller. As far as scope is concerned, they act just like regular @@ -244,38 +248,38 @@ version is running from G Code. [[sec:Expressions]] == Expressions -An expression is a set of characters starting with a left bracket `[` -and ending with a balancing right bracket `]` . In between the brackets +An expression is a set of characters starting with a left bracket '[' +and ending with a balancing right bracket ']' . In between the brackets are numbers, parameter values, mathematical operations, and other expressions. An expression is evaluated to produce a number. The expressions on a line are evaluated when the line is read, before anything on the line is executed. An example of an -expression is `[1 + acos[0] - [#3 ** [4.0/2]]]`. +expression is '[1 + acos[0] - [#3 ** [4.0/2]]]'. [[sec:Binary-Operators]] == Binary Operators Binary operators only appear inside expressions. There are four basic -mathematical operations: addition (`+`), subtraction (`-`), -multiplication (`*`), and division (`/`). There are three logical -operations: non-exclusive or (`OR`), exclusive or (`XOR`), and logical -and (`AND`). The eighth operation is the modulus operation (`MOD`). The -ninth operation is the "power" operation (`**`) of raising the number +mathematical operations: addition ('+'), subtraction ('-'), +multiplication ('\*'), and division ('/'). There are three logical +operations: non-exclusive or ('OR'), exclusive or ('XOR'), and logical +and ('AND'). The eighth operation is the modulus operation ('MOD'). The +ninth operation is the 'power' operation ('**') of raising the number on the left of the operation to the power on - the right. The relational operators are equality (`EQ`), inequality -(`NE`), strictly greater than (`GT`), greater than or equal to (`GE`), -strictly less than (`LT`), and less than or equal to (`LE`). + the right. The relational operators are equality ('EQ'), inequality +('NE'), strictly greater than ('GT'), greater than or equal to ('GE'), +strictly less than ('LT'), and less than or equal to ('LE'). The binary operations are divided into several groups according to their precedence. (see table <<cap:Operator-Precedence>>) If operations in different precedence groups are strung together (for -example in the expression `[2.0 / 3 * 1.5 - 5.5 / 11.0]`), operations +example in the expression '[2.0 / 3 * 1.5 - 5.5 / 11.0]'), operations in a higher group are to be performed before operations in a lower group. If an expression contains more than one operation - from the same group (such as the first `/` and `*` in the example), + from the same group (such as the first '/' and '*' in the example), the operation on the left is performed first. Thus, - the example is equivalent to: `[[[2.0 / 3] * 1.5] - [5.5 / 11.0]]` , -which is equivalent to to `[1.0 - 0.5]` , which is `0.5`. + the example is equivalent to: '[ [ [2.0 / 3] * 1.5] - [5.5 / 11.0] ]' , +which is equivalent to to '[1.0 - 0.5]' , which is '0.5'. The logical operations and modulus are to be performed on any real numbers, not just on integers. The number zero is equivalent to logical @@ -296,15 +300,15 @@ false, and any non-zero number is equivalent to logical true. [[sub:Unary-Operation-Value]] == Functions -A function is either "`ATAN` " followed by one expression divided by +A function is either 'ATAN' followed by one expression divided by another expression (for - example "`ATAN[2]/[1+3]`") or any other function name followed by an -expression (for example "`SIN[90]` "). The available functions are + example 'ATAN[2]/[1+3]') or any other function name followed by an +expression (for example 'SIN[90]'). The available functions are shown in table <<cap:Functions>>. - Arguments to unary operations which take angle measures (`COS`, `SIN`, -and `TAN` ) are in degrees. Values returned by unary operations which + Arguments to unary operations which take angle measures ('COS', 'SIN', +and 'TAN' ) are in degrees. Values returned by unary operations which return -angle measures (`ACOS`, `ASIN`, and `ATAN`) are also in degrees. +angle measures ('ACOS', 'ASIN', and 'ATAN') are also in degrees. .Functions[[cap:Functions]] @@ -327,12 +331,12 @@ angle measures (`ACOS`, `ASIN`, and `ATAN`) are also in degrees. |EXISTS[arg] | Check named Parameter |======================================== -The `FIX` function rounds towards the left (less positive or more +The 'FIX' function rounds towards the left (less positive or more negative) on -a number line, so that `FIX[2.8] =2` and `FIX[-2.8] = -3`, for -example. The `FUP` operation rounds towards the right (more positive +a number line, so that 'FIX[2.8] =2' and 'FIX[-2.8] = -3', for +example. The 'FUP' operation rounds towards the right (more positive or less negative) -on a number line; `FUP[2.8] = 3` and `FUP[-2.8] = -2`, for example. +on a number line; 'FUP[2.8] = 3' and 'FUP[-2.8] = -2', for example. The EXISTS function checks for the existence of a single named parameter. It takes only one named parameter and returns 1 if it exists @@ -352,7 +356,7 @@ For all other legal letters, a line may have only one word beginning with that letter. If a parameter setting of the same parameter is repeated on a line, -"`#3=15 #3=6`", for example, only the last setting will take effect. +'#3=15 #3=6', for example, only the last setting will take effect. It is silly, but not illegal, to set the same parameter twice on the same line. @@ -374,9 +378,9 @@ changing the meaning of the line. If the second group (the parameter settings) is reordered, there will be no change in the meaning of the line unless the same parameter is set more than once. In this case, only the last setting of the -parameter will take effect. For example, after the line "`#3=15 #3=6` " +parameter will take effect. For example, after the line '#3=15 #3=6' has been interpreted, the value of parameter 3 will be 6. If the - order is reversed to "`#3=6 #3=15`" and the line is interpreted, the + order is reversed to '#3=6 #3=15' and the line is interpreted, the value of parameter 3 will be 15. If the third group (the comments) contains more than one comment and @@ -385,16 +389,16 @@ is reordered, only the last comment will be used. If each group is kept in order or reordered without changing the meaning of the line, then the three groups may be interleaved in any way without changing the meaning of the line. For example, the line -"`g40 g1 #3=15 (foo) #4=-7.0`" has five items and means exactly the +'g40 g1 #3=15 (foo) #4=-7.0' has five items and means exactly the same thing in any of the 120 - possible orders (such as "`#4=-7.0 g1 #3=15 g40 (foo)`") for the five + possible orders (such as '#4=-7.0 g1 #3=15 g40 (foo)') for the five items. == Commands and Machine Modes Many commands cause the controller to change from one mode to another, and the mode stays active until some other command changes it -implicitly or explicitly. Such commands are called "modal". For +implicitly or explicitly. Such commands are called 'modal'. For example, if coolant is turned on, it stays on until it is explicitly turned off. The G codes for motion are also modal. If a G1 (straight move) command is given on one line, for example, it will be executed @@ -402,14 +406,14 @@ again on the next line if one or more axis words is available on the line, unless an explicit command is given on that next line using the axis words or canceling motion. -"Non-modal" codes have effect only on the lines on which they occur. +'Non-modal' codes have effect only on the lines on which they occur. For example, G4 (dwell) is non-modal. [[sec:Modal-Groups]] == Modal Groups (((Modal Groups))) -Modal commands are arranged in sets called "modal groups", and only +Modal commands are arranged in sets called 'modal groups', and only one member of a modal group may be in force at any given time. In general, a modal group contains commands for which it is logically impossible for two members to be in effect at the same time - like @@ -464,7 +468,7 @@ words appears on the line, the activity of the group 1 G-code is suspended for that line. The axis word-using G-codes from group 0 are G10, G28, G30, and G92. -It is an error to include any unrelated words on a line with `O-` flow +It is an error to include any unrelated words on a line with 'O-' flow control. == Comments @@ -475,9 +479,11 @@ parentheses () or for the remainder of a line using a semi-colon. The semi-colon is not treated as the start of a comment when enclosed in parentheses. - G0 (Rapid to start) X1 Y1 - G0 X1 Y1 (Rapid to start; but don't forget the coolant) - M2 ; End of program. +---- +G0 (Rapid to start) X1 Y1 +G0 X1 Y1 (Rapid to start; but don't forget the coolant) +M2 ; End of program. +---- == File Size @@ -529,9 +535,7 @@ position of each item on the line, but by the following list: == Use an appropriate decimal precision Use at least 3 digits after the decimal when milling in millimeters, -and at least 4 digits after the decimal when milling in inches. In -particular, arc tolerance checks are made to .001 and .0001 depending -on the active units. +and at least 4 digits after the decimal when milling in inches. == Use consistent white space @@ -539,9 +543,9 @@ G-code is most legible when at least one space appears before words. While it is permitted to insert white space in the middle of numbers, there is no reason to do so. -== Use "Center-format" arcs +== Use Center-format arcs -Center-format arcs (which use `I- J- K-` instead of `R-` ) behave more +Center-format arcs (which use 'I- J- K-' instead of 'R-' ) behave more consistently than R-format arcs, particularly for included angles near 180 or 360 degrees. @@ -554,7 +558,9 @@ over from previous programs and from the MDI commands. As a good preventative measure, put a line similar to the following at the top of all your programs: - G17 G20 G40 G49 G54 G80 G90 G94 +---- +G17 G20 G40 G49 G54 G80 G90 G94 +---- (XY plane, inch mode, cancel diameter compensation, cancel length offset, coordinate system 1, cancel motion, non-incremental motion, @@ -574,7 +580,7 @@ write no line of code that is the slightest bit ambiguous. Don't use and set a parameter on the same line, even though the semantics are well defined. Updating a variable to a new value, such as -`#1=[#1+#2`] is ok. +'#1=[#1+#2'] is ok. == Don't use line numbers diff --git a/docs/src/gcode/overview_es.txt b/docs/src/gcode/overview_es.txt index a065149..3717fb3 100644 --- a/docs/src/gcode/overview_es.txt +++ b/docs/src/gcode/overview_es.txt @@ -1,36 +1,37 @@ -= G Code Overview[[cha:Language-Overview]] +[[cha:Language-Overview]] += G Code Overview The EMC2 G Code language is based on the RS274/NGC language. The G Code language is based on lines of code. Each line (also called a -"block") may include commands to do several different things. Lines of +'block') may include commands to do several different things. Lines of code may be collected in a file to make a program. A typical line of code consists of an optional line number at the -beginning followed by one or more "words". A word consists of a letter +beginning followed by one or more 'words'. A word consists of a letter followed by a number (or something that evaluates to a number). A word may either give a command or provide an argument to a command. For -example, "`G1 X3`" is a valid line of code with two words. "`G1`" is a -command meaning "move in a straight line at the programmed feed -rate to the programmed end point", and "`X3`" provides an argument +example, 'G1 X3' is a valid line of code with two words. 'G1' is a +command meaning 'move in a straight line at the programmed feed +rate to the programmed end point', and 'X3' provides an argument value (the value of X should be 3 at the end of the move). Most EMC2 G Code commands start with either G or M (for -General and Miscellaneous). The words for these commands are called "G -codes" and "M codes." +General and Miscellaneous). The words for these commands are called 'G +codes' and 'M codes.' The EMC2 language has no indicator for the start of a program. The Interpreter, however, deals with files. A single program may be in a single file, or a program may be spread across several files. A file may demarcated with percents in the following way. The first non-blank -line of a file may contain nothing but a percent sign, "%", possibly +line of a file may contain nothing but a percent sign, '%', possibly surrounded by white space, and later in the file (normally at the end of the file) there may be a similar line. Demarcating a file with -percents is optional if the file has an `M2` or `M30` in it, but is +percents is optional if the file has an 'M2' or 'M30' in it, but is required if not. An error will be signalled if a file has a percent line at the beginning but not at the end. The useful contents of a file demarcated by percents stop after the second percent line. Anything after that is ignored. -The EMC2 G Code language has two commands (`M2` or `M30`), either of +The EMC2 G Code language has two commands ('M2' or 'M30'), either of which ends a program. A program may end before the end of a file. Lines of a file that occur after the end of a program are not to be executed. The interpreter does not even read them. @@ -41,7 +42,7 @@ A permissible line of input code consists of the following, in order, with the restriction that there is a maximum (currently 256) to the number of characters allowed on a line. - . an optional block delete character, which is a slash "/" . + . an optional block delete character, which is a slash '/' . . an optional line number. . any number of words, parameter settings, and comments. . an end of line marker (carriage return or line feed or both). @@ -51,8 +52,8 @@ Interpreter to signal an error. Spaces and tabs are allowed anywhere on a line of code and do not change the meaning of the line, except inside comments. This makes some -strange-looking input legal. The line "`G0X +0. 12 34Y 7`" is -equivalent to "`G0 x+0.1234 Y7`", for example. +strange-looking input legal. The line 'G0X +0. 12 34Y 7' is +equivalent to 'G0 x+0.1234 Y7', for example. Blank lines are allowed in the input. They are to be ignored. @@ -149,26 +150,29 @@ it is within 0.0001 of an integer. [[sub:Numbered-Parameters]] == Numbered Parameters -A numbered parameter is the pound character `#` followed by an +A numbered parameter is the pound character '#' followed by an integer between 1 and 5399. The parameter is referred to by this integer, and its value is whatever number is stored in the parameter. -A value is stored in a parameter with the = operator; for example "`#3 -= 15`" means "set parameter 3 to 15." A parameter setting does not -take +A value is stored in a parameter with the = operator; for example: +---- +#3 = 15 (set parameter 3 to 15) +---- + +A parameter setting does not take effect until after all parameter values on the same line have been found. For example, if parameter 3 has been previously set to 15 and - the line "`#3=6 G1 X#3`" is interpreted, a straight move to a point + the line '#3=6 G1 X#3' is interpreted, a straight move to a point where X equals 15 will occur and the value of parameter 3 will be 6. -The `#` character takes precedence over other operations, so that, for - example, "`#1+2`" means the number found by adding 2 to the value of +The '#' character takes precedence over other operations, so that, for + example, '#1+2' means the number found by adding 2 to the value of parameter 1, not - the value found in parameter 3. Of course, `#[1+2]` does mean the -value found in parameter 3. The `#` character may be repeated; for -example `##2` means the value of the parameter whose index is the + the value found in parameter 3. Of course, '#[1+2]' does mean the +value found in parameter 3. The '#' character may be repeated; for +example '##2' means the value of the parameter whose index is the (integer) value of parameter 2. The interpreter maintains a number of read-only parameters for a loaded @@ -194,16 +198,16 @@ tool: Named parameters work like numbered parameters but are easier to read. All parameter names are converted to lower case and have spaces and -tabs removed. Named parameters must be enclosed with `< >` marks. +tabs removed. Named parameters must be enclosed with '< >' marks. -`#<named parameter here>` is a local named parameter. By default, a +'#<named parameter here>' is a local named parameter. By default, a named parameter is local to the scope in which it is assigned. You can't access a local parameter outside of its subroutine - this is so that two subroutines can use the same parameter names without fear of one subroutine overwriting the values in another. -`#<_global named parameter here>` is a global named parameter. They +'#<_global named parameter here>' is a global named parameter. They are accessible from within called subroutines and may set values within subroutines that are accessible to the caller. As far as scope is concerned, they act just like regular @@ -244,38 +248,38 @@ version is running from G Code. [[sec:Expressions]] == Expressions -An expression is a set of characters starting with a left bracket `[` -and ending with a balancing right bracket `]` . In between the brackets +An expression is a set of characters starting with a left bracket '[' +and ending with a balancing right bracket ']' . In between the brackets are numbers, parameter values, mathematical operations, and other expressions. An expression is evaluated to produce a number. The expressions on a line are evaluated when the line is read, before anything on the line is executed. An example of an -expression is `[1 + acos[0] - [#3 ** [4.0/2]]]`. +expression is '[1 + acos[0] - [#3 ** [4.0/2]]]'. [[sec:Binary-Operators]] == Binary Operators Binary operators only appear inside expressions. There are four basic -mathematical operations: addition (`+`), subtraction (`-`), -multiplication (`*`), and division (`/`). There are three logical -operations: non-exclusive or (`OR`), exclusive or (`XOR`), and logical -and (`AND`). The eighth operation is the modulus operation (`MOD`). The -ninth operation is the "power" operation (`**`) of raising the number +mathematical operations: addition ('+'), subtraction ('-'), +multiplication ('\*'), and division ('/'). There are three logical +operations: non-exclusive or ('OR'), exclusive or ('XOR'), and logical +and ('AND'). The eighth operation is the modulus operation ('MOD'). The +ninth operation is the 'power' operation ('**') of raising the number on the left of the operation to the power on - the right. The relational operators are equality (`EQ`), inequality -(`NE`), strictly greater than (`GT`), greater than or equal to (`GE`), -strictly less than (`LT`), and less than or equal to (`LE`). + the right. The relational operators are equality ('EQ'), inequality +('NE'), strictly greater than ('GT'), greater than or equal to ('GE'), +strictly less than ('LT'), and less than or equal to ('LE'). The binary operations are divided into several groups according to their precedence. (see table <<cap:Operator-Precedence>>) If operations in different precedence groups are strung together (for -example in the expression `[2.0 / 3 * 1.5 - 5.5 / 11.0]`), operations +example in the expression '[2.0 / 3 * 1.5 - 5.5 / 11.0]'), operations in a higher group are to be performed before operations in a lower group. If an expression contains more than one operation - from the same group (such as the first `/` and `*` in the example), + from the same group (such as the first '/' and '*' in the example), the operation on the left is performed first. Thus, - the example is equivalent to: `[[[2.0 / 3] * 1.5] - [5.5 / 11.0]]` , -which is equivalent to to `[1.0 - 0.5]` , which is `0.5`. + the example is equivalent to: '[ [ [2.0 / 3] * 1.5] - [5.5 / 11.0] ]' , +which is equivalent to to '[1.0 - 0.5]' , which is '0.5'. The logical operations and modulus are to be performed on any real numbers, not just on integers. The number zero is equivalent to logical @@ -296,15 +300,15 @@ false, and any non-zero number is equivalent to logical true. [[sub:Unary-Operation-Value]] == Functions -A function is either "`ATAN` " followed by one expression divided by +A function is either 'ATAN' followed by one expression divided by another expression (for - example "`ATAN[2]/[1+3]`") or any other function name followed by an -expression (for example "`SIN[90]` "). The available functions are + example 'ATAN[2]/[1+3]') or any other function name followed by an +expression (for example 'SIN[90]'). The available functions are shown in table <<cap:Functions>>. - Arguments to unary operations which take angle measures (`COS`, `SIN`, -and `TAN` ) are in degrees. Values returned by unary operations which + Arguments to unary operations which take angle measures ('COS', 'SIN', +and 'TAN' ) are in degrees. Values returned by unary operations which return -angle measures (`ACOS`, `ASIN`, and `ATAN`) are also in degrees. +angle measures ('ACOS', 'ASIN', and 'ATAN') are also in degrees. .Functions[[cap:Functions]] @@ -327,12 +331,12 @@ angle measures (`ACOS`, `ASIN`, and `ATAN`) are also in degrees. |EXISTS[arg] | Check named Parameter |======================================== -The `FIX` function rounds towards the left (less positive or more +The 'FIX' function rounds towards the left (less positive or more negative) on -a number line, so that `FIX[2.8] =2` and `FIX[-2.8] = -3`, for -example. The `FUP` operation rounds towards the right (more positive +a number line, so that 'FIX[2.8] =2' and 'FIX[-2.8] = -3', for +example. The 'FUP' operation rounds towards the right (more positive or less negative) -on a number line; `FUP[2.8] = 3` and `FUP[-2.8] = -2`, for example. +on a number line; 'FUP[2.8] = 3' and 'FUP[-2.8] = -2', for example. The EXISTS function checks for the existence of a single named parameter. It takes only one named parameter and returns 1 if it exists @@ -352,7 +356,7 @@ For all other legal letters, a line may have only one word beginning with that letter. If a parameter setting of the same parameter is repeated on a line, -"`#3=15 #3=6`", for example, only the last setting will take effect. +'#3=15 #3=6', for example, only the last setting will take effect. It is silly, but not illegal, to set the same parameter twice on the same line. @@ -374,9 +378,9 @@ changing the meaning of the line. If the second group (the parameter settings) is reordered, there will be no change in the meaning of the line unless the same parameter is set more than once. In this case, only the last setting of the -parameter will take effect. For example, after the line "`#3=15 #3=6` " +parameter will take effect. For example, after the line '#3=15 #3=6' has been interpreted, the value of parameter 3 will be 6. If the - order is reversed to "`#3=6 #3=15`" and the line is interpreted, the + order is reversed to '#3=6 #3=15' and the line is interpreted, the value of parameter 3 will be 15. If the third group (the comments) contains more than one comment and @@ -385,16 +389,16 @@ is reordered, only the last comment will be used. If each group is kept in order or reordered without changing the meaning of the line, then the three groups may be interleaved in any way without changing the meaning of the line. For example, the line -"`g40 g1 #3=15 (foo) #4=-7.0`" has five items and means exactly the +'g40 g1 #3=15 (foo) #4=-7.0' has five items and means exactly the same thing in any of the 120 - possible orders (such as "`#4=-7.0 g1 #3=15 g40 (foo)`") for the five + possible orders (such as '#4=-7.0 g1 #3=15 g40 (foo)') for the five items. == Commands and Machine Modes Many commands cause the controller to change from one mode to another, and the mode stays active until some other command changes it -implicitly or explicitly. Such commands are called "modal". For +implicitly or explicitly. Such commands are called 'modal'. For example, if coolant is turned on, it stays on until it is explicitly turned off. The G codes for motion are also modal. If a G1 (straight move) command is given on one line, for example, it will be executed @@ -402,14 +406,14 @@ again on the next line if one or more axis words is available on the line, unless an explicit command is given on that next line using the axis words or canceling motion. -"Non-modal" codes have effect only on the lines on which they occur. +'Non-modal' codes have effect only on the lines on which they occur. For example, G4 (dwell) is non-modal. [[sec:Modal-Groups]] == Modal Groups (((Modal Groups))) -Modal commands are arranged in sets called "modal groups", and only +Modal commands are arranged in sets called 'modal groups', and only one member of a modal group may be in force at any given time. In general, a modal group contains commands for which it is logically impossible for two members to be in effect at the same time - like @@ -464,7 +468,7 @@ words appears on the line, the activity of the group 1 G-code is suspended for that line. The axis word-using G-codes from group 0 are G10, G28, G30, and G92. -It is an error to include any unrelated words on a line with `O-` flow +It is an error to include any unrelated words on a line with 'O-' flow control. == Comments |