📄 main.lyx
字号:
#LyX 1.3 created this file. For more info see http://www.lyx.org/\lyxformat 221\textclass book\begin_preamble\usepackage[plainpages=false,pdfpagelabels,colorlinks=true,linkcolor=blue]{hyperref}\title{The EMC2 RS274NGC Interpreter}\end_preamble\language english\inputencoding default\fontscheme bookman\graphics default\float_placement !!h\paperfontsize 10\spacing single \papersize Custom\paperpackage a4\use_geometry 1\use_amsmath 0\use_natbib 0\use_numerical_citations 0\paperorientation portrait\paperwidth 8.5in\paperheight 11in\leftmargin 1.2in\topmargin 1in\rightmargin 0.6in\bottommargin 0.6in\secnumdepth 5\tocdepth 5\paragraph_separation skip\defskip smallskip\quotes_language english\quotes_times 2\papercolumns 1\papersides 2\paperpagestyle default\layout ChapterLanguage Overview\begin_inset LatexCommand \label{cha:Language-Overview}\end_inset \layout StandardThe RS274/NGC language is based on lines of code. Each line (also called a \begin_inset Quotes eld\end_inset block\begin_inset Quotes erd\end_inset ) may include commands to a machining center to do several different things. Lines of code may be collected in a file to make a program.\layout StandardA typical line of code consists of an optional line number at the beginning followed by one or more \begin_inset Quotes eld\end_inset words.\begin_inset Quotes erd\end_inset 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, \begin_inset Quotes eld\end_inset \family typewriter G1 X3\family default \begin_inset Quotes erd\end_inset is a valid line of code with two words. \begin_inset Quotes eld\end_inset \family typewriter G1\family default \begin_inset Quotes erd\end_inset is a command meaning \begin_inset Quotes eld\end_inset move in a straight line at the programmed feed rate\begin_inset Quotes erd\end_inset , and \begin_inset Quotes eld\end_inset \family typewriter X3\family default \begin_inset Quotes erd\end_inset provides an argument value (the value of X should be 3 at the end of the move). Most RS274/NGC commands start with either G or M (for General and Miscellaneous). The words for these commands are called \begin_inset Quotes eld\end_inset G codes\begin_inset Quotes erd\end_inset and \begin_inset Quotes eld\end_inset M codes.\begin_inset Quotes erd\end_inset \layout StandardThe RS274/NGC\begin_inset LatexCommand \index{RS274NGC}\end_inset 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, \begin_inset Quotes eld\end_inset %\begin_inset Quotes erd\end_inset , 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 \family typewriter M2\family default or \family typewriter M30\family default 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.\layout StandardThe RS274/NGC language has two commands (\family typewriter M2\family default or \family typewriter M30\family default ), 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.\layout SectionFormat of a line\layout StandardA permissible line of input RS274/NGC 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.\layout Enumeratean optional block delete character, which is a slash \begin_inset Quotes eld\end_inset /\begin_inset Quotes erd\end_inset . \layout Enumeratean optional line number.\layout Enumerateany number of words, parameter settings, and comments.\layout Enumeratean end of line marker (carriage return or line feed or both). \layout StandardAny input not explicitly allowed is illegal and will cause the Interpreter to signal an error.\layout StandardSpaces 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 \begin_inset Quotes eld\end_inset \family typewriter g0x +0. 12 34y 7\family default \begin_inset Quotes erd\end_inset is equivalent to \begin_inset Quotes eld\end_inset \family typewriter g0 x+0.1234 y7\family default \begin_inset Quotes erd\end_inset , for example.\layout StandardBlank lines are allowed in the input. They are to be ignored.\layout StandardInput is case insensitive, except in comments, i.e., any letter outside a comment may be in upper or lower case without changing the meaning of a line. \layout SectionLine Number\begin_inset LatexCommand \index{Line Number}\end_inset \layout StandardA line number is the letter N followed by an integer (with no sign) between 0 and 99999 written with no more than five digits (000009 is not OK, for example). Line numbers may be repeated or used out of order, although normal practice is to avoid such usage. Line numbers may also be skipped, and that is normal practice. A line number is not required to be used, but must be in the proper place if used.\layout SectionWord\begin_inset LatexCommand \index{Word}\end_inset \layout StandardA word is a letter other than N followed by a real value.\layout StandardWords may begin with any of the letters shown in Table \begin_inset LatexCommand \ref{cap:Words-and-their}\end_inset . The table includes N for completeness, even though, as defined above, line numbers are not words. Several letters (I, J, K, L, P, R) may have different meanings in different contexts. Letters which refer to axis names are not valid on a machine which does not have the corresponding axis.\layout Standard\begin_inset Float tableplacement Hwide falsecollapsed false\layout CaptionWords and their meanings\begin_inset LatexCommand \label{cap:Words-and-their}\end_inset \layout Standard\align center \begin_inset Tabular<lyxtabular version="3" rows="26" columns="2"><features><column alignment="center" valignment="top" leftline="true" width="0"><column alignment="left" valignment="top" leftline="true" rightline="true" width="0"><row topline="true" bottomline="true"><cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">\begin_inset Text\layout StandardLetter\end_inset </cell><cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">\begin_inset Text\layout StandardMeaning\end_inset </cell></row><row topline="true"><cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">\begin_inset Text\layout StandardA\end_inset </cell><cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">\begin_inset Text\layout StandardA axis of machine\end_inset </cell></row><row topline="true"><cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">\begin_inset Text\layout StandardB\end_inset </cell><cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">\begin_inset Text\layout StandardB axis of machine\end_inset </cell></row><row topline="true"><cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">\begin_inset Text\layout StandardC\end_inset </cell><cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">\begin_inset Text\layout StandardC axis of machine\end_inset </cell></row><row topline="true"><cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">\begin_inset Text\layout StandardD\end_inset </cell><cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">\begin_inset Text\layout StandardTool radius compensation number\end_inset </cell></row><row topline="true"><cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">\begin_inset Text\layout StandardF\end_inset </cell><cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">\begin_inset Text\layout StandardFeed rate\end_inset </cell></row><row topline="true"><cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">\begin_inset Text\layout StandardG\end_inset </cell><cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">\begin_inset Text\layout StandardGeneral function (See table \begin_inset LatexCommand \ref{cap:Modal-Groups}\end_inset )\end_inset </cell></row><row topline="true"><cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">\begin_inset Text\layout StandardH\end_inset </cell><cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">\begin_inset Text\layout StandardTool length offset index\end_inset </cell></row><row topline="true"><cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">\begin_inset Text\layout StandardI\end_inset </cell><cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">\begin_inset Text\layout StandardX offset for arcs and G87 canned cycles\end_inset </cell></row><row topline="true"><cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">\begin_inset Text\layout StandardJ\end_inset </cell><cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">\begin_inset Text\layout StandardY offset for arcs and G87 canned cycles\end_inset </cell></row><row topline="true"><cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">\begin_inset Text\layout StandardK\end_inset </cell><cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">\begin_inset Text\layout StandardZ offset for arcs and G87 canned cycles.\end_inset </cell></row><row><cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">\begin_inset Text\layout Standard\end_inset </cell><cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">\begin_inset Text\layout StandardSpindle-Motion Ratio for G33 synchronized movements.\end_inset </cell></row><row topline="true"><cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">\begin_inset Text\layout StandardM\end_inset </cell><cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">\begin_inset Text\layout StandardMiscellaneous function (See table \begin_inset LatexCommand \ref{cap:Modal-Groups}\end_inset )\end_inset </cell></row><row topline="true"><cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">\begin_inset Text\layout StandardN\end_inset </cell><cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">\begin_inset Text\layout StandardLine number\end_inset </cell></row><row topline="true"><cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">\begin_inset Text\layout StandardP\end_inset </cell><cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">\begin_inset Text\layout StandardDwell time in canned cycles and with G4. \end_inset </cell></row><row><cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">\begin_inset Text\layout Standard\end_inset </cell><cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">\begin_inset Text\layout StandardKey used with G10.\end_inset </cell></row><row topline="true"><cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">\begin_inset Text\layout StandardQ\end_inset </cell><cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">\begin_inset Text
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -