You can subscribe to this list here.
| 2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(12) |
Jul
(105) |
Aug
(245) |
Sep
(165) |
Oct
(100) |
Nov
(92) |
Dec
(74) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2004 |
Jan
(179) |
Feb
(233) |
Mar
(175) |
Apr
(168) |
May
(146) |
Jun
(165) |
Jul
(18) |
Aug
(95) |
Sep
(134) |
Oct
(120) |
Nov
(51) |
Dec
(65) |
| 2005 |
Jan
(96) |
Feb
(100) |
Mar
(113) |
Apr
(82) |
May
(281) |
Jun
(168) |
Jul
(54) |
Aug
(72) |
Sep
(104) |
Oct
(182) |
Nov
(126) |
Dec
(133) |
| 2006 |
Jan
(211) |
Feb
(252) |
Mar
(291) |
Apr
(199) |
May
(345) |
Jun
(282) |
Jul
(272) |
Aug
(261) |
Sep
(287) |
Oct
(464) |
Nov
(233) |
Dec
(210) |
| 2007 |
Jan
(669) |
Feb
(304) |
Mar
(483) |
Apr
(150) |
May
(293) |
Jun
(215) |
Jul
(178) |
Aug
(138) |
Sep
(159) |
Oct
(301) |
Nov
(367) |
Dec
(165) |
| 2008 |
Jan
(171) |
Feb
(148) |
Mar
(150) |
Apr
(180) |
May
(112) |
Jun
(109) |
Jul
(196) |
Aug
(319) |
Sep
(294) |
Oct
(284) |
Nov
(399) |
Dec
(280) |
| 2009 |
Jan
(536) |
Feb
(454) |
Mar
(382) |
Apr
(255) |
May
(321) |
Jun
(318) |
Jul
(412) |
Aug
(226) |
Sep
(76) |
Oct
(251) |
Nov
(134) |
Dec
(101) |
| 2010 |
Jan
(262) |
Feb
(210) |
Mar
(219) |
Apr
(55) |
May
(180) |
Jun
(225) |
Jul
(151) |
Aug
(184) |
Sep
(54) |
Oct
(160) |
Nov
(237) |
Dec
(115) |
| 2011 |
Jan
(141) |
Feb
(68) |
Mar
(204) |
Apr
(329) |
May
(68) |
Jun
(34) |
Jul
(304) |
Aug
(206) |
Sep
(183) |
Oct
(121) |
Nov
(1125) |
Dec
(934) |
| 2012 |
Jan
(466) |
Feb
(161) |
Mar
(314) |
Apr
(63) |
May
(62) |
Jun
(53) |
Jul
(47) |
Aug
(41) |
Sep
(36) |
Oct
(108) |
Nov
(297) |
Dec
(73) |
| 2013 |
Jan
(236) |
Feb
(81) |
Mar
(422) |
Apr
(441) |
May
(86) |
Jun
(177) |
Jul
(146) |
Aug
(140) |
Sep
(93) |
Oct
(126) |
Nov
(133) |
Dec
(230) |
| 2014 |
Jan
(380) |
Feb
(233) |
Mar
(251) |
Apr
(214) |
May
(168) |
Jun
(670) |
Jul
(538) |
Aug
(459) |
Sep
(330) |
Oct
(327) |
Nov
(339) |
Dec
(456) |
| 2015 |
Jan
(188) |
Feb
(426) |
Mar
(186) |
Apr
(71) |
May
(151) |
Jun
(283) |
Jul
(208) |
Aug
(477) |
Sep
(148) |
Oct
(302) |
Nov
(297) |
Dec
(331) |
| 2016 |
Jan
(474) |
Feb
(55) |
Mar
(92) |
Apr
(118) |
May
(286) |
Jun
(751) |
Jul
(494) |
Aug
(166) |
Sep
(97) |
Oct
(216) |
Nov
(41) |
Dec
(78) |
| 2017 |
Jan
(148) |
Feb
(205) |
Mar
(112) |
Apr
(119) |
May
(125) |
Jun
(102) |
Jul
(242) |
Aug
(26) |
Sep
(53) |
Oct
(28) |
Nov
(38) |
Dec
(97) |
| 2018 |
Jan
(71) |
Feb
(49) |
Mar
(43) |
Apr
(13) |
May
(19) |
Jun
(44) |
Jul
(74) |
Aug
(30) |
Sep
(44) |
Oct
(57) |
Nov
(74) |
Dec
(34) |
| 2019 |
Jan
(41) |
Feb
(50) |
Mar
(30) |
Apr
(24) |
May
(44) |
Jun
(101) |
Jul
(94) |
Aug
(123) |
Sep
(101) |
Oct
(81) |
Nov
(48) |
Dec
(51) |
| 2020 |
Jan
(74) |
Feb
(81) |
Mar
(129) |
Apr
(310) |
May
(176) |
Jun
(97) |
Jul
(137) |
Aug
(205) |
Sep
(84) |
Oct
(71) |
Nov
(106) |
Dec
(138) |
| 2021 |
Jan
(117) |
Feb
(94) |
Mar
(89) |
Apr
(71) |
May
(98) |
Jun
(99) |
Jul
(67) |
Aug
(129) |
Sep
(108) |
Oct
(127) |
Nov
(115) |
Dec
(114) |
| 2022 |
Jan
(115) |
Feb
(85) |
Mar
(97) |
Apr
(92) |
May
(102) |
Jun
(109) |
Jul
(168) |
Aug
(230) |
Sep
(183) |
Oct
(106) |
Nov
(109) |
Dec
(146) |
| 2023 |
Jan
(186) |
Feb
(126) |
Mar
(99) |
Apr
(92) |
May
(158) |
Jun
(74) |
Jul
(113) |
Aug
(93) |
Sep
(84) |
Oct
(163) |
Nov
(72) |
Dec
(81) |
| 2024 |
Jan
(71) |
Feb
(85) |
Mar
(63) |
Apr
(50) |
May
(45) |
Jun
(28) |
Jul
(106) |
Aug
(45) |
Sep
(60) |
Oct
(44) |
Nov
(53) |
Dec
(28) |
| 2025 |
Jan
(87) |
Feb
(58) |
Mar
(71) |
Apr
(37) |
May
(37) |
Jun
(46) |
Jul
(74) |
Aug
(26) |
Sep
(55) |
Oct
(43) |
Nov
(58) |
Dec
(34) |
| 2026 |
Jan
(106) |
Feb
(61) |
Mar
(48) |
Apr
(82) |
May
(78) |
Jun
(100) |
Jul
(96) |
Aug
(170) |
Sep
(13) |
Oct
|
Nov
|
Dec
|
|
From: <ray...@us...> - 2003-07-20 13:40:51
|
Update of /cvsroot/emc/documents/lyx In directory sc8-pr-cvs1:/tmp/cvs-serv26897 Modified Files: User_Gcode_Basics.lyx Log Message: added commands Index: User_Gcode_Basics.lyx =================================================================== RCS file: /cvsroot/emc/documents/lyx/User_Gcode_Basics.lyx,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** User_Gcode_Basics.lyx 19 Jul 2003 21:37:52 -0000 1.3 --- User_Gcode_Basics.lyx 20 Jul 2003 13:40:48 -0000 1.4 *************** *** 262,268 **** value, an expression, or a unary operation value. In this chapter all examples will use explicit numbers. - Expressions and unary operations are treated in the computation chapter. - The use of parameter values or variables are described in detail in the - Using Variables chapter. \layout Standard --- 262,265 ---- *************** *** 320,323 **** --- 317,326 ---- is considered close enough if it is within 0.0001 of an integer. + \layout Standard + + Two cases of values are treated in separate chapters. + These are the use of expressions and unary operations and the use of parameter + values or variables. + \layout Section *************** *** 1841,1848 **** \layout Standard Tool diameter compensation (g40, g41, g42) and tool length compensation ! (g43, g49) are covered in a separate page. ! Canned milling cycles (g80 - g89, g98) are covered in their own page. ! Coordinate systems and how to use them is also covered in a separate page. (g10, G53 - G59.3, G92, G92.2) \layout Section --- 1844,1859 ---- \layout Standard + Some of these command sets are considered in their own chapters. + These include; + \layout Itemize + Tool diameter compensation (g40, g41, g42) and tool length compensation ! (g43, g49) ! \layout Itemize ! ! Canned milling cycles (g80 - g89, g98) ! \layout Itemize ! ! Coordinate systems and how to use them is also covered in a separate page. (g10, G53 - G59.3, G92, G92.2) \layout Section *************** *** 1907,1911 **** \layout Standard ! I like to put a G0 Z2.0 (Z value depending on clamp height) towards the beginning of my code, before making any X or Y moves. \layout Standard --- 1918,1922 ---- \layout Standard ! I like to put a G0 Z2.0 (Z value depending on clamp height) toward the beginning of my code, before making any X or Y moves. \layout Standard *************** *** 2578,2581 **** --- 2589,2743 ---- \align center Table 5 M Word List + \layout Quotation + + 3.6.1 Program Stopping and Ending - M0, M1, M2, M30, M60 + \layout Quotation + + To stop a running program temporarily (regardless of the setting of the + optional stop switch), program M0. + + \layout Quotation + + To stop a running program temporarily (but only if the optional stop switch + is on), program M1. + + \layout Quotation + + It is OK to program M0 and M1 in MDI mode, but the effect will probably + not be noticeable, because normal behavior in MDI mode is to stop after + each line of input, anyway. + + \layout Quotation + + To exchange pallet shuttles and then stop a running program temporarily + (regardless of the setting of the optional stop switch), program M60. + + \layout Quotation + + If a program is stopped by an M0, M1, or M60, pressing the cycle start button + will restart the program at the following line. + + \layout Quotation + + To end a program, program M2. + To exchange pallet shuttles and then end a program, program M30. + Both of these commands have the following effects. + + \layout Quotation + + 1. + Axis offsets are set to zero (like G92.2) and origin offsets are set to + the default (like G54). + 2. + Selected plane is set to CANON_PLANE_XY (like G17). + 3. + Distance mode is set to MODE_ABSOLUTE (like G90). + 4. + Feed rate mode is set to UNITS_PER_MINUTE (like G94). + 5. + Feed and speed overrides are set to ON (like M48). + 6. + Cutter compensation is turned off (like G40). + 7. + The spindle is stopped (like M5). + 8. + The current motion mode is set to G_1 (like G1). + 9. + Coolant is turned off (like M9). + + \layout Quotation + + No more lines of code in an RS274/NGC file will be executed after the M2 + or M30 command is executed. + Pressing cycle start will start the program back at the beginning of the + file. + + \layout Quotation + + 3.6.2 Spindle Control - M3, M4, M5 + \layout Quotation + + To start the spindle turning clockwise at the currently programmed speed, + program M3. + + \layout Quotation + + To start the spindle turning counterclockwise at the currently programmed + speed, program M4. + + \layout Quotation + + To stop the spindle from turning, program M5. + + \layout Quotation + + It is OK to use M3 or M4 if the spindle speed is set to zero. + If this is done (or if the speed override switch is enabled and set to + zero), the spindle will not start turning. + If, later, the spindle speed is set above zero (or the override switch + is turned up), the spindle will start turning. + It is OK to use M3 or M4 when the spindle is already turning or to use + M5 when the spindle is already stopped. + + \layout Quotation + + 3.6.3 Tool Change - M6 + \layout Quotation + + To change a tool in the spindle from the tool currently in the spindle to + the tool most recently selected (using a T word - see Section 3.7.3), program + M6. + When the tool change is complete: * The spindle will be stopped. + * The tool that was selected (by a T word on the same line or on any line + after the previous tool change) will be in the spindle. + The T number is an integer giving the changer slot of the tool (not its + id). + * If the selected tool was not in the spindle before the tool change, the + tool that was in the spindle (if there was one) will be in its changer + slot. + * The coordinate axes will be stopped in the same absolute position they + were in before the tool change (but the spindle may be re-oriented). + * No other changes will be made. + For example, coolant will continue to flow during the tool change unless + it has been turned off by an M9. + The tool change may include axis motion while it is in progress. + It is OK (but not useful) to program a change to the tool already in the + spindle. + It is OK if there is no tool in the selected slot; in that case, the spindle + will be empty after the tool change. + If slot zero was last selected, there will definitely be no tool in the + spindle after a tool change. + + \layout Quotation + + 3.6.4 Coolant Control - M7, M8, M9 + \layout Quotation + + To turn mist coolant on, program M7. + + \layout Quotation + + To turn flood coolant on, program M8. + + \layout Quotation + + To turn all coolant off, program M9. + + \layout Quotation + + It is always OK to use any of these commands, regardless of what coolant + is on or off. + + \layout Quotation + + 3.6.5 Override Control - M48 and M49 + \layout Quotation + + To enable the speed and feed override switches, program M48. + To disable both switches, program M49. + See Section 2.2.1 for more details. + It is OK to enable or disable the switches when they are already enabled + or disabled. + \layout Subsection* *************** *** 2909,2920 **** Table 6 G and M Code Modal Groups \layout Standard ! \align center There is some question about the reasons why some codes are included in the modal group that surrounds them. But most of the modal groupings make sense in that only one state can be active at a time. - \layout Comment - - M words described here. \layout Section --- 3071,3079 ---- Table 6 G and M Code Modal Groups \layout Standard ! There is some question about the reasons why some codes are included in the modal group that surrounds them. But most of the modal groupings make sense in that only one state can be active at a time. \layout Section *************** *** 2927,2930 **** --- 3086,3221 ---- \emph default the order in which they will be executed. + Items are executed in the order shown below if they occur on the same line. + + \layout Enumerate + + comment (includes message). + \layout Enumerate + + set feed rate mode (G93, G94 - inverse time or per minute). + \layout Enumerate + + set feed rate (F). + \layout Enumerate + + set spindle speed (S). + + \layout Enumerate + + select tool (T). + + \layout Enumerate + + change tool (M6). + + \layout Enumerate + + spindle on or off (M3, M4, M5). + + \layout Enumerate + + coolant on or off (M7, M8, M9). + + \layout Enumerate + + enable or disable overrides (M48, M49). + + \layout Enumerate + + 10. + dwell (G4). + + \layout Enumerate + + set active plane (G17, G18, G19). + + \layout Enumerate + + set length units (G20, G21). + + \layout Enumerate + + cutter radius compensation on or off (G40, G41, G42) + \layout Enumerate + + cutter length compensation on or off (G43, G49) + \layout Enumerate + + coordinate system selection (G54, G55, G56, G57, G58, G59, G59.1, G59.2, G59.3). + + \layout Enumerate + + set path control mode (G61, G61.1, G64) + \layout Enumerate + + set distance mode (G90, G91). + + \layout Enumerate + + set retract mode (G98, G99). + + \layout Enumerate + + home (G28, G30) or change coordinate system data (G10) or set axis offsets + (G92, G92.1, G92.2, G94). + + \layout Enumerate + + perform motion (G0 to G3, G80 to G89), as modified (possibly) by G53. + + \layout Enumerate + + stop (M0, M1, M2, M30, M60). + \layout Standard + + The order that will often surprise the beginning part program writer is + that dwell is evaluated before any motion. + Putting a dwell at the end of a block of code produces a dwell before the + motion commands in the line are executed rather than after they are executed. + If you want a dwell at the bottom of a z move to clean up a drill or mill + you will need to program it on the next line along with the retract move. + + \layout Section + + Reordering a Block of Code + \layout Standard + + The following quotation is taken from the RS274NGC writeup by Tom Kramer. + \layout Quotation + + The three types of item whose order may vary on a line (as given at the + beginning of this section) are word, parameter setting, and comment. + Imagine that these three types of item are divided into three groups by + type. + + \layout Quotation + + The first group (the words) may be reordered in any way without changing + the meaning of the line. + + \layout Quotation + + 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" 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 + value of parameter 3 will be 15. + + \layout Quotation + + If the third group (the comments) contains more than one comment and is + reordered, only the last comment will be used. + + \layout Quotation + + 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 same thing in any of the 120 possible orders (such as "#4=-7.0 + g1 #3=15 g40 (foo)") for the five items. \the_end |
|
From: <ray...@us...> - 2003-07-20 13:35:24
|
Update of /cvsroot/emc/documents/lyx In directory sc8-pr-cvs1:/tmp/cvs-serv25118 Modified Files: User_GUI_Mini.lyx Log Message: editing Index: User_GUI_Mini.lyx =================================================================== RCS file: /cvsroot/emc/documents/lyx/User_GUI_Mini.lyx,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** User_GUI_Mini.lyx 16 Jul 2003 14:27:20 -0000 1.3 --- User_GUI_Mini.lyx 20 Jul 2003 13:35:21 -0000 1.4 *************** *** 746,755 **** \begin_float fig \layout Standard ! \align center \pextra_type 3 \pextra_widthp 50 ! \begin_inset Figure size 238 153 file ../images/miniedit.eps ! width 3 40 flags 9 --- 746,755 ---- \begin_float fig \layout Standard ! \align center \pextra_type 3 \pextra_widthp 40 ! \begin_inset Figure size 208 133 file ../images/miniedit.eps ! width 3 35 flags 9 |
|
From: <ray...@us...> - 2003-07-20 13:34:26
|
Update of /cvsroot/emc/documents/lyx In directory sc8-pr-cvs1:/tmp/cvs-serv25059 Modified Files: Master_User.lyx Log Message: editing Index: Master_User.lyx =================================================================== RCS file: /cvsroot/emc/documents/lyx/Master_User.lyx,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Master_User.lyx 16 Jul 2003 19:53:09 -0000 1.2 --- Master_User.lyx 20 Jul 2003 13:34:23 -0000 1.3 *************** *** 6,17 **** \fontscheme bookman \graphics default ! \float_placement h \paperfontsize 10 \spacing single ! \papersize Default ! \paperpackage a4wide ! \use_geometry 0 \use_amsmath 0 \paperorientation portrait \secnumdepth 5 \tocdepth 5 --- 6,23 ---- \fontscheme bookman \graphics default ! \float_placement !!h \paperfontsize 10 \spacing single ! \papersize letterpaper ! \paperpackage a4 ! \use_geometry 1 \use_amsmath 0 \paperorientation portrait + \paperwidth 8.5in + \paperheight 11in + \leftmargin 1.2in + \topmargin 1in + \rightmargin 0.6in + \bottommargin 0.6in \secnumdepth 5 \tocdepth 5 *************** *** 21,25 **** \quotes_times 2 \papercolumns 1 ! \papersides 2 \paperpagestyle default --- 27,31 ---- \quotes_times 2 \papercolumns 1 ! \papersides 1 \paperpagestyle default *************** *** 47,51 **** Ray Henry <re...@up...> serves as the general editor. Authors include Dan Falk, Will Shackleford, Fred Proctor, Jon Elson, Henkka ! Palonen. \end_float --- 53,57 ---- Ray Henry <re...@up...> serves as the general editor. Authors include Dan Falk, Will Shackleford, Fred Proctor, Jon Elson, Henkka ! Palonen, John Sheahan. \end_float *************** *** 60,64 **** Copyright (c) 2000-3 LinuxCNC.org \layout Standard ! \added_space_top 1in \line_top \line_bottom \noindent Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later --- 66,70 ---- Copyright (c) 2000-3 LinuxCNC.org \layout Standard ! \line_top \line_bottom \noindent Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later *************** *** 71,75 **** If you do not find the license you may order a copy from Free Software Foundation, Inc. ! 59 Temple Place, Suite 330, Boston, MA 02111-1307 \layout Standard --- 77,81 ---- If you do not find the license you may order a copy from Free Software Foundation, Inc. ! 59 Temple Place, Suite 330 Boston, MA 02111-1307 \layout Standard |
|
From: <ray...@us...> - 2003-07-20 13:29:48
|
Update of /cvsroot/emc/documents/lyx In directory sc8-pr-cvs1:/tmp/cvs-serv24458 Modified Files: Glossary.lyx Log Message: style change Index: Glossary.lyx =================================================================== RCS file: /cvsroot/emc/documents/lyx/Glossary.lyx,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Glossary.lyx 5 Jul 2003 01:49:13 -0000 1.8 --- Glossary.lyx 20 Jul 2003 13:29:45 -0000 1.9 *************** *** 27,32 **** Glossary of Common Terms Used in the EMC Documents ! \layout Author ! GPLD Copyright 2003, LinuxCNC.org \layout Standard --- 27,32 ---- Glossary of Common Terms Used in the EMC Documents ! \layout Standard ! \align center GPLD Copyright 2003, LinuxCNC.org \layout Standard |
|
From: <ray...@us...> - 2003-07-20 13:26:12
|
Update of /cvsroot/emc/documents/lyx In directory sc8-pr-cvs1:/tmp/cvs-serv23936 Modified Files: GPLD_Copyright.lyx Log Message: bold headings Index: GPLD_Copyright.lyx =================================================================== RCS file: /cvsroot/emc/documents/lyx/GPLD_Copyright.lyx,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** GPLD_Copyright.lyx 5 Jul 2003 01:23:43 -0000 1.1 --- GPLD_Copyright.lyx 20 Jul 2003 13:26:08 -0000 1.2 *************** *** 111,114 **** --- 111,115 ---- + \series bold \size small \color black *************** *** 207,210 **** --- 208,212 ---- + \series bold \size small \color black *************** *** 236,239 **** --- 238,242 ---- + \series bold \size small \color black *************** *** 294,297 **** --- 297,301 ---- + \series bold \size small \color black *************** *** 419,422 **** --- 423,427 ---- + \series bold \size small \color black *************** *** 459,462 **** --- 464,468 ---- + \series bold \size small \color black *************** *** 485,488 **** --- 491,495 ---- + \series bold \size small \color black *************** *** 515,518 **** --- 522,526 ---- + \series bold \size small \color black *************** *** 537,540 **** --- 545,549 ---- + \series bold \size small \color black *************** *** 556,559 **** --- 565,569 ---- + \series bold \size small \color black *************** *** 587,593 **** \size small \color black ! ADDENDUM: How to use this License for your documents \layout Standard --- 597,606 ---- + \series bold \size small \color black ! ADDENDUM ! \series default ! : How to use this License for your documents \layout Standard |
|
From: <ray...@us...> - 2003-07-19 21:37:55
|
Update of /cvsroot/emc/documents/lyx
In directory sc8-pr-cvs1:/tmp/cvs-serv5891
Modified Files:
User_Gcode_Basics.lyx
Log Message:
added newer codes
Index: User_Gcode_Basics.lyx
===================================================================
RCS file: /cvsroot/emc/documents/lyx/User_Gcode_Basics.lyx,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** User_Gcode_Basics.lyx 18 Jul 2003 18:46:07 -0000 1.2
--- User_Gcode_Basics.lyx 19 Jul 2003 21:37:52 -0000 1.3
***************
*** 2229,2232 ****
--- 2229,2264 ----
\layout Subsection*
+ Canned Cycle Return Mode
+ \layout Standard
+
+
+ \begin_inset LatexCommand \index{G98}
+
+ \end_inset
+
+
+ \begin_inset LatexCommand \index{G99}
+
+ \end_inset
+
+ G98 and G99
+ \layout Standard
+
+ When the spindle retracts during canned cycles, there is a choice of how
+ far it retracts: (1) retract perpendicular to the selected plane to the
+ position indicated by the R word, or (2) retract perpendicular to the selected
+ plane to the position that axis was in just before the canned cycle started
+ (unless that position is lower than the position indicated by the R word,
+ in which case use the R word position).
+
+ \layout Standard
+
+ To use option (1), program G99.
+ To use option (2), program G98.
+ Remember that the R word has different meanings in absolute distance mode
+ and incremental distance mode.\SpecialChar ~
+
+ \layout Subsection*
+
Miscellaneous words
\layout Standard
***************
*** 2243,2250 ****
in table 5.
\layout Standard
!
\begin_inset Tabular
! <lyxtabular version="2" rows="18" columns="2">
<features rotate="false" islongtable="false" endhead="0" endfirsthead="0" endfoot="0" endlastfoot="0">
<column alignment="center" valignment="top" leftline="true" rightline="false" width="" special="">
--- 2275,2282 ----
in table 5.
\layout Standard
! \align center
\begin_inset Tabular
! <lyxtabular version="2" rows="16" columns="2">
<features rotate="false" islongtable="false" endhead="0" endfirsthead="0" endfoot="0" endlastfoot="0">
<column alignment="center" valignment="top" leftline="true" rightline="false" width="" special="">
***************
*** 2520,2524 ****
</cell>
</row>
! <row topline="true" bottomline="false" newpage="false">
<cell multicolumn="0" alignment="center" valignment="top" topline="true" bottomline="false" leftline="true" rightline="false" rotate="false" usebox="none" width="" special="">
\begin_inset Text
--- 2552,2556 ----
</cell>
</row>
! <row topline="true" bottomline="true" newpage="false">
<cell multicolumn="0" alignment="center" valignment="top" topline="true" bottomline="false" leftline="true" rightline="false" rotate="false" usebox="none" width="" special="">
\begin_inset Text
***************
*** 2538,2573 ****
</cell>
</row>
- <row topline="true" bottomline="false" newpage="false">
- <cell multicolumn="0" alignment="center" valignment="top" topline="true" bottomline="false" leftline="true" rightline="false" rotate="false" usebox="none" width="" special="">
- \begin_inset Text
-
- \layout Standard
-
- \end_inset
- </cell>
- <cell multicolumn="0" alignment="center" valignment="top" topline="true" bottomline="false" leftline="true" rightline="true" rotate="false" usebox="none" width="" special="">
- \begin_inset Text
-
- \layout Standard
-
- \end_inset
- </cell>
- </row>
- <row topline="true" bottomline="true" newpage="false">
- <cell multicolumn="0" alignment="center" valignment="top" topline="true" bottomline="false" leftline="true" rightline="false" rotate="false" usebox="none" width="" special="">
- \begin_inset Text
-
- \layout Standard
-
- \end_inset
- </cell>
- <cell multicolumn="0" alignment="center" valignment="top" topline="true" bottomline="false" leftline="true" rightline="true" rotate="false" usebox="none" width="" special="">
- \begin_inset Text
-
- \layout Standard
-
- \end_inset
- </cell>
- </row>
</lyxtabular>
--- 2570,2573 ----
***************
*** 2576,2580 ****
\layout Standard
!
Table 5 M Word List
\layout Subsection*
--- 2576,2580 ----
\layout Standard
! \align center
Table 5 M Word List
\layout Subsection*
***************
*** 2618,2627 ****
e for two members to be in effect at the same time.
Measurement in inches vs.
! measure in millimeters are modal.
A machine tool may be in many modes at the same time, with one mode from
each group being in effect.
The modal groups used in the interpreter are shown in Table 6.
\layout Standard
!
\begin_inset Tabular
--- 2618,2627 ----
e for two members to be in effect at the same time.
Measurement in inches vs.
! measure in millimeters is modal.
A machine tool may be in many modes at the same time, with one mode from
each group being in effect.
The modal groups used in the interpreter are shown in Table 6.
\layout Standard
! \align center
\begin_inset Tabular
***************
*** 2906,2913 ****
\layout Standard
!
Table 6 G and M Code Modal Groups
\layout Standard
!
There is some question about the reasons why some codes are included in
the modal group that surrounds them.
--- 2906,2913 ----
\layout Standard
! \align center
Table 6 G and M Code Modal Groups
\layout Standard
! \align center
There is some question about the reasons why some codes are included in
the modal group that surrounds them.
***************
*** 2922,2927 ****
\layout Standard
! As you write g-code blocks you need to be aware that the order in which
! you write the words is not the order in which they will be executed.
\the_end
--- 2922,2930 ----
\layout Standard
! As you write g-code blocks the order in which you write the words is
! \emph on
! not
! \emph default
! the order in which they will be executed.
\the_end
|
|
From: <ray...@us...> - 2003-07-19 21:35:16
|
Update of /cvsroot/emc/documents/lyx In directory sc8-pr-cvs1:/tmp/cvs-serv5432 Modified Files: User_Hardware.lyx Log Message: edited ini for minimill Index: User_Hardware.lyx =================================================================== RCS file: /cvsroot/emc/documents/lyx/User_Hardware.lyx,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** User_Hardware.lyx 16 Jul 2003 14:25:00 -0000 1.2 --- User_Hardware.lyx 19 Jul 2003 21:35:13 -0000 1.3 *************** *** 104,114 **** can be used with freqmod and smdromod. \layout Standard ! \align left The bracketed numbers for the Two Phase function refer to the connections on a Bridgeport BOSS driver. ! \newline ! \SpecialChar ~ ! ! \newline [...3356 lines suppressed...] - \end_inset - - OPTIONS = -f emcstrip.conf.ferror - \layout Standard - - - \color black - Options for emcstripchart ussually -f something.conf. - This file says which variables to plot, colors etc. - -u changes the update rate. \layout Section Configuring EMC - \layout Comment - - This page is maintained by Ray Henry. I'd like to hear your comments and - suggestions concerning it \layout Subsection --- 2670,2676 ---- |
|
From: <ray...@us...> - 2003-07-19 21:32:45
|
Update of /cvsroot/emc/documents/lyx
In directory sc8-pr-cvs1:/tmp/cvs-serv3954
Modified Files:
Int_Configuration.lyx
Log Message:
moved ini stuff
Index: Int_Configuration.lyx
===================================================================
RCS file: /cvsroot/emc/documents/lyx/Int_Configuration.lyx,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** Int_Configuration.lyx 5 Jul 2003 01:29:22 -0000 1.1
--- Int_Configuration.lyx 19 Jul 2003 21:32:42 -0000 1.2
***************
*** 31,34 ****
--- 31,2984 ----
This page is maintained by Ray Henry. I'd like to hear your comments and
suggestions concerning it
+ \layout Section
+
+ The INI file reference
+ \layout Standard
+
+ Most of the information contained in this section is accurate and will remain
+ so for long periods of time.
[...2925 lines suppressed...]
+
+ G59.2
+ \begin_inset LatexCommand \index{G59.2}
+
+ \end_inset
+
+ 5361 to 5380
+ \layout Description
+
+ G59.3
+ \begin_inset LatexCommand \index{G59.3}
+
+ \end_inset
+
+ 5381 to 5400
+ \layout Section
+
+ The NML file reference
\layout Subsection
|
|
From: <pa...@us...> - 2003-07-19 14:43:45
|
Update of /cvsroot/emc/documents/lyx In directory sc8-pr-cvs1:/tmp/cvs-serv7451/lyx Modified Files: Dev_Developer.lyx Log Message: cvs notes added Index: Dev_Developer.lyx =================================================================== RCS file: /cvsroot/emc/documents/lyx/Dev_Developer.lyx,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Dev_Developer.lyx 5 Jul 2003 01:15:03 -0000 1.1 --- Dev_Developer.lyx 19 Jul 2003 14:43:42 -0000 1.2 *************** *** 936,938 **** --- 936,1295 ---- \newline cvs commit: Committing . + \layout Section + + CVS Usage + \layout Standard + + Much of the following has been extracted from http://cvsbook.red-bean.com/cvsbook.h + tml + \newline + + \layout Standard + + + \series bold + Tip: + \series default + add the line + \layout Standard + + \SpecialChar ~ + \SpecialChar ~ + \SpecialChar ~ + export CVS_RSH=ssh + \layout Standard + + to the .bashrc file in your home directory - Saves having to remember it + each time. + \newline + + \layout Standard + + CVS commands follow this form: + \layout Standard + + cvs [GLOBAL_OPTIONS] COMMAND [OPTIONS] [FILES] + \newline + + \layout Standard + + The second set of options is sometimes called command options. + Because there are so many of them, though, I'll just call them "options" + in most places to save space. + + \newline + + \layout Standard + + Many commands are meant to be run within a working copy and, therefore, + may be invoked without file arguments. + These commands default to all of the files in the current directory and + below. + So when I refer to the "file" or "files" in the text, Depending on how + you invoked CVS, these files may or may not have been explicitly mentioned + on the command line. + \newline + + \layout Subsection* + + Global Options + \layout Standard + + Here are a few of the global options to CVS. + + \newline + + \layout Standard + + -d REPOSITORY + \newline + + \layout Standard + + This specifies the repository, which might be an absolute pathname or a + more complex expression involving a connection method, username and host, + and path. + If it is an expression specifying a connection method, the general syntax + is: + \layout Standard + + :METHOD:USER@HOSTNAME:PATH_TO_REPOSITORY + \newline + Here are examples using each of the connection methods: + \newline + + \layout Standard + + :ext:jb...@cv...:/cvsroot/emc - Connects using rsh, ssh, or + some other external connection program. + If the $CVS_RSH environment variable is unset, this defaults to rsh; otherwise, + it uses the value of that variable. + + \layout Standard + + :server:jb...@cv...:/cvsroot/emc - Like :ext:, but uses CVS's + internal implementation of rsh. + (This may not be available on all platforms.) + \layout Standard + + :pserver:jb...@cv...:/cvsroot/emc - Connects using the password + authenticating server (see The Password-Authenticating Server in Repository + Administration; see also the login command.) + \layout Standard + + :local:jblogs@localhost:/var/cvs/emc - Accesses a local repository directly, + as though only the absolute path to the repository had been given. + + \newline + + \layout Standard + + --help [COMMAND] or -H [COMMAND] + \newline + These two options are synonymous. + If no COMMAND is specified, a basic usage message is printed to the standard + output. + If COMMAND is specified, a usage message for that command is printed. + + \newline + + \layout Standard + + --help-options + \newline + + \layout Standard + + Prints out a list of all global options to CVS, with brief explanations. + \newline + + \layout Standard + + --help-synonyms + \newline + + \layout Standard + + Prints out a list of CVS commands and their short forms ("up" for "update", + and so on). + \newline + + \layout Standard + + -n + \newline + + \layout Standard + + Doesn't change any files in the working copy or in the repository. + In other words, the command is executed as a "dry run" - CVS goes through + most of the steps of the command but stops short of actually running it. + \newline + + \layout Standard + + This is useful when you want to see what the command would have done had + you actually run it. + One common scenario is when you want to see what files in your working + directory have been modified, but not do a full update (which would bring + down changes from the repository). + By running cvs -n update, you can see a summary of what's been done locally, + without changing your working copy. + \newline + + \layout Standard + + -q + \newline + + \layout Standard + + This tells CVS to be moderately quiet by suppressing the printing of unimportant + informational messages. + What is considered "important" depends on the command. + For example, in updates, the messages that CVS normally prints on entering + each subdirectory of the working copy are suppressed, but the one-line + status messages for modified or updated files are still printed. + \newline + + \layout Standard + + -Q + \newline + + \layout Standard + + This tells CVS to be very quiet, by suppressing all output except what is + absolutely necessary to complete the command. + Commands whose sole purpose is to produce some output (such as diff or + annotate), of course, still give that output. + However, commands that could have an effect independent of any messages + that they may print (such as update or commit) print nothing. + + \newline + + \layout Standard + + -v or --version + \newline + + \layout Standard + + Causes CVS to print out its version and copyright information and then exit + with no error. + \newline + + \layout Standard + + -z GZIPLEVEL + \newline + + \layout Standard + + Sets the compression level on communications with the server. + The argument GZIPLEVEL must be a number from 1 to 9. + Level 1 is minimal compression (very fast, but doesn't compress much); + Level 9 is highest compression (uses a lot of CPU time, but sure does squeeze + the data). + Level 9 is only useful on very slow network connections. + Most people find levels between 3 and 5 to be most beneficial. + \newline + + \layout Standard + + A space between -z and its argument is optional. + \layout Subsection* + + Example Commands + \layout Subsubsection* + + Checkout + \layout Standard + + \SpecialChar ~ + \SpecialChar ~ + cvs -z3 -d:ext:jb...@cv...:/cvsroot/emc checkout emc + \layout Standard + + checkout is used to aquire a local working copy of the emc directory. + Alternative names are co and get. + \layout Standard + + This can also be used with a -D option to get date specific versions of + the code. + For example: + \layout Standard + + \SpecialChar ~ + \SpecialChar ~ + cvs -z3 -d:ext:jb...@cv...:/cvsroot/emc -D + \begin_inset Quotes erd + \end_inset + + yesterday + \begin_inset Quotes erd + \end_inset + + emc + \layout Standard + + \SpecialChar ~ + \SpecialChar ~ + cvs -z3 -d:ext:jb...@cv...:/cvsroot/emc -D + \begin_inset Quotes erd + \end_inset + + 2003-01-12 + \begin_inset Quotes erd + \end_inset + + emc + \layout Standard + + In the first example, all files that were modified prior to yesterday will + be checked out, in the second, all changes before 12th Jan 2003. + \layout Standard + + \SpecialChar ~ + \SpecialChar ~ + cvs -z3 -d:ext:jb...@cv...:/cvsroot/emc -r test_5_1_03 emc + \layout Standard + + This checks out all the files that have been tagged (or in the branch) test_5_1_ + 03. + \newline + Tags and dates are stcky and any further check outs will use the same tag + unless + \layout Standard + + \SpecialChar ~ + \SpecialChar ~ + cvs -z3 -d:ext:jb...@cv...:/cvsroot/emc -A emc + \layout Standard + + is used. + \layout Subsubsection* + + Commit + \layout Standard + + \SpecialChar ~ + \SpecialChar ~ + cvs -z3 -d:ext:jb...@cv...:/cvsroot/emc commit -m + \begin_inset Quotes erd + \end_inset + + foo bar edit + \begin_inset Quotes erd + \end_inset + + + \layout Standard + + \SpecialChar ~ + \SpecialChar ~ + cvs -z3 -d:ext:jb...@cv...:/cvsroot/emc ci -m + \begin_inset Quotes erd + \end_inset + + foo bar edit + \begin_inset Quotes erd + \end_inset + + + \layout Standard + + Commits changes from the local working directory to the central repository. + This only works with checked out branches or the main trunk. + If the sources have been checked out with a tag or date, then commits will + fail (unless the tag is for a branch). + \layout Standard + + -m + \begin_inset Quotes erd + \end_inset + + message + \begin_inset Quotes erd + \end_inset + + is compulsory. + \layout Subsubsection* + + Add + \layout Standard + + \SpecialChar ~ + \SpecialChar ~ + cvs -z3 -d:ext:jb...@cv...:/cvsroot/emc add new_file + \layout Standard + + \SpecialChar ~ + \SpecialChar ~ + cvs -z3 -d:ext:jb...@cv...:/cvsroot/emc new new_file + \layout Standard + + Adds a new file or directory to the repository. + The new addition will not be visable untill a cvs commit has also taken + place - Note the comments about sticky tags also apply. \the_end |
|
From: <pa...@us...> - 2003-07-19 10:13:29
|
Update of /cvsroot/emc/documents/lyx In directory sc8-pr-cvs1:/tmp/cvs-serv30402 Modified Files: README.txt Log Message: Minor typo fixes Index: README.txt =================================================================== RCS file: /cvsroot/emc/documents/lyx/README.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** README.txt 5 Jul 2003 01:38:37 -0000 1.1 --- README.txt 19 Jul 2003 10:13:26 -0000 1.2 *************** *** 51,55 **** The latest release lyx-1.3.2 will read the docs, but according ! to the press release, files saved with lyx-1.2.0 can not be read by lyx-1.1.6. Please bare this in mind should you wish to add to this repository. --- 51,55 ---- The latest release lyx-1.3.2 will read the docs, but according ! to the press release, files saved with lyx-1.2.0 or later can not be read by lyx-1.1.6. Please bare this in mind should you wish to add to this repository. *************** *** 127,129 **** It is not a good idea to use Protected Blanks at the beginning ! of a paragraph as the do not get reproduced very well. --- 127,129 ---- It is not a good idea to use Protected Blanks at the beginning ! of a paragraph as they do not get reproduced very well. |
|
From: <jmk...@us...> - 2003-07-19 07:17:25
|
Update of /cvsroot/emc/rtapi/src/rtapi
In directory sc8-pr-cvs1:/tmp/cvs-serv7212/src/rtapi
Modified Files:
localdefs.h rtai_rtapi.c rtai_ulapi.c rtapi.h sim_rtapi.c
sim_ulapi.c ulapi.h
Log Message:
sim and rtai implementations now match new API
Index: localdefs.h
===================================================================
RCS file: /cvsroot/emc/rtapi/src/rtapi/localdefs.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** localdefs.h 19 Jul 2003 02:17:41 -0000 1.3
--- localdefs.h 19 Jul 2003 07:17:22 -0000 1.4
***************
*** 2,6 ****
#define LOCALDEFS_H
! /* automatically generated by config script on Fri Jul 18 22:11:03 EDT 2003 */
#define LOCAL_MHZ 233.866
--- 2,6 ----
#define LOCALDEFS_H
! /* automatically generated by config script on Fri Jul 18 22:40:51 EDT 2003 */
#define LOCAL_MHZ 233.866
Index: rtai_rtapi.c
===================================================================
RCS file: /cvsroot/emc/rtapi/src/rtapi/rtai_rtapi.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** rtai_rtapi.c 19 Jul 2003 02:17:41 -0000 1.3
--- rtai_rtapi.c 19 Jul 2003 07:17:22 -0000 1.4
***************
*** 31,34 ****
--- 31,37 ----
+ /* These structs hold data associated with objects like tasks, etc. */
+ /* Task handles are pointers to these structs. */
+
struct rtapi_task {
int magic; /* to check for valid handle */
***************
*** 50,53 ****
--- 53,57 ----
struct rtapi_fifo {
int magic; /* to check for valid handle */
+ int key; /* key to fifo */
int fd; /* file descripter for fifo */
unsigned long int size; /* size of fifo area */
***************
*** 72,75 ****
--- 76,80 ----
}
+
int rtapi_prio_lowest(void)
{
***************
*** 77,80 ****
--- 82,86 ----
}
+
int rtapi_prio_next_higher(int prio)
{
***************
*** 89,92 ****
--- 95,99 ----
}
+
int rtapi_prio_next_lower(int prio)
{
***************
*** 107,110 ****
--- 114,118 ----
}
+
int rtapi_exit(void)
{
***************
*** 112,115 ****
--- 120,124 ----
}
+
int rtapi_clock_set_period(unsigned long int nsecs)
{
***************
*** 119,122 ****
--- 128,132 ----
}
+
int rtapi_task_new( rtapi_task_handle *taskptr )
{
***************
*** 128,132 ****
/* alloc space for task structure */
! task = kmalloc(sizeof(struct rtapi_task), GFP_USER);
if ( task == NULL )
return RTAPI_NOMEM;
--- 138,142 ----
/* alloc space for task structure */
! task = kmalloc( sizeof(struct rtapi_task), GFP_USER );
if ( task == NULL )
return RTAPI_NOMEM;
***************
*** 141,144 ****
--- 151,155 ----
}
+
int rtapi_task_delete( rtapi_task_handle task )
{
***************
*** 152,156 ****
task->magic = 0;
kfree( task );
! return 0;
}
--- 163,167 ----
task->magic = 0;
kfree( task );
! return RTAPI_SUCCESS;
}
***************
*** 171,174 ****
--- 182,190 ----
return RTAPI_BADH;
+ /* check requested priority */
+ if ( ( prio < rtapi_prio_highest() ) ||
+ ( prio > rtapi_prio_lowest() ) )
+ return RTAPI_INVAL;
+
/* call OS to initialize the task */
retval = rt_task_init( &(task->ostask), taskcode, arg,
***************
*** 182,186 ****
return RTAPI_NOMEM;
/* unknown error */
! return RTAPI_INVAL;
}
--- 198,202 ----
return RTAPI_NOMEM;
/* unknown error */
! return RTAPI_FAIL;
}
***************
*** 190,194 ****
nano2count((RTIME) period_nsec));
if ( retval != 0 )
! return RTAPI_INVAL;
}
else {
--- 206,210 ----
nano2count((RTIME) period_nsec));
if ( retval != 0 )
! return RTAPI_FAIL;
}
else {
***************
*** 196,200 ****
retval = rt_task_resume( &(task->ostask) );
if ( retval != 0 )
! return RTAPI_INVAL;
}
--- 212,216 ----
retval = rt_task_resume( &(task->ostask) );
if ( retval != 0 )
! return RTAPI_FAIL;
}
***************
*** 202,207 ****
--- 218,226 ----
}
+
int rtapi_task_stop( rtapi_task_handle task )
{
+ int retval;
+
/* validate task handle */
if ( task == NULL )
***************
*** 210,214 ****
return RTAPI_BADH;
! return rt_task_delete( &(task->ostask) );
}
--- 229,236 ----
return RTAPI_BADH;
! retval = rt_task_delete( &(task->ostask) );
! if ( retval != 0 )
! return RTAPI_FAIL;
! return RTAPI_SUCCESS;
}
***************
*** 216,219 ****
--- 238,243 ----
int rtapi_task_pause( rtapi_task_handle task )
{
+ int retval;
+
/* validate task handle */
if ( task == NULL )
***************
*** 222,230 ****
return RTAPI_BADH;
! return rt_task_suspend( &(task->ostask) );
}
int rtapi_task_resume( rtapi_task_handle task )
{
/* validate task handle */
if ( task == NULL )
--- 246,263 ----
return RTAPI_BADH;
! /* FIXME - depending on the version of rtai, a single
! call to resume() may or may not cancel multiple calls
! to suspend(). */
! retval = rt_task_suspend( &(task->ostask) );
! if ( retval != 0 )
! return RTAPI_FAIL;
! return RTAPI_SUCCESS;
}
+
int rtapi_task_resume( rtapi_task_handle task )
{
+ int retval;
+
/* validate task handle */
if ( task == NULL )
***************
*** 233,242 ****
return RTAPI_BADH;
! return rt_task_resume( &(task->ostask) );
}
int rtapi_task_set_period( rtapi_task_handle task,
unsigned long int period_nsec )
{
/* validate task handle */
if ( task == NULL )
--- 266,284 ----
return RTAPI_BADH;
! /* FIXME - depending on the version of rtai, a single
! call to resume() may or may not cancel multiple calls
! to suspend(). */
! retval = rt_task_resume( &(task->ostask) );
! if ( retval != 0 )
! return RTAPI_FAIL;
! return RTAPI_SUCCESS;
}
+
int rtapi_task_set_period( rtapi_task_handle task,
unsigned long int period_nsec )
{
+ int retval;
+
/* validate task handle */
if ( task == NULL )
***************
*** 245,252 ****
return RTAPI_BADH;
! return rt_task_make_periodic( &(task->ostask), rt_get_time(),
! nano2count((RTIME) period_nsec));
}
int rtapi_wait( void )
{
--- 287,298 ----
return RTAPI_BADH;
! retval = rt_task_make_periodic( &(task->ostask), rt_get_time(),
! nano2count((RTIME) period_nsec));
! if ( retval != 0 )
! return RTAPI_FAIL;
! return RTAPI_SUCCESS;
}
+
int rtapi_wait( void )
{
***************
*** 269,273 ****
if ( ptr == NULL )
/* called from outside a task? */
! return RTAPI_STATE;
/* ptr points to OS data, somewhere inside rtapi
--- 315,319 ----
if ( ptr == NULL )
/* called from outside a task? */
! return RTAPI_FAIL;
/* ptr points to OS data, somewhere inside rtapi
***************
*** 293,302 ****
/* alloc space for shmem structure */
! shmem = kmalloc(sizeof(struct rtapi_shmem), GFP_USER);
if ( shmem == NULL )
return RTAPI_NOMEM;
/* now get shared memory block from OS */
! shmem->mem = rtai_kmalloc(key, size);
if ( shmem->mem == NULL ) {
kfree ( shmem );
--- 339,348 ----
/* alloc space for shmem structure */
! shmem = kmalloc( sizeof(struct rtapi_shmem), GFP_USER );
if ( shmem == NULL )
return RTAPI_NOMEM;
/* now get shared memory block from OS */
! shmem->mem = rtai_kmalloc( key, size );
if ( shmem->mem == NULL ) {
kfree ( shmem );
***************
*** 347,350 ****
--- 393,397 ----
}
+
void rtapi_print(const char *fmt, ...)
{
***************
*** 362,365 ****
--- 409,413 ----
}
+
void rtapi_outb(unsigned char byte, unsigned int port)
{
***************
*** 367,370 ****
--- 415,419 ----
}
+
unsigned char rtapi_inb(unsigned int port)
{
***************
*** 372,375 ****
--- 421,425 ----
}
+
int rtapi_assign_interrupt_handler(unsigned int irq, void (*handler) (void))
{
***************
*** 377,384 ****
retval = rt_request_global_irq(irq, handler);
!
! return retval;
}
int rtapi_free_interrupt_handler(unsigned int irq)
{
--- 427,439 ----
retval = rt_request_global_irq(irq, handler);
! if ( retval != 0 )
! if ( retval == EBUSY )
! return RTAPI_BUSY;
! else
! return RTAPI_INVAL;
! return RTAPI_SUCCESS;
}
+
int rtapi_free_interrupt_handler(unsigned int irq)
{
***************
*** 387,413 ****
rt_shutdown_irq(irq);
retval = rt_free_global_irq(irq);
!
! return retval;
}
int rtapi_enable_interrupt(unsigned int irq)
{
rt_startup_irq(irq);
! return 0;
}
int rtapi_disable_interrupt(unsigned int irq)
{
rt_shutdown_irq(irq);
! return 0;
}
int rtapi_app_init(void)
{
! return 0;
}
void rtapi_app_return(void)
{
--- 442,473 ----
rt_shutdown_irq(irq);
retval = rt_free_global_irq(irq);
! if ( retval != 0 )
! return RTAPI_INVAL;
! return RTAPI_SUCCESS;
}
+
int rtapi_enable_interrupt(unsigned int irq)
{
rt_startup_irq(irq);
! return RTAPI_SUCCESS;
}
+
int rtapi_disable_interrupt(unsigned int irq)
{
rt_shutdown_irq(irq);
! return RTAPI_SUCCESS;
}
+
int rtapi_app_init(void)
{
! return RTAPI_SUCCESS;
}
+
void rtapi_app_return(void)
{
***************
*** 416,420 ****
-
int rtapi_sem_new( rtapi_sem_handle *semptr )
{
--- 476,479 ----
***************
*** 426,430 ****
/* alloc space for sem structure */
! sem = kmalloc(sizeof(struct rtapi_sem), GFP_USER);
if ( sem == NULL )
return RTAPI_NOMEM;
--- 485,489 ----
/* alloc space for sem structure */
! sem = kmalloc( sizeof(struct rtapi_sem), GFP_USER );
if ( sem == NULL )
return RTAPI_NOMEM;
***************
*** 459,462 ****
--- 518,522 ----
}
+
int rtapi_sem_give( rtapi_sem_handle sem )
{
***************
*** 472,475 ****
--- 532,536 ----
}
+
int rtapi_sem_take( rtapi_sem_handle sem )
{
***************
*** 485,489 ****
}
! extern int rtapi_sem_try( rtapi_sem_handle sem )
{
/* validate sem handle */
--- 546,551 ----
}
!
! int rtapi_sem_try( rtapi_sem_handle sem )
{
/* validate sem handle */
***************
*** 500,505 ****
! extern int rtapi_fifo_new( int key, unsigned long int size,
! rtapi_fifo_handle *fifoptr )
{
rtapi_fifo_handle fifo;
--- 562,567 ----
! int rtapi_fifo_new( int key, unsigned long int size,
! rtapi_fifo_handle *fifoptr )
{
rtapi_fifo_handle fifo;
***************
*** 511,515 ****
/* alloc space for fifo structure */
! fifo = kmalloc(sizeof(struct rtapi_fifo), GFP_USER);
if ( fifo == NULL )
return RTAPI_NOMEM;
--- 573,577 ----
/* alloc space for fifo structure */
! fifo = kmalloc( sizeof(struct rtapi_fifo), GFP_USER );
if ( fifo == NULL )
return RTAPI_NOMEM;
***************
*** 521,524 ****
--- 583,587 ----
retval = rtf_create ( key, size );
if ( retval != size ) {
+ /* create failed */
kfree ( fifo );
if ( retval == ENOMEM )
***************
*** 531,534 ****
--- 594,598 ----
fifo->magic = FIFO_MAGIC;
/* fill in the rest of the struct */
+ fifo->key = key;
fifo->fd = key;
***************
*** 538,541 ****
--- 602,606 ----
}
+
int rtapi_fifo_delete( rtapi_fifo_handle fifo )
{
***************
*** 555,558 ****
--- 620,624 ----
}
+
int rtapi_fifo_read( rtapi_fifo_handle fifo,
char *buf, unsigned long int size)
***************
*** 572,575 ****
--- 638,642 ----
return retval;
}
+
int rtapi_fifo_write( rtapi_fifo_handle fifo,
Index: rtai_ulapi.c
===================================================================
RCS file: /cvsroot/emc/rtapi/src/rtapi/rtai_ulapi.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** rtai_ulapi.c 8 Jul 2003 15:54:38 -0000 1.1.1.1
--- rtai_ulapi.c 19 Jul 2003 07:17:22 -0000 1.2
***************
*** 4,7 ****
--- 4,8 ----
Implementation of user-level API to RTAI modules
*/
+ #include <stdio.h> /* sprintf() */
#include <stddef.h> /* NULL, needed for rtai_shm.h */
#include <unistd.h> /* open(), close() */
***************
*** 10,63 ****
#include <sys/fcntl.h> /* O_RDWR, needed for rtai_shm.h */
#include <rtai_shm.h> /* rtai_malloc,free() */
#include "ulapi.h"
int ulapi_init(void)
{
! return 0;
}
int ulapi_exit(void)
{
! return 0;
}
! int ulapi_alloc_shmem(int key, unsigned int size, int *id, void **ptr)
{
! *ptr = rtai_malloc(key, size);
! /* leave id alone; we don't use it */
! return 0;
}
! int ulapi_free_shmem(int key, unsigned int size, int id, const void *ptr)
{
! rtai_free(key, (void *) ptr);
- return 0;
}
! int ulapi_fifo_new(int key, int *fd, unsigned long int size)
{
! enum { DEVSTR_LEN = 256 };
! char devstr[DEVSTR_LEN];
sprintf(devstr, "/dev/rtf%d", key);
- *fd = open(devstr, O_RDONLY);
! return *fd;
}
! int ulapi_fifo_delete(int key, int fd, unsigned long int size)
{
! return close(fd);
}
! int ulapi_fifo_write(int fd, char *buf, unsigned long int size)
{
! return write(fd, buf, size);
}
! int ulapi_fifo_read(int fd, char *buf, unsigned long int size)
{
! return read(fd, buf, size);
}
--- 11,227 ----
#include <sys/fcntl.h> /* O_RDWR, needed for rtai_shm.h */
#include <rtai_shm.h> /* rtai_malloc,free() */
+ #include <malloc.h> /* malloc(), free() */
#include "ulapi.h"
+
+ /* These structs hold data associated with objects like tasks, etc. */
+ /* Task handles are pointers to these structs. */
+
+ struct ulapi_shmem {
+ int magic; /* to check for valid handle */
+ int key; /* key to shared memory area */
+ unsigned long int size; /* size of shared memory area */
+ void *mem; /* pointer to the memory */
+ };
+
+ struct ulapi_fifo {
+ int magic; /* to check for valid handle */
+ int key; /* key to fifo */
+ int fd; /* file descripter for fifo */
+ int mode; /* O_RDONLY or O_WRONLY */
+ unsigned long int size; /* size of fifo area */
+ };
+
+
+ #define SHMEM_MAGIC 25453 /* random numbers used as signatures */
+ #define FIFO_MAGIC 10293
+
+
int ulapi_init(void)
{
! /* does nothing, for now */
! return ULAPI_SUCCESS;
}
+
int ulapi_exit(void)
{
! /* does nothing, for now */
! return ULAPI_SUCCESS;
}
!
! int ulapi_shmem_new( int key, unsigned int size,
! ulapi_shmem_handle *shmemptr )
{
! ulapi_shmem_handle shmem;
! /* validate shmemptr */
! if ( shmemptr == NULL )
! return ULAPI_INVAL;
!
! /* alloc space for shmem structure */
! shmem = malloc( sizeof(struct ulapi_shmem) );
! if ( shmem == NULL )
! return ULAPI_NOMEM;
!
! /* now get shared memory block from OS */
! shmem->mem = rtai_malloc(key, size);
! if ( shmem->mem == NULL ) {
! free ( shmem );
! return ULAPI_NOMEM;
! }
!
! /* label as a valid shmem structure */
! shmem->magic = SHMEM_MAGIC;
! /* fill in the other fields */
! shmem->size = size;
! shmem->key = key;
!
! /* return handle to the caller */
! *shmemptr = shmem;
! return ULAPI_SUCCESS;
}
!
! int ulapi_shmem_getptr ( ulapi_shmem_handle shmem, void **ptr )
{
! /* validate shmem handle */
! if ( shmem == NULL )
! return ULAPI_BADH;
! if ( shmem->magic != SHMEM_MAGIC )
! return ULAPI_BADH;
!
! /* pass memory address back to caller */
! *ptr = shmem->mem;
! return ULAPI_SUCCESS;
}
!
! int ulapi_shmem_delete( ulapi_shmem_handle shmem )
{
! /* validate shmem handle */
! if ( shmem == NULL )
! return ULAPI_BADH;
! if ( shmem->magic != SHMEM_MAGIC )
! return ULAPI_BADH;
!
! /* free the shared memory */
! rtai_free( shmem->key, shmem->mem );
!
! /* free the shmem structure */
! shmem->magic = 0;
! free ( shmem );
! return ULAPI_SUCCESS;
! }
!
! int ulapi_fifo_new( int key, unsigned long int size, char mode,
! ulapi_fifo_handle *fifoptr )
! {
! ulapi_fifo_handle fifo;
! int retval, flags;
! enum { DEVSTR_LEN = 256 };
! char devstr[DEVSTR_LEN];
!
! /* validate fifoptr */
! if ( fifoptr == NULL )
! return ULAPI_INVAL;
!
! /* alloc space for fifo structure */
! fifo = malloc( sizeof(struct ulapi_fifo) );
! if ( fifo == NULL )
! return ULAPI_NOMEM;
+ /* determine system name for fifo */
sprintf(devstr, "/dev/rtf%d", key);
! /* determine mode for fifo */
! if ( mode == 'R' )
! flags = O_RDONLY;
! else if ( mode == 'W' )
! flags = O_WRONLY;
! else
! return ULAPI_INVAL;
!
! /* open the fifo */
! retval = open( devstr, flags );
! if ( retval < 0 ) {
! /* open failed */
! free ( fifo );
! return ULAPI_NOTFND;
! }
!
! /* label as a valid fifo structure */
! fifo->magic = FIFO_MAGIC;
! /* fill in the rest of the struct */
! fifo->key = key;
! fifo->fd = retval;
! fifo->mode = flags;
!
! /* return handle to the caller */
! *fifoptr = fifo;
! return ULAPI_SUCCESS;
}
!
! int ulapi_fifo_delete( ulapi_fifo_handle fifo )
{
! /* validate fifo handle */
! if ( fifo == NULL )
! return ULAPI_BADH;
! if ( fifo->magic != FIFO_MAGIC )
! return ULAPI_BADH;
!
! /* close the fifo */
! if ( close( fifo->fd ) < 0 )
! return ULAPI_NOTFND;
!
! /* free the fifo structure */
! fifo->magic = 0;
! free ( fifo );
! return ULAPI_SUCCESS;
!
}
! int ulapi_fifo_read( ulapi_fifo_handle fifo,
! char *buf, unsigned long int size)
{
! int retval;
!
! /* validate fifo handle */
! if ( fifo == NULL )
! return ULAPI_BADH;
! if ( fifo->magic != FIFO_MAGIC )
! return ULAPI_BADH;
! if ( fifo->mode != O_RDONLY )
! return ULAPI_UNSUP;
!
! /* get whatever data is available */
! retval = read( fifo->fd, buf, size );
! if ( retval < 0 )
! return ULAPI_FAIL;
! return retval;
!
}
! int ulapi_fifo_write( ulapi_fifo_handle fifo,
! char *buf, unsigned long int size)
{
! int retval;
!
! /* validate fifo handle */
! if ( fifo == NULL )
! return ULAPI_BADH;
! if ( fifo->magic != FIFO_MAGIC )
! return ULAPI_BADH;
! if ( fifo->mode != O_WRONLY )
! return ULAPI_UNSUP;
!
! /* get whatever data is available */
! retval = write( fifo->fd, buf, size );
! if ( retval < 0 )
! return ULAPI_FAIL;
! return retval;
}
+
Index: rtapi.h
===================================================================
RCS file: /cvsroot/emc/rtapi/src/rtapi/rtapi.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** rtapi.h 19 Jul 2003 02:17:41 -0000 1.4
--- rtapi.h 19 Jul 2003 07:17:22 -0000 1.5
***************
*** 11,19 ****
#define RTAPI_PERM -5 /* permission denied */
#define RTAPI_BUSY -6 /* resource is busy or locked */
! #define RTAPI_EMPTY -7 /* buffer or fifo empty */
! #define RTAPI_FULL -8 /* buffer or fifo full */
! #define RTAPI_STATE -9 /* object state inappropriate, example:
! calling init() after already inited,
! or pausing an already paused task */
--- 11,17 ----
#define RTAPI_PERM -5 /* permission denied */
#define RTAPI_BUSY -6 /* resource is busy or locked */
! #define RTAPI_NOTFND -7 /* object not found */
! #define RTAPI_FAIL -8 /* operation failed */
!
Index: sim_rtapi.c
===================================================================
RCS file: /cvsroot/emc/rtapi/src/rtapi/sim_rtapi.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** sim_rtapi.c 15 Jul 2003 11:42:48 -0000 1.2
--- sim_rtapi.c 19 Jul 2003 07:17:22 -0000 1.3
***************
*** 15,21 ****
#include "rtapi.h" /* these decls */
int rtapi_prio_highest(void)
{
! return 1;
}
--- 15,52 ----
#include "rtapi.h" /* these decls */
+
+ /* These structs hold data associated with objects like tasks, etc. */
+ /* Task handles are pointers to these structs. */
+
+ struct rtapi_task {
+ int magic; /* to check for valid handle */
+ pthread_t id; /* OS specific task identifier */
+ int arg; /* argument for task function */
+ void (*taskcode)( int ); /* pointer to task function */
+ };
+
+ struct rtapi_shmem {
+ int magic; /* to check for valid handle */
+ int key; /* key to shared memory area */
+ int id; /* OS identifier for shmem */
+ unsigned long int size; /* size of shared memory area */
+ void *mem; /* pointer to the memory */
+ };
+
+ #define TASK_MAGIC 21979 /* random numbers used as signatures */
+ #define SHMEM_MAGIC 25453
+
+ #define MAX_TASKS 64
+
+ /* data for all tasks */
+ static struct rtapi_task task_array[MAX_TASKS];
+
+
+ /* Priority functions. SIM uses 0 as the highest priority, as the
+ number increases, the actual priority of the task decreases. */
+
int rtapi_prio_highest(void)
{
! return 0;
}
***************
*** 27,33 ****
int rtapi_prio_next_higher(int prio)
{
! if (prio == rtapi_prio_highest())
! return prio;
return prio - 1;
}
--- 58,68 ----
int rtapi_prio_next_higher(int prio)
{
! /* return a valid priority for out of range arg */
! if (prio <= rtapi_prio_highest())
! return rtapi_prio_highest();
! if (prio > rtapi_prio_lowest())
! return rtapi_prio_lowest();
+ /* return next higher priority for in-range arg */
return prio - 1;
}
***************
*** 35,110 ****
int rtapi_prio_next_lower(int prio)
{
! if (prio == rtapi_prio_lowest())
! return prio;
!
return prio + 1;
}
int rtapi_init(void)
{
! return 0;
}
int rtapi_exit(void)
{
! return 0;
}
int rtapi_clock_set_period(unsigned long int nsecs)
{
! return 0;
}
! int rtapi_self_set_period(unsigned long int period_nsec)
{
! return 0;
}
! void *rtapi_task_new(void)
{
! return malloc(sizeof(pthread_t));
}
! int rtapi_task_delete(void *task)
{
! free(task);
! return 0;
}
! int
! rtapi_task_start(void *task,
! void *taskcode,
! int prio,
! unsigned long int stacksize,
! unsigned long int period_nsec, unsigned char uses_fp)
{
pthread_attr_t attr;
struct sched_param sched_param;
! pthread_attr_init(&attr);
sched_param.sched_priority = prio;
! pthread_attr_setschedparam(&attr, &sched_param);
! pthread_create((pthread_t *) task, &attr, taskcode, 0);
! pthread_setschedparam(*((pthread_t *) task), SCHED_FIFO, &sched_param);
! return 0;
}
! int rtapi_task_stop(void *task)
{
! return pthread_cancel(*((pthread_t *) task));
}
! int rtapi_task_pause(void *task)
{
! return 0;
}
! int rtapi_task_resume(void *task)
{
! return 0;
}
int rtapi_wait(void)
{
--- 70,274 ----
int rtapi_prio_next_lower(int prio)
{
! /* return a valid priority for out of range arg */
! if (prio >= rtapi_prio_lowest())
! return rtapi_prio_lowest();
! if (prio < rtapi_prio_highest())
! return rtapi_prio_highest();
! /* return next lower priority for in-range arg */
return prio + 1;
}
+
int rtapi_init(void)
{
! int n;
! /* clear the task array - if magic doesn't contain the magic
! number, that means that array entry is empty */
! for ( n = 0 ; n < MAX_TASKS ; n++ )
! task_array[n].magic = 0;
!
! return RTAPI_SUCCESS;
}
+
int rtapi_exit(void)
{
! return RTAPI_SUCCESS;
}
+
int rtapi_clock_set_period(unsigned long int nsecs)
{
! return RTAPI_SUCCESS;
}
!
! int rtapi_task_new( rtapi_task_handle *taskptr )
{
! int n;
! rtapi_task_handle task;
!
! /* validate taskptr */
! if ( taskptr == NULL )
! return RTAPI_INVAL;
!
! /* find an empty entry in the task array */
! /* FIXME - this is not 100% thread safe. If another thread
! calls this function after the first thread breaks out of
! the loop but before it sets the magic number, two tasks
! might wind up assigned to the same structure. Need an
! atomic test and set for the magic number. Not tonight! */
! n = 0;
! while ( ( n < MAX_TASKS ) &&
! ( task_array[n].magic == TASK_MAGIC ) )
! n++;
! if ( n == MAX_TASKS )
! return RTAPI_NOMEM;
! task = &(task_array[n]);
!
! /* label as a valid task structure */
! /* FIXME - end of non-threadsafe window */
! task->magic = TASK_MAGIC;
!
! /* and return handle to the caller */
! *taskptr = task;
!
! return RTAPI_SUCCESS;
}
!
! int rtapi_task_delete( rtapi_task_handle task )
{
! /* validate task handle */
! if ( task == NULL )
! return RTAPI_BADH;
! if ( task->magic != TASK_MAGIC )
! return RTAPI_BADH;
!
! /* mark the task struct as available */
! task->magic = 0;
! return 0;
}
!
! /* we define taskcode as taking an int and returning void. */
! /* pthread wants it to take a void pointer and return a void pointer */
! /* we solve this with a wrapper function that meets pthread's needs */
!
! static void *wrapper ( void *arg )
{
! rtapi_task_handle task;
! /* use the argument to point to the task data */
! task = arg;
! /* call the task function with the task argument */
! (task->taskcode)( task->arg );
! /* done */
! return NULL;
}
!
! int rtapi_task_start( rtapi_task_handle task,
! void (*taskcode)( int ),
! int arg, int prio,
! unsigned long int stacksize,
! unsigned long int period_nsec,
! unsigned char uses_fp )
{
+ int retval;
pthread_attr_t attr;
struct sched_param sched_param;
! /* validate task handle */
! if ( task == NULL )
! return RTAPI_BADH;
! if ( task->magic != TASK_MAGIC )
! return RTAPI_BADH;
!
! /* check requested priority */
! if ( ( prio < rtapi_prio_highest() ) ||
! ( prio > rtapi_prio_lowest() ) )
! return RTAPI_INVAL;
!
! /* get default thread attributes */
! pthread_attr_init( &attr );
!
! /* set priority */
sched_param.sched_priority = prio;
! pthread_attr_setschedparam( &attr, &sched_param );
! /* create the thread - use the wrapper function, pass it a pointer
! to the task structure so it can call the actual task function */
! retval = pthread_create( &(task->id), &attr, wrapper, (void *)task );
! if ( retval != 0 )
! return RTAPI_NOMEM;
! retval = pthread_setschedparam( task->id, SCHED_FIFO, &sched_param);
! if ( retval != 0 )
! /* need to be root to set SCHED_FIFO */
! return RTAPI_PERM;
! return RTAPI_SUCCESS;
}
!
! int rtapi_task_stop( rtapi_task_handle task )
{
! int retval;
!
! /* validate task handle */
! if ( task == NULL )
! return RTAPI_BADH;
! if ( task->magic != TASK_MAGIC )
! return RTAPI_BADH;
!
! retval = pthread_cancel( task->id );
! if ( retval != 0 )
! return RTAPI_FAIL;
! return RTAPI_SUCCESS;
}
! int rtapi_task_pause( rtapi_task_handle task )
{
!
! /* validate task handle */
! if ( task == NULL )
! return RTAPI_BADH;
! if ( task->magic != TASK_MAGIC )
! return RTAPI_BADH;
!
! /* FIXME - Fred originally had this function return success.
! I changed it to return Not Supported. Is that right? */
! return RTAPI_UNSUP;
}
! int rtapi_task_resume( rtapi_task_handle task )
{
!
! /* validate task handle */
! if ( task == NULL )
! return RTAPI_BADH;
! if ( task->magic != TASK_MAGIC )
! return RTAPI_BADH;
!
! /* FIXME - Fred originally had this function return success.
! I changed it to return Not Supported. Is that right? */
! return RTAPI_UNSUP;
}
+
+ int rtapi_task_set_period( rtapi_task_handle task,
+ unsigned long int period_nsec )
+ {
+ /* validate task handle */
+ if ( task == NULL )
+ return RTAPI_BADH;
+ if ( task->magic != TASK_MAGIC )
+ return RTAPI_BADH;
+
+ /* FIXME - Fred originally had this function return success.
+ I changed it to return Not Supported. Is that right? */
+ return RTAPI_UNSUP;
+ }
+
+
int rtapi_wait(void)
{
***************
*** 112,143 ****
usleep(1);
pthread_testcancel();
}
! int rtapi_alloc_shmem(int key, unsigned int size, int *id, void **ptr)
{
! *id = shmget((key_t) key, (int) size, IPC_CREAT | 0666);
! *ptr = shmat(*id, 0, 0);
! if (0 != *ptr) {
! return 0;
}
! return -1;
}
! int rtapi_free_shmem(int key, unsigned int size, int id, const void *ptr)
{
! struct shmid_ds d;
! int r1, r2;
! r1 = shmdt(ptr);
! /* FIXME - according to the man page for shmctl() on my system, id is
! the first arg, cmd is the second. Is this different on different
! kernel/lib versions, or just wrong here? */
! r2 = shmctl(IPC_RMID, id, &d);
! return (r1 || r2 ? -1 : 0);
}
void rtapi_print(const char *fmt, ...)
{
--- 276,394 ----
usleep(1);
pthread_testcancel();
+ return RTAPI_SUCCESS;
}
!
! int rtapi_task_get_handle( rtapi_task_handle *taskptr )
{
! int n;
! pthread_t task_id;
! /* validate taskptr */
! if ( taskptr == NULL )
! return RTAPI_INVAL;
!
! /* ask OS for task id */
! task_id = pthread_self();
!
! /* search task array for a matching entry */
! n = 0;
! while ( n < MAX_TASKS ) {
! if ( ( task_array[n].magic == TASK_MAGIC ) &&
! ( task_array[n].id == task_id ) ) {
! /* found it */
! *taskptr = &(task_array[n]);
! return RTAPI_SUCCESS;
! }
! n++;
}
+ return RTAPI_FAIL;
+ }
!
! int rtapi_shmem_new( int key, unsigned int size,
! rtapi_shmem_handle *shmemptr )
! {
! rtapi_shmem_handle shmem;
!
! /* validate shmemptr */
! if ( shmemptr == NULL )
! return RTAPI_INVAL;
!
! /* alloc space for shmem structure */
! shmem = malloc( sizeof(struct rtapi_shmem) );
! if ( shmem == NULL )
! return RTAPI_NOMEM;
!
! /* now get shared memory block from OS */
! shmem->id = shmget( (key_t) key, (int) size, IPC_CREAT | 0666 );
! if ( shmem->id == -1 ) {
! free ( shmem );
! return RTAPI_NOMEM;
! }
! /* and map it into process space */
! shmem->mem = shmat( shmem->id, 0, 0);
! if ( (int)(shmem->mem) == -1 ) {
! free ( shmem );
! return RTAPI_NOMEM;
! }
!
! /* label as a valid shmem structure */
! shmem->magic = SHMEM_MAGIC;
! /* fill in the other fields */
! shmem->size = size;
! shmem->key = key;
!
! /* return handle to the caller */
! *shmemptr = shmem;
! return RTAPI_SUCCESS;
}
!
! int rtapi_shmem_getptr ( rtapi_shmem_handle shmem, void **ptr )
{
! /* validate shmem handle */
! if ( shmem == NULL )
! return RTAPI_BADH;
! if ( shmem->magic != SHMEM_MAGIC )
! return RTAPI_BADH;
! /* pass memory address back to caller */
! *ptr = shmem->mem;
! return RTAPI_SUCCESS;
! }
!
! int rtapi_shmem_delete( rtapi_shmem_handle shmem )
! {
! struct shmid_ds d;
! int r1, r2;
!
! /* validate shmem handle */
! if ( shmem == NULL )
! return RTAPI_BADH;
! if ( shmem->magic != SHMEM_MAGIC )
! return RTAPI_BADH;
!
! /* unmap the shared memory */
! r1 = shmdt( shmem->mem );
!
! /* destroy the shared memory */
! r2 = shmctl( shmem->id, IPC_RMID, &d );
! /* FIXME - Fred had the first two arguments reversed. I changed
! them to match the shmctl man page on my machine. Since his way
! worked, maybe there is difference between different libs, or
! maybe my man page is just wrong. */
!
! /* free the shmem structure */
! shmem->magic = 0;
! free ( shmem );
!
! if ( ( r1 != 0 ) || ( r2 != 0 ) )
! return RTAPI_FAIL;
! return RTAPI_SUCCESS;
}
+
void rtapi_print(const char *fmt, ...)
{
***************
*** 160,173 ****
/*
! no support for simulated interrupts
*/
int rtapi_assign_interrupt_handler(unsigned int irq, void (*handler) (void))
{
! return 0;
}
int rtapi_free_interrupt_handler(unsigned int irq)
{
! return 0;
}
--- 411,491 ----
/*
! FIXME - no support for simulated interrupts
*/
int rtapi_assign_interrupt_handler(unsigned int irq, void (*handler) (void))
{
! return RTAPI_UNSUP;
}
int rtapi_free_interrupt_handler(unsigned int irq)
{
! return RTAPI_UNSUP;
! }
!
! int rtapi_enable_interrupt( unsigned int irq )
! {
! return RTAPI_UNSUP;
}
+
+ int rtapi_disable_interrupt( unsigned int irq )
+ {
+ return RTAPI_UNSUP;
+ }
+
+
+ /* FIXME - no support for semaphores */
+
+ int rtapi_sem_new( rtapi_sem_handle *semptr )
+ {
+ return RTAPI_UNSUP;
+ }
+
+ int rtapi_sem_delete( rtapi_sem_handle sem )
+ {
+ return RTAPI_UNSUP;
+ }
+
+ int rtapi_sem_give( rtapi_sem_handle sem )
+ {
+ return RTAPI_UNSUP;
+ }
+
+ int rtapi_sem_take( rtapi_sem_handle sem )
+ {
+ return RTAPI_UNSUP;
+ }
+
+ int rtapi_sem_try( rtapi_sem_handle sem )
+ {
+ return RTAPI_UNSUP;
+ }
+
+
+ /* FIXME - no support for fifos */
+
+ int rtapi_fifo_new( int key, unsigned long int size,
+ rtapi_fifo_handle *fifoptr )
+ {
+ return RTAPI_UNSUP;
+ }
+
+ int rtapi_fifo_delete( rtapi_fifo_handle fifo )
+ {
+ return RTAPI_UNSUP;
+ }
+
+ int rtapi_fifo_read( rtapi_fifo_handle fifo,
+ char *buf, unsigned long int size)
+ {
+ return RTAPI_UNSUP;
+ }
+
+ int rtapi_fifo_write( rtapi_fifo_handle fifo,
+ char *buf, unsigned long int size)
+ {
+ return RTAPI_UNSUP;
+ }
+
+
+
Index: sim_ulapi.c
===================================================================
RCS file: /cvsroot/emc/rtapi/src/rtapi/sim_ulapi.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** sim_ulapi.c 8 Jul 2003 15:54:38 -0000 1.1.1.1
--- sim_ulapi.c 19 Jul 2003 07:17:22 -0000 1.2
***************
*** 5,42 ****
*/
#include <sys/ipc.h> /* IPC_* */
#include <sys/shm.h> /* shmget() */
#include "ulapi.h"
int ulapi_init(void)
{
! return 0;
}
int ulapi_exit(void)
{
! return 0;
}
! int ulapi_alloc_shmem(int key, unsigned int size, int *id, void **ptr)
{
! *id = shmget((key_t) key, (int) size, IPC_CREAT | 0666);
! *ptr = shmat(*id, 0, 0);
! if (0 != *ptr) {
! return 0;
}
! return -1;
}
! int ulapi_free_shmem(int key, unsigned int size, int id, const void *ptr)
{
! struct shmid_ds d;
! int r1, r2;
! r1 = shmdt(ptr);
! r2 = shmctl(IPC_RMID, id, &d);
! return (r1 || r2 ? -1 : 0);
}
--- 5,150 ----
*/
+ #include <stddef.h> /* NULL */
#include <sys/ipc.h> /* IPC_* */
#include <sys/shm.h> /* shmget() */
+ #include <malloc.h> /* malloc(), free() */
#include "ulapi.h"
+ /* These structs hold data associated with objects like tasks, etc. */
+ /* Task handles are pointers to these structs. */
+
+ struct ulapi_shmem {
+ int magic; /* to check for valid handle */
+ int key; /* key to shared memory area */
+ int id; /* OS identifier for shmem */
+ unsigned long int size; /* size of shared memory area */
+ void *mem; /* pointer to the memory */
+ };
+
+
+ #define SHMEM_MAGIC 25453 /* random numbers used as signatures */
+
+
int ulapi_init(void)
{
! /* does nothing, for now */
! return ULAPI_SUCCESS;
}
+
int ulapi_exit(void)
{
! /* does nothing, for now */
! return ULAPI_SUCCESS;
}
!
! int ulapi_shmem_new( int key, unsigned int size,
! ulapi_shmem_handle *shmemptr )
{
! ulapi_shmem_handle shmem;
! /* validate shmemptr */
! if ( shmemptr == NULL )
! return ULAPI_INVAL;
!
! /* alloc space for shmem structure */
! shmem = malloc( sizeof(struct ulapi_shmem) );
! if ( shmem == NULL )
! return ULAPI_NOMEM;
!
! /* now get shared memory block from OS */
! shmem->id = shmget( (key_t) key, (int) size, IPC_CREAT | 0666 );
! if ( shmem->id == -1 ) {
! free ( shmem );
! return ULAPI_NOMEM;
! }
! /* and map it into process space */
! shmem->mem = shmat( shmem->id, 0, 0);
! if ( (int)(shmem->mem) == -1 ) {
! free ( shmem );
! return ULAPI_NOMEM;
}
! /* label as a valid shmem structure */
! shmem->magic = SHMEM_MAGIC;
! /* fill in the other fields */
! shmem->size = size;
! shmem->key = key;
!
! /* return handle to the caller */
! *shmemptr = shmem;
! return ULAPI_SUCCESS;
}
!
! int ulapi_shmem_getptr ( ulapi_shmem_handle shmem, void **ptr )
{
! /* validate shmem handle */
! if ( shmem == NULL )
! return ULAPI_BADH;
! if ( shmem->magic != SHMEM_MAGIC )
! return ULAPI_BADH;
! /* pass memory address back to caller */
! *ptr = shmem->mem;
! return ULAPI_SUCCESS;
! }
!
! int ulapi_shmem_delete( ulapi_shmem_handle shmem )
! {
! struct shmid_ds d;
! int r1, r2;
!
! /* validate shmem handle */
! if ( shmem == NULL )
! return ULAPI_BADH;
! if ( shmem->magic != SHMEM_MAGIC )
! return ULAPI_BADH;
!
! /* unmap the shared memory */
! r1 = shmdt( shmem->mem );
!
! /* destroy the shared memory */
! r2 = shmctl( shmem->id, IPC_RMID, &d );
! /* FIXME - Fred had the first two arguments reversed. I changed
! them to match the shmctl man page on my machine. Since his way
! worked, maybe there is difference between different libs, or
! maybe my man page is just wrong. */
!
! /* free the shmem structure */
! shmem->magic = 0;
! free ( shmem );
!
! if ( ( r1 != 0 ) || ( r2 != 0 ) )
! return ULAPI_FAIL;
! return ULAPI_SUCCESS;
! }
!
!
! /* FIXME - no support for fifos */
!
! int ulapi_fifo_new( int key, unsigned long int size, char mode,
! ulapi_fifo_handle *fifoptr )
! {
! return ULAPI_UNSUP;
! }
!
! int ulapi_fifo_delete( ulapi_fifo_handle fifo )
! {
! return ULAPI_UNSUP;
}
+
+ int ulapi_fifo_read( ulapi_fifo_handle fifo,
+ char *buf, unsigned long int size)
+ {
+ return ULAPI_UNSUP;
+ }
+
+ int ulapi_fifo_write( ulapi_fifo_handle fifo,
+ char *buf, unsigned long int size)
+ {
+ return ULAPI_UNSUP;
+ }
+
Index: ulapi.h
===================================================================
RCS file: /cvsroot/emc/rtapi/src/rtapi/ulapi.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** ulapi.h 19 Jul 2003 02:17:41 -0000 1.3
--- ulapi.h 19 Jul 2003 07:17:22 -0000 1.4
***************
*** 3,7 ****
! /** Error Codes: These error codes may be returned by UTAPI functions. */
#define ULAPI_SUCCESS 0 /* no error */
--- 3,7 ----
! /** These status codes are returned by many ULAPI functions. */
#define ULAPI_SUCCESS 0 /* no error */
***************
*** 9,17 ****
#define ULAPI_BADH -2 /* bad task, shmem, sem, or fifo handle */
#define ULAPI_INVAL -3 /* invalid argument*/
- #define ULAPI_BUSY -4 /* resource is busy or locked */
#define ULAPI_NOMEM -5 /* not enough memory */
#define ULAPI_PERM -6 /* permission denied */
! #define ULAPI_EMPTY -7 /* buffer or fifo empty */
! #define ULAPI_FULL -8 /* buffer or fifo full */
--- 9,17 ----
#define ULAPI_BADH -2 /* bad task, shmem, sem, or fifo handle */
#define ULAPI_INVAL -3 /* invalid argument*/
#define ULAPI_NOMEM -5 /* not enough memory */
#define ULAPI_PERM -6 /* permission denied */
! #define ULAPI_BUSY -4 /* resource is busy or locked */
! #define ULAPI_NOTFND -7 /* object not found */
! #define ULAPI_FAIL -8 /* operation failed */
***************
*** 20,30 ****
typedef struct ulapi_shmem *ulapi_shmem_handle;
- typedef struct ulapi_sem *ulapi_sem_handle;
typedef struct ulapi_fifo *ulapi_fifo_handle;
/** 'ulapi_init() sets up the user space interface to the RTAPI. It *
! * must be called before calling any ulapi functions. Returns *
! * ULAPI_SUCCESS, ULAPI_BUSY, ULAPI_NOMEM, or ULAPI_PERM. */
extern int ulapi_init( void );
--- 20,29 ----
typedef struct ulapi_shmem *ulapi_shmem_handle;
typedef struct ulapi_fifo *ulapi_fifo_handle;
/** 'ulapi_init() sets up the user space interface to the RTAPI. It *
! * must be called before calling any ulapi functions. Returns a statis *
! * code, as defined above. */
extern int ulapi_init( void );
***************
*** 32,37 ****
/** 'ulapi_exit()' shuts down and cleans up the user space interface *
! * to the RTAPI. It must be called before program exit. Returns *
! * ULAPI_SUCCESS. */
extern int ulapi_exit( void );
--- 31,36 ----
/** 'ulapi_exit()' shuts down and cleans up the user space interface *
! * to the RTAPI. It must be called before program exit. Returns a *
! * status code. */
extern int ulapi_exit( void );
***************
*** 42,64 ****
* memory must use the same key. The block will be at least 'size' *
* bytes, and may be rounded up. Allocating many small blocks may be *
! * very wasteful. On success, '*mbuf' becomes a shared memory handle, *
! * which points to internal data for the shared memory and is used for *
! * subsequent calls dealing with the block. Returns ULAPI_SUCCESS, *
! * ULAPI_INVAL, or ULAPI_NOMEM. */
extern int ulapi_shmem_new( int key, unsigned int size,
! ulapi_shmem_handle *mbuf );
/** 'ulapi_shmem_getptr()' sets '*ptr' to point to the start of the *
! * shared memory block 'mbuf'. Returns ULAPI_SUCCESS or ULAPI_BADH. */
! extern int ulapi_shmem_getptr ( ulapi_shmem_handle mbuf, void **ptr );
/** 'ulapi_shmem_delete()' frees the shared memory block 'mbuf'. *
! * Returns ULAPI_SUCCESS or ULAPI_BADH. */
! extern int ulapi_shmem_delete( ulapi_shmem_handle mbuf );
--- 41,63 ----
* memory must use the same key. The block will be at least 'size' *
* bytes, and may be rounded up. Allocating many small blocks may be *
! * very wasteful. On success, '*shmemptr' becomes a shared memory *
! * handle, which points to internal data for the shared memory and is *
! * used for subsequent calls dealing with the block. Returns a status *
! * code. */
extern int ulapi_shmem_new( int key, unsigned int size,
! ulapi_shmem_handle *shmemptr );
/** 'ulapi_shmem_getptr()' sets '*ptr' to point to the start of the *
! * shared memory block 'mbuf'. Returns a status code. */
! extern int ulapi_shmem_getptr ( ulapi_shmem_handle shmem, void **ptr );
/** 'ulapi_shmem_delete()' frees the shared memory block 'mbuf'. *
! * Returns a status code. */
! extern int ulapi_shmem_delete( ulapi_shmem_handle shmem );
***************
*** 69,101 ****
* On success, '*fifo' becomes a fifo handle, which points to internal *
* data for the fifo and is used for subsequent calls dealing with it. *
! * Returns ULAPI_SUCCESS, ULAPI_INVAL, ULAPI_NOMEM, or ULAPI_PERM. */
extern int ulapi_fifo_new( int key, unsigned long int size, char mode,
! ulapi_fifo_handle *fifo );
/** 'ulapi_fifo_delete()' is the counterpart to 'ulapi_fifo_new()'. *
! * It destroys the fifo 'fifo'. Returns ULAPI_SUCCESS or ULAPI_BADH. */
extern int ulapi_fifo_delete( ulapi_fifo_handle fifo );
! /** 'rtapi_fifo_read()' reads data from 'fifo'. 'buf' is a buffer for *
* the data, and 'size' is the maximum number of bytes to read. *
! * Returns the number of bytes actually read, or RTAPI_BADH. Does not *
! * block. If 'size' bytes are not available, it will read whatever is *
! * available, and return that count (which could be zero). */
! extern int rtapi_fifo_read( rtapi_fifo_handle fifo,
! char *buf, unsigned long int size);
! /** 'rtapi_fifo_write()' writes data to 'fifo'. Up to 'size' bytes are *
* taken from the buffer at 'buf'. Returns the count of bytes actually *
! * written, or RTAPI_BADH. Does not block. If 'size' bytes of space *
! * are not available in the fifo, rtapi_fifo_write() will write as many *
* bytes as it can and return that count (which may be zero). */
! extern int rtapi_fifo_write(int fd, char *buf, unsigned long int size);
--- 68,104 ----
* On success, '*fifo' becomes a fifo handle, which points to internal *
* data for the fifo and is used for subsequent calls dealing with it. *
! * Returns a status code. */
extern int ulapi_fifo_new( int key, unsigned long int size, char mode,
! ulapi_fifo_handle *fifoptr );
/** 'ulapi_fifo_delete()' is the counterpart to 'ulapi_fifo_new()'. *
! * It destroys the fifo 'fifo'. Returns a status code. */
extern int ulapi_fifo_delete( ulapi_fifo_handle fifo );
! /** 'ulapi_fifo_read()' reads data from 'fifo'. 'buf' is a buffer for *
* the data, and 'size' is the maximum number of bytes to read. *
! * Returns the number of bytes actually read, or RTAPI_BADH. If there *
! * is no data in the fifo, it blocks until data appears (or a signal *
! * occurs). If 'size' bytes are not available, it will read whatever *
! * is available, and return that count (will be greater than zero). If *
! * interrupted by a signal or some other error occurs, will return *
! * ULAPI_FAIL. */
! extern int ulapi_fifo_read( ulapi_fifo_handle fifo,
! char *buf, unsigned long int size);
! /** 'ulapi_fifo_write()' writes data to 'fifo'. Up to 'size' bytes are *
* taken from the buffer at 'buf'. Returns the count of bytes actually *
! * written, or RTAPI_BADH, or ULAPI_FAIL. If 'size' bytes of space are *
! * not available in the fifo, rtapi_fifo_write() will write as many *
* bytes as it can and return that count (which may be zero). */
! extern int ulapi_fifo_write( ulapi_fifo_handle fifo,
! char *buf, unsigned long int size);
|
|
From: <jmk...@us...> - 2003-07-19 07:17:24
|
Update of /cvsroot/emc/rtapi In directory sc8-pr-cvs1:/tmp/cvs-serv7212 Modified Files: Makefile.inc Log Message: sim and rtai implementations now match new API Index: Makefile.inc =================================================================== RCS file: /cvsroot/emc/rtapi/Makefile.inc,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Makefile.inc 19 Jul 2003 02:17:41 -0000 1.3 --- Makefile.inc 19 Jul 2003 07:17:22 -0000 1.4 *************** *** 10,14 **** MOD_DIR = /lib/modules/2.4.18-rtai/misc CC = gcc ! CFLAGS = -g -I$(INC_DIR) CLINK = RTDIR = /usr/src/rtai-24.1.10 --- 10,14 ---- MOD_DIR = /lib/modules/2.4.18-rtai/misc CC = gcc ! CFLAGS = -g -I$(INC_DIR) -Wall CLINK = RTDIR = /usr/src/rtai-24.1.10 |
|
From: <jmk...@us...> - 2003-07-19 02:17:44
|
Update of /cvsroot/emc/rtapi/src/rtapi
In directory sc8-pr-cvs1:/tmp/cvs-serv9258/src/rtapi
Modified Files:
Makefile localdefs.h rtai_rtapi.c rtapi.h ulapi.h
Log Message:
revised the API definition and made coresponding changes to rtai_rtapi.c
Index: Makefile
===================================================================
RCS file: /cvsroot/emc/rtapi/src/rtapi/Makefile,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Makefile 9 Jul 2003 17:51:26 -0000 1.2
--- Makefile 19 Jul 2003 02:17:41 -0000 1.3
***************
*** 77,91 ****
# DO NOT DELETE
! /proj/foundation/home/proctor/rtapi/lib/rtai_rtapi.o: rtapi.h
! /proj/foundation/home/proctor/rtapi/lib/rtai_ulapi.o: ulapi.h
! /proj/foundation/home/proctor/rtapi/lib/rtl_rtapi.o: rtapi.h
! /proj/foundation/home/proctor/rtapi/lib/rtl_ulapi.o: ulapi.h
! /proj/foundation/home/proctor/rtapi/lib/sim_rtapi.o: rtapi.h
! /proj/foundation/home/proctor/rtapi/lib/sim_ulapi.o: ulapi.h
! /proj/foundation/home/proctor/rtapi/rtlib/rtai_rtapi.o: rtapi.h
! /proj/foundation/home/proctor/rtapi/rtlib/rtai_ulapi.o: ulapi.h
! /proj/foundation/home/proctor/rtapi/rtlib/rtl_rtapi.o: rtapi.h
! /proj/foundation/home/proctor/rtapi/rtlib/rtl_ulapi.o: ulapi.h
! /proj/foundation/home/proctor/rtapi/rtlib/sim_rtapi.o: rtapi.h
! /proj/foundation/home/proctor/rtapi/rtlib/sim_ulapi.o: ulapi.h
--- 77,91 ----
# DO NOT DELETE
! /home/John/emcdev/rtapi/lib/rtai_rtapi.o: rtapi.h
! /home/John/emcdev/rtapi/lib/rtai_ulapi.o: ulapi.h
! /home/John/emcdev/rtapi/lib/rtl_rtapi.o: rtapi.h
! /home/John/emcdev/rtapi/lib/rtl_ulapi.o: ulapi.h
! /home/John/emcdev/rtapi/lib/sim_rtapi.o: rtapi.h
! /home/John/emcdev/rtapi/lib/sim_ulapi.o: ulapi.h
! /home/John/emcdev/rtapi/rtlib/rtai_rtapi.o: rtapi.h
! /home/John/emcdev/rtapi/rtlib/rtai_ulapi.o: ulapi.h
! /home/John/emcdev/rtapi/rtlib/rtl_rtapi.o: rtapi.h
! /home/John/emcdev/rtapi/rtlib/rtl_ulapi.o: ulapi.h
! /home/John/emcdev/rtapi/rtlib/sim_rtapi.o: rtapi.h
! /home/John/emcdev/rtapi/rtlib/sim_ulapi.o: ulapi.h
Index: localdefs.h
===================================================================
RCS file: /cvsroot/emc/rtapi/src/rtapi/localdefs.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** localdefs.h 19 Jul 2003 01:32:47 -0000 1.2
--- localdefs.h 19 Jul 2003 02:17:41 -0000 1.3
***************
*** 2,6 ****
#define LOCALDEFS_H
! /* automatically generated by config script on Fri Jul 18 21:25:01 EDT 2003 */
#define LOCAL_MHZ 233.866
--- 2,6 ----
#define LOCALDEFS_H
! /* automatically generated by config script on Fri Jul 18 22:11:03 EDT 2003 */
#define LOCAL_MHZ 233.866
Index: rtai_rtapi.c
===================================================================
RCS file: /cvsroot/emc/rtapi/src/rtapi/rtai_rtapi.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** rtai_rtapi.c 11 Jul 2003 02:52:43 -0000 1.2
--- rtai_rtapi.c 19 Jul 2003 02:17:41 -0000 1.3
***************
*** 8,12 ****
#include <linux/module.h>
#include <linux/kernel.h>
! #include <linux/malloc.h> /* kmalloc(), kfree(), GFP_USER */
#include <rtai.h>
#include <rtai_sched.h>
--- 8,15 ----
#include <linux/module.h>
#include <linux/kernel.h>
! /* FIXME - on my system malloc.h is deprecated, use slab.h instead */
! /* #include <linux/malloc.h> */ /* kmalloc(), kfree(), GFP_USER */
! #include <linux/slab.h>
!
#include <rtai.h>
#include <rtai_sched.h>
***************
*** 27,34 ****
--- 30,70 ----
#include "rtapi.h" /* these decls */
+
+ struct rtapi_task {
+ int magic; /* to check for valid handle */
+ RT_TASK ostask; /* OS specific task data */
+ };
+
+ struct rtapi_shmem {
+ int magic; /* to check for valid handle */
+ int key; /* key to shared memory area */
+ unsigned long int size; /* size of shared memory area */
+ void *mem; /* pointer to the memory */
+ };
+
+ struct rtapi_sem {
+ int magic; /* to check for valid handle */
+ SEM ossem; /* OS specific semaphore data */
+ };
+
+ struct rtapi_fifo {
+ int magic; /* to check for valid handle */
+ int fd; /* file descripter for fifo */
+ unsigned long int size; /* size of fifo area */
+ };
+
+ #define TASK_MAGIC 21979 /* random numbers used as signatures */
+ #define SHMEM_MAGIC 25453
+ #define SEM_MAGIC 27594
+ #define FIFO_MAGIC 10293
+
+
/* declare vsprintf() explicitly instead of including all of <stdio.h>,
since we don't need all of it and it may cause problems */
extern int vsprintf(char *s, const char *format, va_list arg);
+ /* Priority functions. RTAI uses 0 as the highest priority, as the
+ number increases, the actual priority of the task decreases. */
+
int rtapi_prio_highest(void)
{
***************
*** 43,49 ****
int rtapi_prio_next_higher(int prio)
{
! if (prio == rtapi_prio_highest())
! return prio;
return prio - 1;
}
--- 79,89 ----
int rtapi_prio_next_higher(int prio)
{
! /* return a valid priority for out of range arg */
! if (prio <= rtapi_prio_highest())
! return rtapi_prio_highest();
! if (prio > rtapi_prio_lowest())
! return rtapi_prio_lowest();
+ /* return next higher priority for in-range arg */
return prio - 1;
}
***************
*** 51,70 ****
int rtapi_prio_next_lower(int prio)
{
! if (prio == rtapi_prio_lowest())
! return prio;
!
return prio + 1;
}
int rtapi_init(void)
{
rt_linux_use_fpu(1);
!
! return 0;
}
int rtapi_exit(void)
{
! return 0;
}
--- 91,113 ----
int rtapi_prio_next_lower(int prio)
{
! /* return a valid priority for out of range arg */
! if (prio >= rtapi_prio_lowest())
! return rtapi_prio_lowest();
! if (prio < rtapi_prio_highest())
! return rtapi_prio_highest();
! /* return next lower priority for in-range arg */
return prio + 1;
}
+
int rtapi_init(void)
{
rt_linux_use_fpu(1);
! return RTAPI_SUCCESS;
}
int rtapi_exit(void)
{
! return RTAPI_SUCCESS;
}
***************
*** 73,165 ****
rt_set_periodic_mode();
start_rt_timer(nano2count((RTIME) nsecs));
! return 0;
}
! void *rtapi_task_new(void)
{
! return kmalloc(sizeof(RT_TASK), GFP_USER);
}
! int rtapi_task_delete(void *task)
{
! if (0 == task) {
! return -1;
! }
! kfree(task);
return 0;
}
! int
! rtapi_task_start(void *task,
! void *taskcode,
! int prio,
! unsigned long int stacksize,
! unsigned long int period_nsec, unsigned char uses_fp)
{
int retval;
! if (0 != rt_task_init((RT_TASK *) task, taskcode, 0, stacksize, prio, 1, 0))
! return -1;
! if (0 != rt_task_use_fpu((RT_TASK *) task, (int) uses_fp))
! return -1;
! if (period_nsec > 0) {
! retval = rt_task_make_periodic((RT_TASK *) task, rt_get_time(),
! nano2count((RTIME) period_nsec));
! } else {
! retval = rt_task_resume((RT_TASK *) task);
}
! return retval;
}
! int rtapi_task_stop(void *task)
{
! return rt_task_delete((RT_TASK *) task);
}
! int rtapi_task_pause(void *task)
{
! return rt_task_suspend((RT_TASK *) task);
}
! int rtapi_task_resume(void *task)
{
! return rt_task_resume((RT_TASK *) task);
}
! int rtapi_task_set_period(void *task, unsigned long int period_nsec)
{
! return rt_task_make_periodic((RT_TASK *) task, rt_get_time(),
nano2count((RTIME) period_nsec));
}
! int rtapi_self_set_period(unsigned long int period_nsec)
{
! return rt_task_make_periodic(rt_whoami(), rt_get_time(),
! nano2count((RTIME) period_nsec));
}
! int rtapi_wait(void)
{
! rt_task_wait_period();
! return 0;
}
! int rtapi_alloc_shmem(int key, unsigned int size, int *id, void **ptr)
{
! *ptr = rtai_kmalloc(key, size);
! /* leave id alone; we don't use it */
! if (0 != *ptr) {
! return 0;
}
! return -1;
}
! int rtapi_free_shmem(int key, unsigned int size, int id, const void *ptr)
{
! rtai_kfree(key);
! return 0;
}
--- 116,348 ----
rt_set_periodic_mode();
start_rt_timer(nano2count((RTIME) nsecs));
! return RTAPI_SUCCESS;
}
! int rtapi_task_new( rtapi_task_handle *taskptr )
{
! rtapi_task_handle task;
!
! /* validate taskptr */
! if ( taskptr == NULL )
! return RTAPI_INVAL;
!
! /* alloc space for task structure */
! task = kmalloc(sizeof(struct rtapi_task), GFP_USER);
! if ( task == NULL )
! return RTAPI_NOMEM;
!
! /* label as a valid task structure */
! task->magic = TASK_MAGIC;
!
! /* and return handle to the caller */
! *taskptr = task;
!
! return RTAPI_SUCCESS;
}
! int rtapi_task_delete( rtapi_task_handle task )
{
! /* validate task handle */
! if ( task == NULL )
! return RTAPI_BADH;
! if ( task->magic != TASK_MAGIC )
! return RTAPI_BADH;
! /* free the task struct */
! task->magic = 0;
! kfree( task );
return 0;
}
!
! int rtapi_task_start( rtapi_task_handle task,
! void (*taskcode)( int ),
! int arg, int prio,
! unsigned long int stacksize,
! unsigned long int period_nsec,
! unsigned char uses_fp )
{
int retval;
! /* validate task handle */
! if ( task == NULL )
! return RTAPI_BADH;
! if ( task->magic != TASK_MAGIC )
! return RTAPI_BADH;
!
! /* call OS to initialize the task */
! retval = rt_task_init( &(task->ostask), taskcode, arg,
! stacksize, prio, (int) uses_fp, 0);
! if ( retval != 0 ) {
! if ( retval == EINVAL )
! /* task already in use */
! return RTAPI_BUSY;
! if ( retval == ENOMEM )
! /* not enough space for stack */
! return RTAPI_NOMEM;
! /* unknown error */
! return RTAPI_INVAL;
}
! if ( period_nsec > 0) {
! /* start the task in periodic mode */
! retval = rt_task_make_periodic( &(task->ostask), rt_get_time(),
! nano2count((RTIME) period_nsec));
! if ( retval != 0 )
! return RTAPI_INVAL;
! }
! else {
! /* start task in free-running mode */
! retval = rt_task_resume( &(task->ostask) );
! if ( retval != 0 )
! return RTAPI_INVAL;
! }
!
! return RTAPI_SUCCESS;
}
! int rtapi_task_stop( rtapi_task_handle task )
{
! /* validate task handle */
! if ( task == NULL )
! return RTAPI_BADH;
! if ( task->magic != TASK_MAGIC )
! return RTAPI_BADH;
!
! return rt_task_delete( &(task->ostask) );
}
!
! int rtapi_task_pause( rtapi_task_handle task )
{
! /* validate task handle */
! if ( task == NULL )
! return RTAPI_BADH;
! if ( task->magic != TASK_MAGIC )
! return RTAPI_BADH;
!
! return rt_task_suspend( &(task->ostask) );
}
! int rtapi_task_resume( rtapi_task_handle task )
{
! /* validate task handle */
! if ( task == NULL )
! return RTAPI_BADH;
! if ( task->magic != TASK_MAGIC )
! return RTAPI_BADH;
!
! return rt_task_resume( &(task->ostask) );
}
! int rtapi_task_set_period( rtapi_task_handle task,
! unsigned long int period_nsec )
{
! /* validate task handle */
! if ( task == NULL )
! return RTAPI_BADH;
! if ( task->magic != TASK_MAGIC )
! return RTAPI_BADH;
!
! return rt_task_make_periodic( &(task->ostask), rt_get_time(),
nano2count((RTIME) period_nsec));
}
! int rtapi_wait( void )
{
! rt_task_wait_period();
! return RTAPI_SUCCESS;
}
!
! int rtapi_task_get_handle( rtapi_task_handle *taskptr )
{
! int offset;
! void *ptr;
!
! /* validate taskptr */
! if ( taskptr == NULL )
! return RTAPI_INVAL;
!
! /* ask OS for pointer to its data for the current task */
! ptr = rt_whoami();
! if ( ptr == NULL )
! /* called from outside a task? */
! return RTAPI_STATE;
!
! /* ptr points to OS data, somewhere inside rtapi
! struct, so calculate offset from start of struct */
! offset = (int)&(((struct rtapi_task *)0)->ostask);
!
! /* subtract offset to get start of struct */
! ptr -= offset;
!
! *taskptr = (rtapi_task_handle)ptr;
! return RTAPI_SUCCESS;
}
!
! int rtapi_shmem_new( int key, unsigned int size,
! rtapi_shmem_handle *shmemptr )
{
! rtapi_shmem_handle shmem;
!
! /* validate shmemptr */
! if ( shmemptr == NULL )
! return RTAPI_INVAL;
!
! /* alloc space for shmem structure */
! shmem = kmalloc(sizeof(struct rtapi_shmem), GFP_USER);
! if ( shmem == NULL )
! return RTAPI_NOMEM;
!
! /* now get shared memory block from OS */
! shmem->mem = rtai_kmalloc(key, size);
! if ( shmem->mem == NULL ) {
! kfree ( shmem );
! return RTAPI_NOMEM;
}
! /* label as a valid shmem structure */
! shmem->magic = SHMEM_MAGIC;
! /* fill in the other fields */
! shmem->size = size;
! shmem->key = key;
!
! /* return handle to the caller */
! *shmemptr = shmem;
! return RTAPI_SUCCESS;
}
!
! int rtapi_shmem_getptr ( rtapi_shmem_handle shmem, void **ptr )
{
! /* validate shmem handle */
! if ( shmem == NULL )
! return RTAPI_BADH;
! if ( shmem->magic != SHMEM_MAGIC )
! return RTAPI_BADH;
!
! /* pass memory address back to caller */
! *ptr = shmem->mem;
! return RTAPI_SUCCESS;
! }
!
!
! int rtapi_shmem_delete( rtapi_shmem_handle shmem )
! {
! /* validate shmem handle */
! if ( shmem == NULL )
! return RTAPI_BADH;
! if ( shmem->magic != SHMEM_MAGIC )
! return RTAPI_BADH;
!
! /* free the shared memory */
! rtai_kfree( shmem->key );
!
! /* free the shmem structure */
! shmem->magic = 0;
! kfree ( shmem );
! return RTAPI_SUCCESS;
}
***************
*** 171,175 ****
/* the call to vsprintf() will put arbitrarily many characters into
'buffer', and we can't easily check how many beforehand. This may
! cause a buffer overflow. The correct way to do this is as in
Exercise 7-3 in K&R's _C Language, 2nd Ed_ book */
va_start(args, fmt);
--- 354,358 ----
/* the call to vsprintf() will put arbitrarily many characters into
'buffer', and we can't easily check how many beforehand. This may
! cause a buffer overflow. The correct way to do this is as in
Exercise 7-3 in K&R's _C Language, 2nd Ed_ book */
va_start(args, fmt);
***************
*** 232,289 ****
}
! void *rtapi_sem_new(void)
{
! void *retval;
! retval = kmalloc(sizeof(SEM), GFP_USER);
! rt_sem_init(retval, 0);
! return retval;
}
! int rtapi_sem_delete(void *sem)
{
! if (0 == sem) {
! return -1;
! }
! kfree(sem);
! return 0;
}
! int rtapi_sem_give(void *sem)
{
! rt_sem_signal(sem);
! return 0;
}
! int rtapi_sem_take(void *sem)
{
! rt_sem_wait(sem);
! return 0;
}
! int rtapi_fifo_new(int key, int *fd, unsigned long int size)
{
! *fd = key;
! rtf_destroy(key);
! return rtf_create(key, size);
}
! int rtapi_fifo_delete(int key, int fd, unsigned long int size)
{
! return rtf_destroy(key);
}
! int rtapi_fifo_write(int fd, char *buf, unsigned long int size)
{
! return rtf_put(fd, buf, size);
}
! int rtapi_fifo_read(int fd, char *buf, unsigned long int size)
{
! return rtf_get(fd, buf, size);
}
--- 415,591 ----
}
!
!
! int rtapi_sem_new( rtapi_sem_handle *semptr )
{
! rtapi_sem_handle sem;
! /* validate semptr */
! if ( semptr == NULL )
! return RTAPI_INVAL;
! /* alloc space for sem structure */
! sem = kmalloc(sizeof(struct rtapi_sem), GFP_USER);
! if ( sem == NULL )
! return RTAPI_NOMEM;
! /* ask the OS to initialize the semaphore */
! rt_sem_init( &(sem->ossem), 0 );
!
! /* label as a valid sem structure */
! sem->magic = SEM_MAGIC;
!
! /* return handle to the caller */
! *semptr = sem;
! return RTAPI_SUCCESS;
}
!
! int rtapi_sem_delete( rtapi_sem_handle sem )
{
! /* validate sem handle */
! if ( sem == NULL )
! return RTAPI_BADH;
! if ( sem->magic != SEM_MAGIC )
! return RTAPI_BADH;
! /* ask the OS to shut down the semaphore */
! rt_sem_delete ( &(sem->ossem) );
!
! /* free the sem structure */
! sem->magic = 0;
! kfree ( sem );
! return RTAPI_SUCCESS;
}
! int rtapi_sem_give( rtapi_sem_handle sem )
{
! /* validate sem handle */
! if ( sem == NULL )
! return RTAPI_BADH;
! if ( sem->magic != SEM_MAGIC )
! return RTAPI_BADH;
! /* give up the semaphore */
! rt_sem_signal( &(sem->ossem) );
! return RTAPI_SUCCESS;
}
! int rtapi_sem_take( rtapi_sem_handle sem )
{
! /* validate sem handle */
! if ( sem == NULL )
! return RTAPI_BADH;
! if ( sem->magic != SEM_MAGIC )
! return RTAPI_BADH;
! /* get the semaphore */
! rt_sem_wait( &(sem->ossem) );
! return RTAPI_SUCCESS;
}
! extern int rtapi_sem_try( rtapi_sem_handle sem )
{
! /* validate sem handle */
! if ( sem == NULL )
! return RTAPI_BADH;
! if ( sem->magic != SEM_MAGIC )
! return RTAPI_BADH;
!
! /* try the semaphore */
! if ( rt_sem_wait_if ( &(sem->ossem) ) <= 0 )
! return RTAPI_BUSY;
! return RTAPI_SUCCESS;
}
!
! extern int rtapi_fifo_new( int key, unsigned long int size,
! rtapi_fifo_handle *fifoptr )
{
! rtapi_fifo_handle fifo;
! int retval;
!
! /* validate fifoptr */
! if ( fifoptr == NULL )
! return RTAPI_INVAL;
!
! /* alloc space for fifo structure */
! fifo = kmalloc(sizeof(struct rtapi_fifo), GFP_USER);
! if ( fifo == NULL )
! return RTAPI_NOMEM;
!
! /* I'm not sure why Fred calls destroy before create */
! rtf_destroy ( key );
!
! /* create the fifo */
! retval = rtf_create ( key, size );
! if ( retval != size ) {
! kfree ( fifo );
! if ( retval == ENOMEM )
! /* couldn't allocate memory */
! return RTAPI_NOMEM;
! return RTAPI_INVAL;
! }
!
! /* label as a valid fifo structure */
! fifo->magic = FIFO_MAGIC;
! /* fill in the rest of the struct */
! fifo->fd = key;
!
! /* return handle to the caller */
! *fifoptr = fifo;
! return RTAPI_SUCCESS;
}
! int rtapi_fifo_delete( rtapi_fifo_handle fifo )
{
! /* validate fifo handle */
! if ( fifo == NULL )
! return RTAPI_BADH;
! if ( fifo->magic != FIFO_MAGIC )
! return RTAPI_BADH;
!
! /* call the OS to destroy the fifo */
! rtf_destroy( fifo->fd );
!
! /* free the fifo structure */
! fifo->magic = 0;
! kfree ( fifo );
! return RTAPI_SUCCESS;
}
! int rtapi_fifo_read( rtapi_fifo_handle fifo,
! char *buf, unsigned long int size)
{
! int retval;
!
! /* validate fifo handle */
! if ( fifo == NULL )
! return RTAPI_BADH;
! if ( fifo->magic != FIFO_MAGIC )
! return RTAPI_BADH;
!
! /* get whatever data is available */
! retval = rtf_get( fifo->fd, buf, size );
! if ( retval < 0 )
! return RTAPI_INVAL;
! return retval;
! }
!
! int rtapi_fifo_write( rtapi_fifo_handle fifo,
! char *buf, unsigned long int size)
! {
! int retval;
!
! /* validate fifo handle */
! if ( fifo == NULL )
! return RTAPI_BADH;
! if ( fifo->magic != FIFO_MAGIC )
! return RTAPI_BADH;
!
! /* get whatever data is available */
! retval = rtf_put( fifo->fd, buf, size );
! if ( retval < 0 )
! return RTAPI_INVAL;
! return retval;
}
Index: rtapi.h
===================================================================
RCS file: /cvsroot/emc/rtapi/src/rtapi/rtapi.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** rtapi.h 15 Jul 2003 11:42:48 -0000 1.3
--- rtapi.h 19 Jul 2003 02:17:41 -0000 1.4
***************
*** 2,5 ****
--- 2,42 ----
#define RTAPI_H
+ /** These status codes are returned by many RTAPI functions. */
+
+ #define RTAPI_SUCCESS 0 /* call successfull */
+ #define RTAPI_UNSUP -1 /* function not supported */
+ #define RTAPI_BADH -2 /* bad task, shmem, sem, or fifo handle */
+ #define RTAPI_INVAL -3 /* invalid argument*/
+ #define RTAPI_NOMEM -4 /* not enough memory */
+ #define RTAPI_PERM -5 /* permission denied */
+ #define RTAPI_BUSY -6 /* resource is busy or locked */
+ #define RTAPI_EMPTY -7 /* buffer or fifo empty */
+ #define RTAPI_FULL -8 /* buffer or fifo full */
+ #define RTAPI_STATE -9 /* object state inappropriate, example:
+ calling init() after already inited,
+ or pausing an already paused task */
+
+
+ /** Typedefs for object handles. The structs to which these handles *
+ * refer are private, and may vary from one RTOS to another. *
+ * In fact, don't even count on handles always being pointers. */
+
+ typedef struct rtapi_task *rtapi_task_handle;
+ typedef struct rtapi_shmem *rtapi_shmem_handle;
+ typedef struct rtapi_sem *rtapi_sem_handle;
+ typedef struct rtapi_fifo *rtapi_fifo_handle;
+
+
+ /** 'rtapi_init() sets up the RTAPI. It must be called before calling *
+ * any rtapi functions. Returns a status code, as defined above. */
+
+ extern int rtapi_init( void );
+
+
+ /** 'ulapi_exit()' shuts down and cleans up the user space interface *
+ * to the RTAPI. It must be called before program exit. Returns a *
+ * status code. */
+
+ extern int rtapi_exit( void );
***************
*** 10,27 ****
* two methods: *
* *
! * Set your lowest priority task to 'rtapi_prio_lowest()', and for *
* each task of the next lowest priority, set their priorities to *
* 'rtapi_prio_next_higher(previous)'. *
* *
! * Or, *
! * *
! * Set your highest priority task to 'rtapi_prio_highest()', and for *
* each task of the next highest priority, set their priorities to *
* 'rtapi_prio_next_lower(previous)'. */
! extern int rtapi_prio_highest(void);
! extern int rtapi_prio_lowest(void);
! extern int rtapi_prio_next_higher(int prio);
! extern int rtapi_prio_next_lower(int prio);
--- 47,62 ----
* two methods: *
* *
! * 1) Set your lowest priority task to 'rtapi_prio_lowest()', and for *
* each task of the next lowest priority, set their priorities to *
* 'rtapi_prio_next_higher(previous)'. *
* *
! * 2) Set your highest priority task to 'rtapi_prio_highest()', and for *
* each task of the next highest priority, set their priorities to *
* 'rtapi_prio_next_lower(previous)'. */
! extern int rtapi_prio_highest( void );
! extern int rtapi_prio_lowest( void );
! extern int rtapi_prio_next_higher( int prio );
! extern int rtapi_prio_next_lower( int prio );
***************
*** 34,64 ****
* multiple realtime tasks in multiple kernel modules. Calling this *
* function after realtime tasks have been started may disrupt the *
! * tasks. Returns 0 on success, an RTOS specific error code on fail. */
extern int rtapi_clock_set_period(unsigned long int nsecs);
! /** 'rtapi_task_new()' is the first step in creating a task. Returns *
! * a pointer to internal rtapi and rtos data that describes the task. *
! * All other calls that relate to the task use this pointer as a task *
! * handle. Normally called from module init code, may block. Returns *
! * a non-zero task handle on success, zero on failure. */
!
! /* FIXME - I want to replace the current declaration with:
!
! typedef struct rtapi_task *rtapi_task_handle;
!
! rtapi_task_handle rtapi_task_new(void);
!
! The typedef permits typechecking on the task handle, while still
! hiding the internal contents of the structure. All functions that
! currently take or return a void pointer to a task would instead
! take or return a rtapi_task_handle. The actual code generated is
! the same, but this form allows compile time type checking.
!
! I will implement the change if/when we reach a concensus that it
! is a good thing. John M Kasunich - 7/10/03 */
! extern void *rtapi_task_new(void);
--- 69,84 ----
* multiple realtime tasks in multiple kernel modules. Calling this *
* function after realtime tasks have been started may disrupt the *
! * tasks. Returns a status code. */
extern int rtapi_clock_set_period(unsigned long int nsecs);
! /** 'rtapi_task_new()' is the first step in creating a task. Allocs *
! * and initializes internal rtapi and rtos data related to the task. *
! * Returns a status code. On success, '*taskptr' becomes a handle *
! * which points to the internal task data. This handle is used for all *
! * subsequent calls that need to act on the task. */
! extern int rtapi_task_new( rtapi_task_handle *taskptr );
***************
*** 66,89 ****
* It frees memory associated with 'task', and does any other cleanup *
* needed. If the task has been started, you must stop it before *
! * deleting it, or bad things might happen. Returns zero on success, *
! * an RTOS dependent error code on failure. Call from within module *
! * cleanup code or any _other_ task - a task should not attempt to *
! * delete itself! */
!
! /* FIXME change to:
! int rtapi_task_delete( rtapi_task_handle task );
! */
! extern int rtapi_task_delete(void *task);
/** 'rtapi_task_start()' does the bulk of the work needed to create *
* and run a realtime task. 'task' is a task handle from a call to *
! * rtapi_task_new(). 'taskcode' is the name of a function containing *
! * the task code. 'prio' is the priority, as determined by one of the *
! * priority functions above. 'stacksize' is the amount of stack to be *
! * reserved for the task - be generous, hardware interrupts use the *
! * same stack. 'period_nsec' is the task period in nanoseconds, which *
! * will be rounded to the nearest multiple of the global clock period. *
* If non-zero, 'uses_fp' tells the OS that the task uses floating *
* point so it can save the FPU registers on a task switch. Failing *
--- 86,106 ----
* It frees memory associated with 'task', and does any other cleanup *
* needed. If the task has been started, you must stop it before *
! * deleting it, or bad things might happen. Returns a status code. *
! * Call from within module cleanup code or any other task. A task *
! * should not attempt to delete itself! */
! extern int rtapi_task_delete( rtapi_task_handle task );
/** 'rtapi_task_start()' does the bulk of the work needed to create *
* and run a realtime task. 'task' is a task handle from a call to *
! * rtapi_task_new(). 'taskcode' is the name of a function taking one *
! * int and returning void, which contains the task code. 'arg' will be *
! * passed to 'taskcode' when the task is invoked. 'prio' is the *
! * priority, as determined by one of the priority functions above. *
! * 'stacksize' is the amount of stack to be reserved for the task - be *
! * generous, hardware interrupts may use the same stack. 'period_nsec' *
! * is the task period in nanoseconds, which will be rounded to the *
! * nearest multiple of the global clock period. *
* If non-zero, 'uses_fp' tells the OS that the task uses floating *
* point so it can save the FPU registers on a task switch. Failing *
***************
*** 91,97 ****
* tasks should set 'uses_fp' to 1. If a task definitely does not use *
* floating point, setting 'uses_fp' to zero saves a few microseconds *
! * on each task switch. Returns zero on success, an RTOS dependent *
! * error code on failure. call from module init code (preferred) or *
! * within a realtime task. May block. */
/* FIXME - Fred, you have code in the implementations of this function
--- 108,113 ----
* tasks should set 'uses_fp' to 1. If a task definitely does not use *
* floating point, setting 'uses_fp' to zero saves a few microseconds *
! * per task switch. Returns a status code. Call from module init code *
! * (preferred) or within a realtime task. May block. */
/* FIXME - Fred, you have code in the implementations of this function
***************
*** 101,216 ****
*/
! /* FIXME - change to:
! extern int rtapi_task_start(rtapi_task_handle task,
! void (*taskcode)( int ),
! int arg,
! int prio,
! unsigned long int stacksize,
! unsigned long int period_nsec,
! unsigned char uses_fp);
!
! This declares 'taskcode' as a 'pointer to function taking one int and
! returning void', which lets the compiler make sure it is really a
! valid function. Adding 'arg' lets the task init code pass a parameter
! to the realtime task code, which can be cast to a pointer to any kind
! of data structure that might be needed. Can be useful for letting the
! task code know where shared memory is located.
! */
!
! extern int rtapi_task_start(void *task, void *taskcode, int prio,
! unsigned long int stacksize,
! unsigned long int period_nsec,
! unsigned char uses_fp);
/** 'rtapi_task_stop()' is the counterpart to 'rtapi_task_start()'. *
* Permanently stops 'task', and prepares it to be deleted. Returns *
! * zero on success, and an RTOS dependent error code on failure. Call *
! * from within module cleanup code or any _other_ task - a task should *
! * not attempt to stop itself! */
!
! /* FIXME - change to:
! extern int rtapi_task_stop(rtapi_task_handle task );
! */
! extern int rtapi_task_stop(void *task);
/** 'rtapi_task_pause() causes 'task' to temporarily stop execution. *
* It will resume when 'rtapi_task_resume()' is called with the same *
! * task handle. Returns zero on success, an RTOS dependent error code *
! * on failure. A task can pause itself, but obviously cannot resume *
! * itself. Note: depending on the RTOS, multiple 'pauses' may or may *
! * not be canceled by a single 'resume'. To be safe, don't pause a *
! * task more than once. */
! /* FIXME - we could modify the wrapper function to keep track of pauses
! and resumes, and consistently provide one behavior or the other, instead
! of leaving it RTOS dependent.
! */
- /* FIXME - change to:
- extern int rtapi_task_pause(rtapi_task_handle task);
- extern int rtapi_task_resume(rtapi_task_handle task);
- */
! extern int rtapi_task_pause(void *task);
! extern int rtapi_task_resume(void *task);
! /** 'rtapi_task_set_period()' and 'rtapi_self_set_period()' are used *
! * to change the period of a task. The new period is 'period_nsec', *
! * rounded to the nearest integer multiple of the global period as set *
! * by 'rtapi_clock_set_period()'. Returns zero on success, an RTOS *
! * dependent error code on failure. */
- /* FIXME - consider deleting the 'self' version of this function, and
- instead provide a function that returns the handle of the current task,
- like this:
- rtapi_task_handle rtapi_self(void);
! That's a more generic way to allow a task to call any rtapi function
! on itself.
! */
! /* FIXME - replace with:
- extern int rtapi_task_set_period(rtapi_task_handle task,
- unsigned long int period_nsec);
- */
! extern int rtapi_task_set_period(void *task, unsigned long int period_nsec);
! extern int rtapi_self_set_period(unsigned long int period_nsec);
- /** 'rtapi_wait()' suspends execution of the current task until the *
- * next period. At the beginning of the next period, execution will *
- * resume immediately after the call to 'rtapi_wait()', instead of at *
- * beginning of the 'taskcode' function. Returns zero on success, and *
- * an RTOS dependent errorcode on failure. Call only from a task. */
! extern int rtapi_wait(void);
- /** 'rtapi_alloc_shmem()' allocates and maps a block of shared memory. *
- * 'key' identifies the memory block, all modules wishing to access *
- * the same memory must use the same key. The block will be at least *
- * 'size' bytes, and may be rounded up. Allocating many small blocks *
- * may be very wasteful. 'id' is a pointer to an int that may be used *
- * by rtapi_alloc_shmem() for an internal identifier - retain the value *
- * in 'id' until you call rtapi_free_shmem(). 'ptr' is a pointer to *
- * a void pointer, which will be set to point to the allocated memory. *
- * Returns zero on success, and an RTOS dependent errorcode on failure. */
! extern int rtapi_alloc_shmem(int key, unsigned int size,
! int *id, void **ptr);
- /** 'rtapi_free_shmem()' frees a block of memory that was allocated by *
- * rtapi_alloc_shmem(). 'key', 'size', 'id', and 'ptr' must match the *
- * values from the call that allocated the block. Returns zero on *
- * success, and an RTOS dependent errorcode on failure. */
! extern int rtapi_free_shmem(int key, unsigned int size,
! int id, const void *ptr);
--- 117,194 ----
*/
! extern int rtapi_task_start( rtapi_task_handle task,
! void (*taskcode)( int ),
! int arg, int prio,
! unsigned long int stacksize,
! unsigned long int period_nsec,
! unsigned char uses_fp );
/** 'rtapi_task_stop()' is the counterpart to 'rtapi_task_start()'. *
* Permanently stops 'task', and prepares it to be deleted. Returns *
! * a status code. Call from within module cleanup code or any other *
! * task - a task should not attempt to stop itself! */
! extern int rtapi_task_stop( rtapi_task_handle task );
/** 'rtapi_task_pause() causes 'task' to temporarily stop execution. *
* It will resume when 'rtapi_task_resume()' is called with the same *
! * task handle. A task can pause itself, but obviously cannot resume *
! * itself. Returns a status code. */
! extern int rtapi_task_pause( rtapi_task_handle task );
! extern int rtapi_task_resume( rtapi_task_handle task );
! /** 'rtapi_task_set_period()' sets the period of a task. The new *
! * period is 'period_nsec', rounded to the nearest integer multiple of *
! * the global period as set by 'rtapi_clock_set_period()'. Returns a *
! * status code. */
! extern int rtapi_task_set_period( rtapi_task_handle task,
! unsigned long int period_nsec );
! /** 'rtapi_wait()' suspends execution of the current task until the *
! * next period. At the beginning of the next period, execution will *
! * resume immediately after the call to 'rtapi_wait()', instead of at *
! * beginning of the 'taskcode' function. Call only from a task. *
! * Returns a status code. */
! extern int rtapi_wait( void );
! /** 'rtapi_task_get_handle()' sets '*taskptr' equal to the handle of */
! /* the current task. Call only from a task. Returns a status code. */
+ extern int rtapi_task_get_handle( rtapi_task_handle *taskptr );
! /** 'rtapi_shmem_new()' allocates a block of shared memory. 'key' *
! * identifies the memory block, all modules wishing to access the same *
! * memory must use the same key. The block will be at least 'size' *
! * bytes, and may be rounded up. Allocating many small blocks may be *
! * very wasteful. On success, '*shmemptr' becomes a handle pointing *
! * to internal data for the shared memory and is used for subsequent *
! * calls dealing with the block. Remember that '*shmemptr' points to *
! * internal data, not the actual shared memory. To get a pointer to *
! * the shared memory, pass the handle to 'rtapi_shmem_getptr()'. *
! * Returns a status code. */
+ extern int rtapi_shmem_new( int key, unsigned int size,
+ rtapi_shmem_handle *shmemptr );
! /** 'rtapi_shmem_getptr()' sets '*ptr' to point to the start of the *
! * shared memory block 'mbuf'. Returns a status code. */
+ extern int rtapi_shmem_getptr ( rtapi_shmem_handle shmem, void **ptr );
! /** 'rtapi_shmem_delete()' frees the shared memory block 'mbuf'. *
! * Returns a status code. */
!
! extern int rtapi_shmem_delete( rtapi_shmem_handle shmem );
***************
*** 223,227 ****
* can take a fairly long time, depending on the format string and OS. */
! extern void rtapi_print(const char *fmt, ...);
--- 201,205 ----
* can take a fairly long time, depending on the format string and OS. */
! extern void rtapi_print( const char *fmt, ... );
***************
*** 229,239 ****
* Note: This function does nothing on the simulated RTOS. */
! extern void rtapi_outb(unsigned char byte, unsigned int port);
! /** 'rtapi_inb() gets a byte from 'port'. *
* Note: This function always returns zero on the simulated RTOS. */
! extern unsigned char rtapi_inb(unsigned int port);
--- 207,217 ----
* Note: This function does nothing on the simulated RTOS. */
! extern void rtapi_outb( unsigned char byte, unsigned int port );
! /** 'rtapi_inb() gets a byte from 'port'. Returns the byte. *
* Note: This function always returns zero on the simulated RTOS. */
! extern unsigned char rtapi_inb( unsigned int port );
***************
*** 241,251 ****
* a hardware interrupt. 'irq' is the interrupt number, and 'handler' *
* is a pointer to a function taking no arguements and returning void. *
! * 'handler will be called when the interrupt occurs. Returns zero on *
! * success, and an RTOS specific error code on failure. Note: The *
! * simulated RTOS always returns zero, but does nothing - it does not *
! * support interrupts. */
! extern int rtapi_assign_interrupt_handler(unsigned int irq,
! void (*handler) (void));
--- 219,227 ----
* a hardware interrupt. 'irq' is the interrupt number, and 'handler' *
* is a pointer to a function taking no arguements and returning void. *
! * 'handler will be called when the interrupt occurs. Returns a status *
! * code. Note: The simulated RTOS does not support interrupts. */
! extern int rtapi_assign_interrupt_handler( unsigned int irq,
! void (*handler) (void) );
***************
*** 254,389 ****
* is the interrupt number. Removing a realtime module without freeing *
* any handlers it has installed will almost certainly crash the box. *
! * Returns zero on success, an RTOS specific error code on failure. */
! extern int rtapi_free_interrupt_handler(unsigned int irq);
/** 'rtapi_enable_interrupt()' and 'rtapi_disable_interrupt()' are *
* are used to enable and disable interrupts, presumably ones that have *
! * handlers assigned to them. Returns 0 on success, an RTOS specific *
! * error code on failure. */
!
! extern int rtapi_enable_interrupt(unsigned int irq);
! extern int rtapi_disable_interrupt(unsigned int irq);
!
!
! /** 'rtapi_sem_new()' creates a realtime semaphore. Returns a pointer *
! * to RTAPI and RTOS specific data associated with the semaphore. All *
! * other semaphore functions use this pointer as a semaphore handle. *
! * Normally called from module init code, may block. Returns a non- *
! * zero semaphore handle on success, zero on failure. */
! /* FIXME - I want to treat semaphore handles like task handles:
- typedef struct rtapi_sem *rtapi_sem_handle;
! rtapi_sem_handle rtapi_sem_new(void);
! */
! extern void *rtapi_sem_new(void);
/** 'rtapi_sem_delete()' is the counterpart to 'rtapi_sem_new()'. It *
* destroys the semaphore 'sem'. Any tasks blocked on 'sem' will *
! * resume execution. Returns zero on success, an RTOS dependent error *
! * code on failure. */
!
! /* FIXME change to:
! int rtapi_sem_delete( rtapi_sem_handle sem );
! */
! extern int rtapi_sem_delete(void *sem);
/** 'rtapi_sem_give()' unlocks a semaphore. If a higher priority task *
* is blocked on the semaphore, the calling task will block and the *
! * higher priority task will begin to run. Returns zero on success, an *
! * RTOS dependent error code on failure. */
!
! /* FIXME change to:
! int rtapi_sem_give( rtapi_sem_handle sem );
! */
! extern int rtapi_sem_give(void *sem);
- /** 'rtapi_sem_take()' locks a semaphore. If the semaphore is *
- * unlocked it returns zero immediately. If the semaphore is locked, *
- * the calling task blocks until the semaphore is unlocked, then it *
- * returns zero. On an error, it returns an RTOS dependent error code. */
! /* FIXME change to:
! int rtapi_sem_take( rtapi_sem_handle sem );
! */
! extern int rtapi_sem_take(void *sem);
/** 'rtapi_sem_try()' does a non-blocking attempt to lock a semaphore. *
! * If the semaphore is unlocked, it returns zero. If the semaphore is *
! * locked it does not block, instead it returns EAGAIN, and the caller *
! * can decide how to deal with the situation. On an error, it returns *
! * an RTOS dependent error code. */
!
! /* FIXME this function was not in the original RTAPI. Both RTLinux and
! RTAI provide the neccessary primitives, and if there is no objection I
! will implement it. JMK 7/14/03
! int rtapi_sem_try( rtapi_sem_handle sem );
! */
/** 'rtapi_fifo_new()' creates a realtime fifo. 'key' identifies the *
* fifo, all modules wishing to access the same fifo must use the same *
! * key. 'size' is the size of the desired fifo. 'fd' is a pointer *
! * to an int used by rtapi_fifo_new() as a file descripter associated *
! * with the fifo - retain the value in 'fd' until you delete the fifo. *
! * Returns zero on success, and an RTOS dependent errorcode on failure. */
!
! extern int rtapi_fifo_new(int key, int *fd, unsigned long int size);
!
! /** "rtapi_fifo_delete()' deletes a fifo that was created by a call to *
! * rtapi_fifo_new(). 'key', 'fd', and 'size' must match the values *
! * from the call that created the fifo. On success, returns zero or a *
! * positive number that identifies the number of other modules still *
! * attached to the fifo. On error, returns an RTOS dependent errorcode *
! * that is negative. */
- /* FIXME - the return value above is based on RTAI. The RTLinux docs
- aren't clear about what the return value is, may be the same or maybe
- not. Should we change the implementation to always return zero on
- success, or is the RTAI style return value usefull? I will make the
- change unless there are objections. JMK 7/14/03 */
! extern int rtapi_fifo_delete(int key, int fd, unsigned long int size);
- /** 'rtapi_fifo_read()' reads data from a fifo. 'fd' is the fifo *
- * descripter returned when the fifo was created. 'buf' is a buffer *
- * for the data. 'size' is the maximum number of bytes to read. *
- * Returns the number of bytes read, or a negative error code on *
- * failure. Does not block. If 'size' bytes are not available, it *
- * will read whatever is available, and return that count (which could *
- * be zero). */
! extern int rtapi_fifo_write(int fd, char *buf, unsigned long int size);
- /** 'rtapi_fifo_write()' writes data to a fifo. 'fd' is the descripter *
- * returned when the fifo was created. 'buf' is a buffer for the data. *
- * Returns the number of bytes written. If successfull, the return *
- * value will match 'size'. Does not block. If 'size' bytes of space *
- * are not available in the fifo, rtapi_fifo_write() will either do a *
- * partial write and return the number of bytes actually written, or *
- * fail and return a negative error code, depending on the RTOS. */
! /* FIXME - different actions when the fifo is full could cause problems.
! The second action can be modified to be compatible with the first - if
! there isn't enough room for 'size' bytes, return zero, to indicate zero
! bytes written. Any caller that can deal with the partial writes
! should also be able to handle partial writes that write nothing.
! I will implement this if there are no objections. JMK 7/14/03 */
! extern int rtapi_fifo_read(int fd, char *buf, unsigned long int size);
--- 230,320 ----
* is the interrupt number. Removing a realtime module without freeing *
* any handlers it has installed will almost certainly crash the box. *
! * Returns RTAPI_SUCCESS or RTAPI_INVAL. */
! extern int rtapi_free_interrupt_handler( unsigned int irq );
/** 'rtapi_enable_interrupt()' and 'rtapi_disable_interrupt()' are *
* are used to enable and disable interrupts, presumably ones that have *
! * handlers assigned to them. Returns a status code. */
! extern int rtapi_enable_interrupt( unsigned int irq );
! extern int rtapi_disable_interrupt( unsigned int irq );
! /** 'rtapi_sem_new()' creates a realtime semaphore. On success, *
! * '*semptr' becomes a semaphore handle, which points to internal data *
! * for the semaphore is used for subsequent calls dealing with it. *
! * Returns a status code. */
! extern int rtapi_sem_new( rtapi_sem_handle *semptr );
/** 'rtapi_sem_delete()' is the counterpart to 'rtapi_sem_new()'. It *
* destroys the semaphore 'sem'. Any tasks blocked on 'sem' will *
! * resume execution. Returns a status code. */
! extern int rtapi_sem_delete( rtapi_sem_handle sem );
/** 'rtapi_sem_give()' unlocks a semaphore. If a higher priority task *
* is blocked on the semaphore, the calling task will block and the *
! * higher priority task will begin to run. Returns a status code. */
! extern int rtapi_sem_give( rtapi_sem_handle sem );
! /** 'rtapi_sem_take()' locks a semaphore. Returns RTAPI_SUCCESS or *
! * RTAPI_BADH. If the semaphore is unlocked it returns RTAPI_SUCCESS *
! * immediately. If the semaphore is locked, the calling task blocks *
! * until the semaphore is unlocked, then it returns RTAPI_SUCCESS. */
! extern int rtapi_sem_take( rtapi_sem_handle sem );
/** 'rtapi_sem_try()' does a non-blocking attempt to lock a semaphore. *
! * Returns RTAPI_SUCCESS, RTAPI_BADH, or RTAPI_BUSY. If the semaphore *
! * is unlocked, it returns RTAPI_SUCCESS. If the semaphore is locked *
! * it does not block, instead it returns RTAPI_BUSY, and the caller can *
! * decide how to deal with the situation. */
! extern int rtapi_sem_try( rtapi_sem_handle sem );
/** 'rtapi_fifo_new()' creates a realtime fifo. 'key' identifies the *
* fifo, all modules wishing to access the same fifo must use the same *
! * key. 'size' is the depth of the fifo. On success, '*fifoptr' *
! * becomes a fifo handle, which points to internal data for the fifo *
! * and is used for subsequent calls dealing with it. Returns a status *
! * code. */
! extern int rtapi_fifo_new( int key, unsigned long int size,
! rtapi_fifo_handle *fifoptr );
! /** 'rtapi_fifo_delete()' is the counterpart to 'rtapi_fifo_new()'. *
! * It destroys the fifo 'fifo'. Returns a status code. */
+ extern int rtapi_fifo_delete( rtapi_fifo_handle fifo );
! /** 'rtapi_fifo_read()' reads data from 'fifo'. 'buf' is a buffer for *
! * the data, and 'size' is the maximum number of bytes to read. *
! * Returns the number of bytes actually read, or RTAPI_BADH. Does not *
! * block. If 'size' bytes are not available, it will read whatever is *
! * available, and return that count (which could be zero). */
+ extern int rtapi_fifo_read( rtapi_fifo_handle fifo,
+ char *buf, unsigned long int size);
! /** 'rtapi_fifo_write()' writes data to 'fifo'. Up to 'size' bytes are *
! * taken from the buffer at 'buf'. Returns the count of bytes actually *
! * written, or RTAPI_BADH. Does not block. If 'size' bytes of space *
! * are not available in the fifo, rtapi_fifo_write() will write as many *
! * bytes as it can and return that count (which may be zero). */
! extern int rtapi_fifo_write( rtapi_fifo_handle fifo,
! char *buf, unsigned long int size);
Index: ulapi.h
===================================================================
RCS file: /cvsroot/emc/rtapi/src/rtapi/ulapi.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** ulapi.h 15 Jul 2003 11:42:48 -0000 1.2
--- ulapi.h 19 Jul 2003 02:17:41 -0000 1.3
***************
*** 3,86 ****
/** 'ulapi_init() sets up the user space interface to the RTAPI. It *
! * must be called before calling any ulapi functions. Returns zero on *
! * success, and an RTOS specific error code on failure. */
- extern int ulapi_init(void);
/** 'ulapi_exit()' shuts down and cleans up the user space interface *
! * to the RTAPI. It must be called before program exit. Returns zero *
! * on success, and an RTOS specific error code on failure. */
! extern int ulapi_exit(void);
! /** 'ulapi_alloc_shmem()' allocates and maps a block of shared memory. *
! * 'key' identifies the memory block, all modules wishing to access *
! * the same memory must use the same key. The block will be at least *
! * 'size' bytes, and may be rounded up. Allocating many small blocks *
! * may be very wasteful. 'id' is a pointer to an int that may be used *
! * by ulapi_alloc_shmem() for an internal identifier - retain the value *
! * in 'id' until you call ulapi_free_shmem(). 'ptr' is a pointer to *
! * a void pointer, which will be set to point to the allocated memory. *
! * Returns zero on success, and an RTOS dependent errorcode on failure. */
! extern int ulapi_alloc_shmem(int key, unsigned int size,
! int *id, void **ptr);
! /** 'ulapi_free_shmem()' frees a block of memory that was allocated by *
! * ulapi_alloc_shmem(). 'key', 'size', 'id', and 'ptr' must match the *
! * values from the call that allocated the block. Returns zero on *
! * success, and an RTOS dependent errorcode on failure. */
! extern int ulapi_free_shmem(int key, unsigned int size,
! int id, const void *ptr);
! /** 'ulapi_fifo_new()' creates a realtime fifo. 'key' identifies the *
! * fifo, all modules wishing to access the same fifo must use the same *
! * key. 'size' is the size of the desired fifo. 'fd' is a pointer *
! * to an int used by ulapi_fifo_new() as a file descripter associated *
! * with the fifo - retain the value in 'fd' until you delete the fifo. *
! * Returns zero on success, and an RTOS dependent errorcode on failure. */
! /* FIXME - the current inplementations open the fifo using O_RDONLY.
! That means it can only be used with ulapi_fifo_read() to transfer
! data from kernel space (realtime tasks) to user space. Probably
! need to add a mode or data direction parameter to this function. */
- extern int ulapi_fifo_new(int key, int *fd, unsigned long int size);
! /** "ulapi_fifo_delete()' deletes a fifo that was created by a call to *
! * ulapi_fifo_new(). 'key', 'fd', and 'size' must match the values *
! * from the call that created the fifo. Returns zero on success, and *
! * an RTOS dependent errorcode on failure. */
- extern int ulapi_fifo_delete(int key, int fd, unsigned long int size);
! /** 'ulapi_fifo_read()' reads data from a fifo. 'fd' is the fifo *
! * descripter returned when the fifo was created. 'buf' is a buffer *
! * for the data. 'size' is the maximum number of bytes to read. *
! * Returns the number of bytes read, or a negative error code on *
! * failure. */
- /* FIXME - Blocking/nonblocking behavior depends on how the fifo
- was opened, which is not clear at this time. */
! extern int ulapi_fifo_read(int fd, char *buf, unsigned long int size);
- /** 'ulapi_fifo_write()' writes data to a fifo. 'fd' is the descripter *
- * returned when the fifo was created. 'buf' is a buffer for the data. *
- * Returns the number of bytes written. If successfull, the return *
- * value will match 'size'. */
! /* FIXME - Blocking/nonblocking behavior depends on how the fifo
! was opened, which is not clear at this time. */
! extern int ulapi_fifo_write(int fd, char *buf, unsigned long int size);
--- 3,101 ----
+ /** Error Codes: These error codes may be returned by UTAPI functions. */
+
+ #define ULAPI_SUCCESS 0 /* no error */
+ #define ULAPI_UNSUP -1 /* function not supported */
+ #define ULAPI_BADH -2 /* bad task, shmem, sem, or fifo handle */
+ #define ULAPI_INVAL -3 /* invalid argument*/
+ #define ULAPI_BUSY -4 /* resource is busy or locked */
+ #define ULAPI_NOMEM -5 /* not enough memory */
+ #define ULAPI_PERM -6 /* permission denied */
+ #define ULAPI_EMPTY -7 /* buffer or fifo empty */
+ #define ULAPI_FULL -8 /* buffer or fifo full */
+
+
+ /** Typedefs for object handles. The structs to which these handles *
+ * refer are private, and may vary from one RTOS to another. */
+
+ typedef struct ulapi_shmem *ulapi_shmem_handle;
+ typedef struct ulapi_sem *ulapi_sem_handle;
+ typedef struct ulapi_fifo *ulapi_fifo_handle;
+
+
/** 'ulapi_init() sets up the user space interface to the RTAPI. It *
! * must be called before calling any ulapi functions. Returns *
! * ULAPI_SUCCESS, ULAPI_BUSY, ULAPI_NOMEM, or ULAPI_PERM. */
!
! extern int ulapi_init( void );
/** 'ulapi_exit()' shuts down and cleans up the user space interface *
! * to the RTAPI. It must be called before program exit. Returns *
! * ULAPI_SUCCESS. */
! extern int ulapi_exit( void );
! /** 'ulapi_shmem_new()' allocates a block of shared memory. 'key' *
! * identifies the memory block, all modules wishing to access the same *
! * memory must use the same key. The block will be at least 'size' *
! * bytes, and may be rounded up. Allocating many small blocks may be *
! * very wasteful. On success, '*mbuf' becomes a shared memory handle, *
! * which points to internal data for the shared memory and is used for *
! * subsequent calls dealing with the block. Returns ULAPI_SUCCESS, *
! * ULAPI_INVAL, or ULAPI_NOMEM. */
! extern int ulapi_shmem_new( int key, unsigned int size,
! ulapi_shmem_handle *mbuf );
! /** 'ulapi_shmem_getptr()' sets '*ptr' to point to the start of the *
! * shared memory block 'mbuf'. Returns ULAPI_SUCCESS or ULAPI_BADH. */
! extern int ulapi_shmem_getptr ( ulapi_shmem_handle mbuf, void **ptr );
! /** 'ulapi_shmem_delete()' frees the shared memory block 'mbuf'. *
! * Returns ULAPI_SUCCESS or ULAPI_BADH. */
! extern int ulapi_shmem_delete( ulapi_shmem_handle mbuf );
+ /** 'ulapi_fifo_new()' opens a fifo for communication with realtime *
+ * code. 'key' identifies the fifo, all modules wishing to access the *
+ * same fifo must use the same key. 'size' is the size of the desired *
+ * fifo. 'mode' is either 'R' or 'W', for readable or writeable fifos. *
+ * On success, '*fifo' becomes a fifo handle, which points to internal *
+ * data for the fifo and is used for subsequent calls dealing with it. *
+ * Returns ULAPI_SUCCESS, ULAPI_INVAL, ULAPI_NOMEM, or ULAPI_PERM. */
! extern int ulapi_fifo_new( int key, unsigned long int size, char mode,
! ulapi_fifo_handle *fifo );
+ /** 'ulapi_fifo_delete()' is the counterpart to 'ulapi_fifo_new()'. *
+ * It destroys the fifo 'fifo'. Returns ULAPI_SUCCESS or ULAPI_BADH. */
! extern int ulapi_fifo_delete( ulapi_fifo_handle fifo );
! /** 'rtapi_fifo_read()' reads data from 'fifo'. 'buf' is a buffer for *
! * the data, and 'size' is the maximum number of bytes to read. *
! * Returns the number of bytes actually read, or RTAPI_BADH. Does not *
! * block. If 'size' bytes are not available, it will read whatever is *
! * available, and return that count (which could be zero). */
+ extern int rtapi_fifo_read( rtapi_fifo_handle fifo,
+ char *buf, unsigned long int size);
! /** 'rtapi_fifo_write()' writes data to 'fifo'. Up to 'size' bytes are *
! * taken from the buffer at 'buf'. Returns the count of bytes actually *
! * written, or RTAPI_BADH. Does not block. If 'size' bytes of space *
! * are not available in the fifo, rtapi_fifo_write() will write as many *
! * bytes as it can and return that count (which may be zero). */
! extern int rtapi_fifo_write(int fd, char *buf, unsigned long int size);
|
|
From: <jmk...@us...> - 2003-07-19 02:17:44
|
Update of /cvsroot/emc/rtapi/examples/timertask In directory sc8-pr-cvs1:/tmp/cvs-serv9258/examples/timertask Modified Files: Makefile Log Message: revised the API definition and made coresponding changes to rtai_rtapi.c Index: Makefile =================================================================== RCS file: /cvsroot/emc/rtapi/examples/timertask/Makefile,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** Makefile 8 Jul 2003 15:54:39 -0000 1.1.1.1 --- Makefile 19 Jul 2003 02:17:41 -0000 1.2 *************** *** 32,36 **** # DO NOT DELETE - - /proj/foundation/home/proctor/rtapi/rtlib/timertask.o: /proj/foundation/home/proctor/rtapi/include/rtapi.h - /proj/foundation/home/proctor/rtapi/rtlib/timertask.o: /proj/foundation/home/proctor/rtapi/include/rtapi_app.h --- 32,33 ---- |
|
From: <jmk...@us...> - 2003-07-19 02:17:44
|
Update of /cvsroot/emc/rtapi/examples/fifo In directory sc8-pr-cvs1:/tmp/cvs-serv9258/examples/fifo Modified Files: Makefile Log Message: revised the API definition and made coresponding changes to rtai_rtapi.c Index: Makefile =================================================================== RCS file: /cvsroot/emc/rtapi/examples/fifo/Makefile,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** Makefile 8 Jul 2003 15:54:39 -0000 1.1.1.1 --- Makefile 19 Jul 2003 02:17:41 -0000 1.2 *************** *** 50,62 **** # DO NOT DELETE ! /proj/foundation/home/proctor/rtapi/lib/fifotask.o: /proj/foundation/home/proctor/rtapi/include/rtapi.h ! /proj/foundation/home/proctor/rtapi/lib/fifotask.o: /proj/foundation/home/proctor/rtapi/include/rtapi_app.h ! /proj/foundation/home/proctor/rtapi/lib/fifotask.o: common.h ! /proj/foundation/home/proctor/rtapi/lib/fifousr.o: /proj/foundation/home/proctor/rtapi/include/ulapi.h ! /proj/foundation/home/proctor/rtapi/lib/fifousr.o: common.h ! /proj/foundation/home/proctor/rtapi/rtlib/fifotask.o: /proj/foundation/home/proctor/rtapi/include/rtapi.h ! /proj/foundation/home/proctor/rtapi/rtlib/fifotask.o: /proj/foundation/home/proctor/rtapi/include/rtapi_app.h ! /proj/foundation/home/proctor/rtapi/rtlib/fifotask.o: common.h ! /proj/foundation/home/proctor/rtapi/rtlib/fifousr.o: /proj/foundation/home/proctor/rtapi/include/ulapi.h ! /proj/foundation/home/proctor/rtapi/rtlib/fifousr.o: common.h --- 50,56 ---- # DO NOT DELETE ! /home/John/emcdev/rtapi/lib/fifotask.o: common.h ! /home/John/emcdev/rtapi/lib/fifousr.o: common.h ! /home/John/emcdev/rtapi/rtlib/fifotask.o: common.h ! /home/John/emcdev/rtapi/rtlib/fifousr.o: common.h |
|
From: <jmk...@us...> - 2003-07-19 02:17:44
|
Update of /cvsroot/emc/rtapi/examples/shmem In directory sc8-pr-cvs1:/tmp/cvs-serv9258/examples/shmem Modified Files: Makefile Log Message: revised the API definition and made coresponding changes to rtai_rtapi.c Index: Makefile =================================================================== RCS file: /cvsroot/emc/rtapi/examples/shmem/Makefile,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** Makefile 8 Jul 2003 15:54:39 -0000 1.1.1.1 --- Makefile 19 Jul 2003 02:17:41 -0000 1.2 *************** *** 50,62 **** # DO NOT DELETE ! /proj/foundation/home/proctor/rtapi/lib/shmemtask.o: /proj/foundation/home/proctor/rtapi/include/rtapi.h ! /proj/foundation/home/proctor/rtapi/lib/shmemtask.o: /proj/foundation/home/proctor/rtapi/include/rtapi_app.h ! /proj/foundation/home/proctor/rtapi/lib/shmemtask.o: common.h ! /proj/foundation/home/proctor/rtapi/lib/shmemusr.o: /proj/foundation/home/proctor/rtapi/include/ulapi.h ! /proj/foundation/home/proctor/rtapi/lib/shmemusr.o: common.h ! /proj/foundation/home/proctor/rtapi/rtlib/shmemtask.o: /proj/foundation/home/proctor/rtapi/include/rtapi.h ! /proj/foundation/home/proctor/rtapi/rtlib/shmemtask.o: /proj/foundation/home/proctor/rtapi/include/rtapi_app.h ! /proj/foundation/home/proctor/rtapi/rtlib/shmemtask.o: common.h ! /proj/foundation/home/proctor/rtapi/rtlib/shmemusr.o: /proj/foundation/home/proctor/rtapi/include/ulapi.h ! /proj/foundation/home/proctor/rtapi/rtlib/shmemusr.o: common.h --- 50,56 ---- # DO NOT DELETE ! /home/John/emcdev/rtapi/lib/shmemtask.o: common.h ! /home/John/emcdev/rtapi/lib/shmemusr.o: common.h ! /home/John/emcdev/rtapi/rtlib/shmemtask.o: common.h ! /home/John/emcdev/rtapi/rtlib/shmemusr.o: common.h |
|
From: <jmk...@us...> - 2003-07-19 02:17:44
|
Update of /cvsroot/emc/rtapi/examples/semaphore In directory sc8-pr-cvs1:/tmp/cvs-serv9258/examples/semaphore Modified Files: Makefile Log Message: revised the API definition and made coresponding changes to rtai_rtapi.c Index: Makefile =================================================================== RCS file: /cvsroot/emc/rtapi/examples/semaphore/Makefile,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** Makefile 8 Jul 2003 15:54:39 -0000 1.1.1.1 --- Makefile 19 Jul 2003 02:17:41 -0000 1.2 *************** *** 43,50 **** # DO NOT DELETE ! /proj/foundation/home/proctor/rtapi/rtlib/master.o: /proj/foundation/home/proctor/rtapi/include/rtapi.h ! /proj/foundation/home/proctor/rtapi/rtlib/master.o: /proj/foundation/home/proctor/rtapi/include/rtapi_app.h ! /proj/foundation/home/proctor/rtapi/rtlib/master.o: common.h ! /proj/foundation/home/proctor/rtapi/rtlib/slave.o: /proj/foundation/home/proctor/rtapi/include/rtapi.h ! /proj/foundation/home/proctor/rtapi/rtlib/slave.o: /proj/foundation/home/proctor/rtapi/include/rtapi_app.h ! /proj/foundation/home/proctor/rtapi/rtlib/slave.o: common.h --- 43,46 ---- # DO NOT DELETE ! /home/John/emcdev/rtapi/rtlib/master.o: common.h ! /home/John/emcdev/rtapi/rtlib/slave.o: common.h |
|
From: <jmk...@us...> - 2003-07-19 02:17:43
|
Update of /cvsroot/emc/rtapi/examples/extint In directory sc8-pr-cvs1:/tmp/cvs-serv9258/examples/extint Modified Files: Makefile Log Message: revised the API definition and made coresponding changes to rtai_rtapi.c Index: Makefile =================================================================== RCS file: /cvsroot/emc/rtapi/examples/extint/Makefile,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** Makefile 8 Jul 2003 15:54:39 -0000 1.1.1.1 --- Makefile 19 Jul 2003 02:17:41 -0000 1.2 *************** *** 32,36 **** # DO NOT DELETE - - /proj/foundation/home/proctor/rtapi/rtlib/extint.o: /proj/foundation/home/proctor/rtapi/include/rtapi.h - /proj/foundation/home/proctor/rtapi/rtlib/extint.o: /proj/foundation/home/proctor/rtapi/include/rtapi_app.h --- 32,33 ---- |
|
From: <jmk...@us...> - 2003-07-19 02:17:43
|
Update of /cvsroot/emc/rtapi In directory sc8-pr-cvs1:/tmp/cvs-serv9258 Modified Files: Makefile.inc Log Message: revised the API definition and made coresponding changes to rtai_rtapi.c Index: Makefile.inc =================================================================== RCS file: /cvsroot/emc/rtapi/Makefile.inc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Makefile.inc 19 Jul 2003 01:32:47 -0000 1.2 --- Makefile.inc 19 Jul 2003 02:17:41 -0000 1.3 *************** *** 3,7 **** # Makefile add-ons from ./configure ! RTAPI_HOME = /home/John/tempcvs/rtapi BIN_DIR = $(RTAPI_HOME)/bin LIB_DIR = $(RTAPI_HOME)/lib --- 3,7 ---- # Makefile add-ons from ./configure ! RTAPI_HOME = /home/John/emcdev/rtapi BIN_DIR = $(RTAPI_HOME)/bin LIB_DIR = $(RTAPI_HOME)/lib |
|
From: <jmk...@us...> - 2003-07-19 01:32:50
|
Update of /cvsroot/emc/rtapi/src/rtapi In directory sc8-pr-cvs1:/tmp/cvs-serv4485/src/rtapi Modified Files: localdefs.h Log Message: changed 'ksyms' to '/sbin/ksyms' in configure script Index: localdefs.h =================================================================== RCS file: /cvsroot/emc/rtapi/src/rtapi/localdefs.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** localdefs.h 8 Jul 2003 15:54:38 -0000 1.1.1.1 --- localdefs.h 19 Jul 2003 01:32:47 -0000 1.2 *************** *** 2,8 **** #define LOCALDEFS_H ! /* automatically generated by config script on Mon Jun 30 13:57:12 EDT 2003 */ ! #define LOCAL_MHZ 448.880559 #endif --- 2,8 ---- #define LOCALDEFS_H ! /* automatically generated by config script on Fri Jul 18 21:25:01 EDT 2003 */ ! #define LOCAL_MHZ 233.866 #endif |
|
From: <jmk...@us...> - 2003-07-19 01:32:50
|
Update of /cvsroot/emc/rtapi
In directory sc8-pr-cvs1:/tmp/cvs-serv4485
Modified Files:
Makefile.inc configure
Log Message:
changed 'ksyms' to '/sbin/ksyms' in configure script
Index: Makefile.inc
===================================================================
RCS file: /cvsroot/emc/rtapi/Makefile.inc,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** Makefile.inc 8 Jul 2003 15:54:38 -0000 1.1.1.1
--- Makefile.inc 19 Jul 2003 01:32:47 -0000 1.2
***************
*** 3,24 ****
# Makefile add-ons from ./configure
! RTAPI_HOME = /proj/foundation/home/proctor/rtapi
BIN_DIR = $(RTAPI_HOME)/bin
LIB_DIR = $(RTAPI_HOME)/lib
RTLIB_DIR = $(RTAPI_HOME)/rtlib
INC_DIR = $(RTAPI_HOME)/include
! MOD_DIR = /lib/modules/2.2.14-rtl2.2/misc
CC = gcc
CFLAGS = -g -I$(INC_DIR)
CLINK =
! RTDIR = /usr/src/rtlinux-2.2
! RTNAME = rtlinux-2.2
! RTL = 1
! # Makefile add-ons from rtlinux-2.2.mk
! RTFLAGS = -I$(INC_DIR) -I$(RTDIR)/include -I$(RTDIR)/linux/include -I$(RTDIR)/include/posix -I$(RTDIR)/include/compat -O2 -ffast-math -D__RTL__ -D__KERNEL__ -DMODULE
ULFLAGS = -g -I$(INC_DIR) -I$(RTDIR)/include
RTLINK = ld -r -static
! RTAPI = $(RTLIB_DIR)/rtl_rtapi.o
! ULAPI = $(LIB_DIR)/rtl_ulapi.o
--- 3,26 ----
# Makefile add-ons from ./configure
! RTAPI_HOME = /home/John/tempcvs/rtapi
BIN_DIR = $(RTAPI_HOME)/bin
LIB_DIR = $(RTAPI_HOME)/lib
RTLIB_DIR = $(RTAPI_HOME)/rtlib
INC_DIR = $(RTAPI_HOME)/include
! MOD_DIR = /lib/modules/2.4.18-rtai/misc
CC = gcc
CFLAGS = -g -I$(INC_DIR)
CLINK =
! RTDIR = /usr/src/rtai-24.1.10
! RTNAME = rtai-24.1.10
! RTAI = 1
! # Makefile add-ons from rtai.mk
! RTFLAGS = -I$(INC_DIR) -I$(RTDIR)/include -O2 -ffast-math -D__KERNEL__ -DMODULE
ULFLAGS = -g -I$(INC_DIR) -I$(RTDIR)/include
RTLINK = ld -r -static
! RTAPI = $(RTLIB_DIR)/rtai_rtapi.o
! ULAPI = $(LIB_DIR)/rtai_ulapi.o
! # Use alternate compiler, RTAI doesn't like gcc 2.96
! CC = egcs
Index: configure
===================================================================
RCS file: /cvsroot/emc/rtapi/configure,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** configure 8 Jul 2003 15:54:38 -0000 1.1.1.1
--- configure 19 Jul 2003 01:32:47 -0000 1.2
***************
*** 78,84 ****
# rtl_request_global_irq, other rtl_ functions for 2.2 kernels
# __start_rtlinux_funcs, __stop_rtlinux_funcs for 2.4 kernels
! RTLBOOT=$(ksyms -a | grep _rtlinux_ | wc -l)
if [ $RTLBOOT -eq 0 ] ; then
! RTLBOOT=$(ksyms -a | grep rtl_ | wc -l)
fi
if [ $RTLBOOT -gt 0 ] ; then
--- 78,84 ----
# rtl_request_global_irq, other rtl_ functions for 2.2 kernels
# __start_rtlinux_funcs, __stop_rtlinux_funcs for 2.4 kernels
! RTLBOOT=$(/sbin/ksyms -a | grep _rtlinux_ | wc -l)
if [ $RTLBOOT -eq 0 ] ; then
! RTLBOOT=$(/sbin/ksyms -a | grep rtl_ | wc -l)
fi
if [ $RTLBOOT -gt 0 ] ; then
***************
*** 88,92 ****
# ditto for an RTAI boot by looking through the kernel for telltale symbols:
# set_rtai_callback, remove_rtai_callback for 2.2, 2.4 kernels
! RTAIBOOT=$(ksyms -a | grep _rtai_ | wc -l)
if [ $RTAIBOOT -gt 0 ] ; then
echo found RTAI installed in the kernel
--- 88,92 ----
# ditto for an RTAI boot by looking through the kernel for telltale symbols:
# set_rtai_callback, remove_rtai_callback for 2.2, 2.4 kernels
! RTAIBOOT=$(/sbin/ksyms -a | grep _rtai_ | wc -l)
if [ $RTAIBOOT -gt 0 ] ; then
echo found RTAI installed in the kernel
|
|
From: <ray...@us...> - 2003-07-19 01:29:14
|
Update of /cvsroot/emc/documents/lyx
In directory sc8-pr-cvs1:/tmp/cvs-serv4134
Modified Files:
faq.lyx
Log Message:
minor fixes
Index: faq.lyx
===================================================================
RCS file: /cvsroot/emc/documents/lyx/faq.lyx,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** faq.lyx 5 Jul 2003 01:21:07 -0000 1.1
--- faq.lyx 19 Jul 2003 01:29:10 -0000 1.2
***************
*** 29,34 ****
EMC FAQ is common effort of many individuals around the globe.
! Most of the FAQ has been collected from various postings at EMC-mailinglist,
!
\begin_inset LatexCommand \url[em...@ni...]{mailto:em...@ni...}
--- 29,34 ----
EMC FAQ is common effort of many individuals around the globe.
! Most of the FAQ has been collected from various postings at EMC-mailing
! list,
\begin_inset LatexCommand \url[em...@ni...]{mailto:em...@ni...}
***************
*** 82,86 ****
\end_inset
! sourcecode
\begin_inset Quotes erd
\end_inset
--- 82,86 ----
\end_inset
! source code
\begin_inset Quotes erd
\end_inset
***************
*** 99,103 ****
\end_inset
! realtime-modifications
\begin_inset Quotes erd
\end_inset
--- 99,103 ----
\end_inset
! real-time-modifications
\begin_inset Quotes erd
\end_inset
***************
*** 142,150 ****
\layout Standard
! INPUT_SCALE = STEPS_NEEDED_TO_GO_ONE_REVOLUTION / LENGHT_OF_TRAVEL_IN_ONE_REVOL
UTION.
\layout Standard
! So, for example if you have setup where millinghead travels 1.5mm per one
whole revolution, and your steppers require 400 pulses to go one revolution:
\layout Standard
--- 142,150 ----
\layout Standard
! INPUT_SCALE = STEPS_NEEDED_TO_GO_ONE_REVOLUTION / LENGTH_OF_TRAVEL_IN_ONE_REVOL
UTION.
\layout Standard
! So, for example if you have setup where milling head travels 1.5mm per one
whole revolution, and your steppers require 400 pulses to go one revolution:
\layout Standard
***************
*** 333,337 ****
An alternative to the mechanical microswitch is the optical 'vane in a
slot' type of switch which is found in many types of equipment.
! In this, a small plastic 'U'-shaped moulding has an infra-red LED in one
leg facing a photocell in the other.
Passing a small opaque vane between the legs of the sensor interrupts the
--- 333,337 ----
An alternative to the mechanical microswitch is the optical 'vane in a
slot' type of switch which is found in many types of equipment.
! In this, a small plastic 'U'-shaped molding has an infra-red LED in one
leg facing a photocell in the other.
Passing a small opaque vane between the legs of the sensor interrupts the
***************
*** 362,366 ****
In a recent post, Jan raised the issue of security concerning the EMC software
on a shop floor machine.\SpecialChar ~
! IMO this issue is common to all pc based systems
but since parts of the EMC must run as root, and now all of it runs as
root in a standard setup, the system is extra vulnerable.
--- 362,366 ----
In a recent post, Jan raised the issue of security concerning the EMC software
on a shop floor machine.\SpecialChar ~
! IMO this issue is common to all PC based systems
but since parts of the EMC must run as root, and now all of it runs as
root in a standard setup, the system is extra vulnerable.
***************
*** 549,553 ****
It must be something to do with the name - I had two 'Rays' work for me
! and I couldn't trust either if them not to fiddle with anything theycould
get their hands on! One was a positive Jonah but, fortunately, retirement
has left the problem of controlling him to my successor!
--- 549,553 ----
It must be something to do with the name - I had two 'Rays' work for me
! and I couldn't trust either if them not to fiddle with anything they could
get their hands on! One was a positive Jonah but, fortunately, retirement
has left the problem of controlling him to my successor!
***************
*** 579,583 ****
\layout Standard
! Now, if you only have ouside network access on your other machines by dialup,
and don't have a gateway on that machine, the Linux machine is pretty safe
without much change.
--- 579,583 ----
\layout Standard
! Now, if you only have outside network access on your other machines by dialup,
and don't have a gateway on that machine, the Linux machine is pretty safe
without much change.
***************
*** 660,664 ****
Unfortunately there are a lot of reasons for not being able to come out
of estop.
! Ussually I start to look for the reason by running
\layout Standard
--- 660,664 ----
Unfortunately there are a lot of reasons for not being able to come out
of estop.
! Usually I start to look for the reason by running
\layout Standard
***************
*** 704,708 ****
\layout Standard
! AMD K6-2 at 300Mhz
\layout Standard
--- 704,708 ----
\layout Standard
! AMD K6-2 at 300MHz
\layout Standard
***************
*** 710,714 ****
\layout Standard
! Only one (buildin) par.
port
\layout Standard
--- 710,714 ----
\layout Standard
! Only one (built in) par.
port
\layout Standard
***************
*** 750,754 ****
Some patches: ac patches and a patch for my ali 15xx IDE driver to do UDMA33.
! Everythings compiles and runs fine.
The simulation runs just great.
Encoder feedback is working for all 3 axis.
--- 750,754 ----
Some patches: ac patches and a patch for my ali 15xx IDE driver to do UDMA33.
! Everything compiles and runs fine.
The simulation runs just great.
Encoder feedback is working for all 3 axis.
***************
*** 870,874 ****
had to redo it from scratch).
! In doing this I rediscovered jjust how
\layout Standard
--- 870,874 ----
had to redo it from scratch).
! In doing this I rediscovered just how
\layout Standard
|
|
From: <ray...@us...> - 2003-07-19 01:27:27
|
Update of /cvsroot/emc/documents/lyx In directory sc8-pr-cvs1:/tmp/cvs-serv4091 Modified Files: README.lyx Log Message: minor fixes Index: README.lyx =================================================================== RCS file: /cvsroot/emc/documents/lyx/README.lyx,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** README.lyx 5 Jul 2003 01:38:37 -0000 1.1 --- README.lyx 19 Jul 2003 01:27:24 -0000 1.2 *************** *** 1,5 **** #LyX 1.1 created this file. For more info see http://www.lyx.org/ \lyxformat 218 ! \textclass article \language english \inputencoding default --- 1,5 ---- #LyX 1.1 created this file. For more info see http://www.lyx.org/ \lyxformat 218 ! \textclass book \language english \inputencoding default *************** *** 14,19 **** \use_amsmath 0 \paperorientation portrait ! \secnumdepth 3 ! \tocdepth 3 \paragraph_separation skip \defskip smallskip --- 14,19 ---- \use_amsmath 0 \paperorientation portrait ! \secnumdepth 2 ! \tocdepth 2 \paragraph_separation skip \defskip smallskip *************** *** 21,28 **** \quotes_times 2 \papercolumns 1 ! \papersides 1 \paperpagestyle default ! \layout Title README --- 21,28 ---- \quotes_times 2 \papercolumns 1 ! \papersides 2 \paperpagestyle default ! \layout Chapter README |
|
From: <ray...@us...> - 2003-07-19 01:26:48
|
Update of /cvsroot/emc/documents/lyx In directory sc8-pr-cvs1:/tmp/cvs-serv4001 Modified Files: Master_Developer.lyx Log Message: minor fixes Index: Master_Developer.lyx =================================================================== RCS file: /cvsroot/emc/documents/lyx/Master_Developer.lyx,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Master_Developer.lyx 16 Jul 2003 19:53:08 -0000 1.2 --- Master_Developer.lyx 19 Jul 2003 01:26:45 -0000 1.3 *************** *** 68,73 **** Copyright (c) 2000 - 03 LinuxCNC.org \layout Standard ! \added_space_top 1in \line_top \line_bottom \pextra_type 1 \pextra_widthp 10 ! Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later --- 68,72 ---- Copyright (c) 2000 - 03 LinuxCNC.org \layout Standard ! \added_space_top 1in \line_top \line_bottom Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later *************** *** 156,160 **** \start_of_appendix ! \begin_inset Include \input{GPLD_Copyright.lyx} \end_inset --- 155,167 ---- \start_of_appendix ! \begin_inset Include \include{README.lyx} ! ! \end_inset ! ! ! \layout Standard ! ! ! \begin_inset Include \include{GPLD_Copyright.lyx} \end_inset |
|
From: <ray...@us...> - 2003-07-18 18:54:16
|
Update of /cvsroot/emc/documents/lyx
In directory sc8-pr-cvs1:/tmp/cvs-serv31392
Modified Files:
User_Gcode_Basics.lyx User_Gcode_Coordinates.lyx
User_Linux.lyx User_Whatis_EMC.lyx
Log Message:
various updates
Index: User_Gcode_Basics.lyx
===================================================================
RCS file: /cvsroot/emc/documents/lyx/User_Gcode_Basics.lyx,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** User_Gcode_Basics.lyx 5 Jul 2003 01:44:29 -0000 1.1
--- User_Gcode_Basics.lyx 18 Jul 2003 18:46:07 -0000 1.2
***************
*** 27,30 ****
--- 27,53 ----
G Code Basics
+ \layout Section
+
+ Introduction
+ \layout Standard
+
+ RS274 is commonly referred to as G-code.
+ G-code was developed so that people who were accustomed to turning the
+ handles of machine tools to make cuts could tell a motor to do the turning
+ for them.
+ If you've ever tried to cut a diagonal or an arc on a manual machine you
+ will appreciate the coordination that G-code can give you.
+ \layout Standard
+
+ Stories have it that before G-code, coordinated motion was either done by
+ gearing the two axes together like you might do with a lathe for smooth
+ turning or facing or it was done by having a person shout out the next
+ position to two or more operators who would then turn the handles.
+ This sounds a bit like the crew chief shouting stroke, stroke, stroke for
+ the crew of a rowboat.
+ Early milling of some propellers was done this way.
+ \layout Subsection
+
+ RS274D
\layout Standard
***************
*** 46,49 ****
--- 69,75 ----
cnc control tasks.
+ \layout Subsubsection
+
+ RS274NGC
\layout Standard
***************
*** 174,178 ****
within a block of nc program just yet.
These will become clear as you work your way through the definitions of
! the permissible words listed in the next unit.
\layout Standard
--- 200,204 ----
within a block of nc program just yet.
These will become clear as you work your way through the definitions of
! the permissible words listed.
\layout Standard
***************
*** 237,241 ****
In this chapter all examples will use explicit numbers.
Expressions and unary operations are treated in the computation chapter.
! The use of parameter values or variables are a described in detail in the
Using Variables chapter.
--- 263,267 ----
In this chapter all examples will use explicit numbers.
Expressions and unary operations are treated in the computation chapter.
! The use of parameter values or variables are described in detail in the
Using Variables chapter.
***************
*** 305,309 ****
the chapter on canned cycles.
\layout Standard
!
\begin_inset Tabular
--- 331,335 ----
the chapter on canned cycles.
\layout Standard
! \align center
\begin_inset Tabular
***************
*** 753,757 ****
\layout Standard
!
Table 2 Words acceptable to the EMC interpreter
\layout Section
--- 779,783 ----
\layout Standard
! \align center
Table 2 Words acceptable to the EMC interpreter
\layout Section
***************
*** 813,817 ****
X, Y, and Z words will be accepted, as will A, B, and C.
\layout Standard
!
\begin_inset Tabular
--- 839,843 ----
X, Y, and Z words will be accepted, as will A, B, and C.
\layout Standard
! \align center
\begin_inset Tabular
***************
*** 988,992 ****
\layout Standard
!
Table 3 Definition of Common Axes
\layout Section
--- 1014,1018 ----
\layout Standard
! \align center
Table 3 Definition of Common Axes
\layout Section
***************
*** 1008,1012 ****
Table 4 lists the currently available g words.
\layout Standard
!
\begin_inset Tabular
--- 1034,1038 ----
Table 4 lists the currently available g words.
\layout Standard
! \align center
\begin_inset Tabular
***************
*** 1811,1815 ****
\layout Standard
!
Table 4 G Code List
\layout Standard
--- 1837,1841 ----
\layout Standard
! \align center
Table 4 G Code List
\layout Standard
***************
*** 1989,1995 ****
by the P number.
It is an error if the P number is negative.
! \layout Comment
! G10 Description here..
\layout Subsection*
--- 2015,2048 ----
by the P number.
It is an error if the P number is negative.
! \layout Standard
!
! \begin_inset LatexCommand \index{G10}
!
! \end_inset
!
! To set the coordinate values for the origin of a coordinate system, program
! G10 L2 P - X- Y- Z- A- B- C-, where the P number must evaluate to an integer
! in the range 1 to 9 (corresponding to G54 to G59.3) and all axis words are
! optional.
! The coordinates of the origin of the coordinate system specified by the
! P number are reset to the coordinate values given (in terms of the absolute
! coordinate system).
! Only those coordinates for which an axis word is included on the line will
! be reset.
!
! \layout Standard
!
! The coordinate system whose origin is set by a G10 command may be active
! or inactive at the time the G10 is executed.
!
! \layout Standard
!
! Example: G10 L2 P1 x 3.5 y 17.2 sets the origin of the first coordinate system
! (the one selected by G54) to a point where X is 3.5 and Y is 17.2 (in absolute
! coordinates).
! The Z coordinate of the origin (and the coordinates for any rotational
! axes) are whatever those coordinates of the origin were before the line
! was executed.
\layout Subsection*
***************
*** 2040,2200 ****
\layout Subsection*
- Fixture Offsets (G54-G59.3)
- \layout Standard
! Fixture offset are used to make a part home that is different from the absolute,
! machine coordinate system.
! This allows the part programmer to set up home positions for multiple parts.
! A typical operation that uses fixture offsets would be to mill multiple
! copies of parts on "islands" in a piece, similar to the figure below: [gcode/im
! ages/offset.jpg]
! \layout Standard
!
!
! \begin_inset Figure size 360 161
! file /usr/share/lyx/EMC_images/offsets.eps
! width 2 5
! flags 9
\end_inset
! \layout Standard
!
! To use fixture offsets, the values of the desired home positions must be
! stored in the control, prior to running a program that uses them.
! Once there are values assigned, a call to G54, for instance, would add
! 2 to all X values in a program.
! A call to G58 would add 2 to X values and -2 to Y values in this example.
! \layout Standard
!
!
! \begin_inset LatexCommand \index{G53}
\end_inset
! G53 is used to cancel out fixture offsets.
! So, calling G53 and then G0 X0 Y0 would send the machine back to the actual
! coordinates of X=0, Y=0.
\layout Standard
- \pextra_type 2 \pextra_alignment 0 \pextra_widthp 100
! G53\SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! motion in machine coordinate system
\layout Standard
- \pextra_type 2 \pextra_alignment 0 \pextra_widthp 100
! \begin_inset LatexCommand \index{G54}
!
! \end_inset
!
! G54\SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! use preset work coordinate system 1
\layout Standard
- \pextra_type 2 \pextra_alignment 0 \pextra_widthp 100
-
! \begin_inset LatexCommand \index{G55}
!
! \end_inset
! G55\SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! use preset work coordinate system 2
\layout Standard
- \pextra_type 2 \pextra_alignment 0 \pextra_widthp 100
-
-
- \begin_inset LatexCommand \index{G56}
-
- \end_inset
! G56\SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! use preset work coordinate system 3
! \layout Standard
! \pextra_type 2 \pextra_alignment 0 \pextra_widthp 100
! \begin_inset LatexCommand \index{G57}
\end_inset
- G57\SpecialChar ~
- \SpecialChar ~
- \SpecialChar ~
- \SpecialChar ~
- \SpecialChar ~
- use preset work coordinate system 4
- \layout Standard
- \pextra_type 2 \pextra_alignment 0 \pextra_widthp 100
-
! \begin_inset LatexCommand \index{G58}
\end_inset
- G58\SpecialChar ~
- \SpecialChar ~
- \SpecialChar ~
- \SpecialChar ~
- \SpecialChar ~
- use preset work coordinate system 5
- \layout Standard
- \pextra_type 2 \pextra_alignment 0 \pextra_widthp 100
-
! \begin_inset LatexCommand \index{G59}
\end_inset
! G59\SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! use preset work coordinate system 6
\layout Standard
- \pextra_type 2 \pextra_alignment 0 \pextra_widthp 100
! G59.1\SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! use preset work coordinate system 7
! \layout Standard
! \pextra_type 2 \pextra_alignment 0 \pextra_widthp 100
! G59.2\SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! use preset work coordinate system 8
\layout Standard
- \pextra_type 2 \pextra_alignment 0 \pextra_widthp 100
! G59.3\SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! use preset work coordinate system 9
\layout Subsection*
Canned Cycles/Drill Subroutines (G80-G89)
! \layout Comment
! Look here for a complete reference.
\layout Subsection*
--- 2093,2192 ----
\layout Subsection*
! \begin_inset LatexCommand \index{G28}
\end_inset
! \begin_inset LatexCommand \index{G30}
\end_inset
! Return to Home - G28 and G30
\layout Standard
! Two home positions are defined (by parameters 5161-5166 for G28 and parameters
! 5181-5186 for G30).
! The parameter values are in terms of the absolute coordinate system, but
! are in unspecified length units.
!
\layout Standard
+ To return to home position by way of the programmed position, program G28
+ X- Y- Z- A- B- C- (or use G30).
+ All axis words are optional.
+ The path is made by a traverse move from the current position to the programmed
+ position, followed by a traverse move to the home position.
+ If no axis words are programmed, the intermediate point is the current
+ point, so only one move is made.
+ \layout Subsection*
! Tool Length Compensation - G43 and G49
\layout Standard
! Are covered in detail in the chapter on tool compensation.
! \layout Subsection*
! Cutter Radius Compensation - G40, G41, and G42
\layout Standard
! These are also covered in detail in the chapter on tool compensation.
! \layout Subsection*
! \begin_inset LatexCommand \index{G61}
\end_inset
! \begin_inset LatexCommand \index{G61.1}
\end_inset
! \begin_inset LatexCommand \index{G64}
\end_inset
! Set Path Control Mode - G61, G61.1, and G64
\layout Standard
! Program G61 to put the machining center into exact path mode, G61.1 for exact
! stop mode, or G64 for continuous mode.
! It is OK to program for the mode that is already active.
!
! \layout Quotation
! The machining center may be put into any one of three path control modes:
! (1) exact stop mode, (2) exact path mode, or (3) continuous mode.
! In exact stop mode, the machine stops briefly at the end of each programmed
! move.
! In exact path mode, the machine follows the programmed path as exactly
! as possible, slowing or stopping if necessary at sharp corners of the path.
! In continuous mode, sharp corners of the path may be rounded slightly so
! that the feed rate may be kept up.
! See Section 3.5.14 and Section 4.3.5.3
! \layout Quotation
!
! The canonical machining functions share with the RS274 language the simplifying
! assumption that machine dynamics can be almost ignored.
! That is, in this model, acceleration and deceleration do not occur.
! Components of the machining center can be told to move at a specific rate,
! and that rate is imagined as being achieved instantaneously.
! Stopping is also imagined as instantaneous.
! This model obviously does not correspond with reality.
! The control modes provided here provide some compensation for this lack
! of consideration of dynamics.
! \begin_float footnote
\layout Standard
! From Section 2.1.2.16 of RS@&$NGC document from NIST.
! \end_float
\layout Subsection*
Canned Cycles/Drill Subroutines (G80-G89)
! \layout Standard
! These are treated in detail in the chapter on canned cycles.
\layout Subsection*
Index: User_Gcode_Coordinates.lyx
===================================================================
RCS file: /cvsroot/emc/documents/lyx/User_Gcode_Coordinates.lyx,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** User_Gcode_Coordinates.lyx 5 Jul 2003 01:44:29 -0000 1.1
--- User_Gcode_Coordinates.lyx 18 Jul 2003 18:46:07 -0000 1.2
***************
*** 6,10 ****
\fontscheme bookman
\graphics default
! \float_placement h
\paperfontsize 10
\spacing single
--- 6,10 ----
\fontscheme bookman
\graphics default
! \float_placement !!h
\paperfontsize 10
\spacing single
***************
*** 26,32 ****
\layout Chapter
! G92 Offsets and Coordinate Systems
\layout Standard
! (here we describe these in detail)
\the_end
--- 26,860 ----
\layout Chapter
! Coordinate System and G92 Offsets
! \layout Section
!
! Introduction
\layout Standard
! You have seen how handy a tool length offset can be.
! Having this allows the programmer to ignore the actual tool length when
! writing a part program.
! In the same way, it is really nice to be able to find a prominent part
! of a casting or block of material and work a program from that point rather
! than having to take account of the location at which the casting or block
! will be held during the machining.
! \layout Standard
!
! This chapter introduces you to offsets as they are used by the EMC.
! These include;
! \layout Itemize
!
! machine coordinates (G53)
! \layout Itemize
!
! nine offsets (G54-G59.3)
! \layout Itemize
!
! a set of global offsets (G92).
! \layout Section
!
! The Machine Position Command (G53)
! \layout Standard
!
! Regardless of any offsets that may be in effect, putting a G53
! \begin_inset LatexCommand \index{G53}
!
! \end_inset
!
! in a block of code tells the interpreter to go to the real or absolute
! axis positions commanded in the block.
! For example
! \layout Standard
!
! g53 g0 x0 y0 z0
! \layout Standard
!
! will get you to the actual position where these three axes are zero.
! You might use a command like this if you have a favorite position for tool
! changes or if your machine has an auto tool changer.
! You might also use this command to get the tool out of the way so that
! you can rotate or change a part in a vice.
!
! \layout Standard
!
! G53 is not a modal command.
! It must be used on each line where motion based upon absolute machine position
! is desired.
!
! \layout Section
!
! Fixture Offsets (G54-G59.3)
! \layout Standard
!
! \begin_float fig
! \layout Standard
! \align center
!
! \begin_inset Figure size 476 213
! file ../images/offsets.eps
! width 3 80
! flags 9
!
! \end_inset
!
!
! \layout Caption
!
!
! \begin_inset LatexCommand \label{fig:offsets}
!
! \end_inset
!
! Work Offsets
! \end_float
! \layout Standard
!
! Work or fixture offset are used to make a part home that is different from
! the absolute, machine coordinate system.
! This allows the part programmer to set up home positions for multiple parts.
! A typical operation that uses fixture offsets would be to mill multiple
! copies of parts on "islands" in a piece, similar to figure
! \begin_inset LatexCommand \ref{fig:offsets}
!
! \end_inset
!
!
! \layout Standard
!
! The values for offsets are stored in the VAR file that is requested by the
! INI file during the startup of an EMC.
! In our example below we'll use
! \begin_inset LatexCommand \index{G55}
!
! \end_inset
!
! G55.
! The values for each axis for G55 are stored as variable numbers.
!
! \layout Standard
! \pextra_type 1 \pextra_widthp 5
!
! 5241\SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! 0.000000
! \layout Standard
! \pextra_type 1 \pextra_widthp 5
!
! 5242\SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! 0.000000
! \layout Standard
! \pextra_type 1 \pextra_widthp 5
!
! 5243\SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! 0.000000
! \layout Standard
! \pextra_type 1 \pextra_widthp 5
!
! 5244\SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! 0.000000
! \layout Standard
! \pextra_type 1 \pextra_widthp 5
!
! 5245\SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! 0.000000
! \layout Standard
! \pextra_type 1 \pextra_widthp 5
!
! 5246\SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! 0.000000
! \layout Standard
!
! In the VAR file scheme, the first variable number stores the X offset, the
! second the Y offset and so on for all six axes.
! There are numbered sets like this for each of the fixture offsets.
!
! \layout Standard
!
! Each of the graphical interfaces has a way to set values for these offsets.
! You can also set these values by editing the VAR file itself and then issuing
! a [reset] so that the EMC reads the new values.
! For our example let's directly edit the file so that G55 takes on the following
! values.
! \layout Standard
! \pextra_type 1 \pextra_widthp 5
!
! 5241\SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! 2.000000
! \layout Standard
! \pextra_type 1 \pextra_widthp 5
!
! 5242\SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! 1.000000
! \layout Standard
! \pextra_type 1 \pextra_widthp 5
!
! 5243\SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! -2.000000
! \layout Standard
! \pextra_type 1 \pextra_widthp 5
!
! 5244\SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! 0.000000
! \layout Standard
! \pextra_type 1 \pextra_widthp 5
!
! 5245\SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! 0.000000
! \layout Standard
! \pextra_type 1 \pextra_widthp 5
!
! 5246\SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! 0.000000
! \layout Standard
!
! You should read this as moving the zero positions of G55 to X = 2 units,
! Y= 1 unit, and Z = -2 units away from the absolute zero position.
! \layout Standard
!
! Once there are values assigned, a call to G55 in a program block would shift
! the zero reference by the values stored.
! The following line would then move each axis to the new zero position.
! Unlike G53, G54 through G59.3 are modal commands.
! They will act on all blocks of code after one of them has been set.
! The program that might be run using figure
! \begin_inset LatexCommand \ref{fig:offsets}
!
! \end_inset
!
! would require only a single coordinate reference for each of the locations
! and all of the work to be done there.
! The following code is offered as an example of making a square using the
! G55 offsets that we set above.
! \layout Standard
! \pextra_type 1 \pextra_widthp 5
!
! G55 G0 x0 y0 z0
! \layout Standard
! \pextra_type 1 \pextra_widthp 5
!
! g1 f2 z-0.2000
! \layout Standard
! \pextra_type 1 \pextra_widthp 5
!
! x1
! \layout Standard
! \pextra_type 1 \pextra_widthp 5
!
! y1
! \layout Standard
! \pextra_type 1 \pextra_widthp 5
!
! x0
! \layout Standard
! \pextra_type 1 \pextra_widthp 5
!
! y0
! \layout Standard
! \pextra_type 1 \pextra_widthp 5
!
! g0 z0
! \layout Standard
! \pextra_type 1 \pextra_widthp 5
!
! g54 x0 y0 z0
! \layout Standard
! \pextra_type 1 \pextra_widthp 5
!
! m2
! \layout Standard
!
!
! \begin_inset Quotes eld
! \end_inset
!
! But,
! \begin_inset Quotes erd
! \end_inset
!
! you say,
! \begin_inset Quotes eld
! \end_inset
!
! why is there a G54 in there near the end.
! \begin_inset Quotes erd
! \end_inset
!
! Many programmers leave the G54 coordinate system with all zero values so
! that there is a modal code for the absolute machine based axis positions.
! This program assumes that we have done that and use the ending command
! as a command to machine zero.
! It would have been possible to use g53 and arrive at the same place but
! that command would not have been modal and any commands issued after it
! would have returned to using the G55 offsets because that coordinate system
! would still be in effect.
! \layout Standard
! \pextra_type 2 \pextra_alignment 0 \pextra_widthp 100
!
!
! \begin_inset LatexCommand \index{G54}
!
! \end_inset
!
! G54\SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! use preset work coordinate system 1
! \layout Standard
! \pextra_type 2 \pextra_alignment 0 \pextra_widthp 100
!
!
! \begin_inset LatexCommand \index{G55}
!
! \end_inset
!
! G55\SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! use preset work coordinate system 2
! \layout Standard
! \pextra_type 2 \pextra_alignment 0 \pextra_widthp 100
!
!
! \begin_inset LatexCommand \index{G56}
!
! \end_inset
!
! G56\SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! use preset work coordinate system 3
! \layout Standard
! \pextra_type 2 \pextra_alignment 0 \pextra_widthp 100
!
!
! \begin_inset LatexCommand \index{G57}
!
! \end_inset
!
! G57\SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! use preset work coordinate system 4
! \layout Standard
! \pextra_type 2 \pextra_alignment 0 \pextra_widthp 100
!
!
! \begin_inset LatexCommand \index{G58}
!
! \end_inset
!
! G58\SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! use preset work coordinate system 5
! \layout Standard
! \pextra_type 2 \pextra_alignment 0 \pextra_widthp 100
!
!
! \begin_inset LatexCommand \index{G59}
!
! \end_inset
!
! G59\SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! use preset work coordinate system 6
! \layout Standard
! \pextra_type 2 \pextra_alignment 0 \pextra_widthp 100
!
! G59.1\SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! use preset work coordinate system 7
! \layout Standard
! \pextra_type 2 \pextra_alignment 0 \pextra_widthp 100
!
! G59.2\SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! use preset work coordinate system 8
! \layout Standard
! \pextra_type 2 \pextra_alignment 0 \pextra_widthp 100
!
! G59.3\SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! use preset work coordinate system 9
! \layout Subsection
!
! Default coordinate system
! \layout Standard
!
! One other variable in the VAR file becomes important when we think about
! offset systems.
! This variable is named 5220.
! In the default files it's value is set to 1.00000.
! This means that when the EMC starts up it should use the first coordinate
! system as its default.
! If you set this to 9.00000 it would use the nineth offset system as its
! default for startup and reset.
! Any value other than an interger (decimal really) between 1 and 9 will
! cause the EMC to fault on startup.
!
! \layout Subsection
!
! Setting coordinate system values within G-code.
! \layout Standard
!
! In the general programming chapter we listed a G10 command word.
! This command can be used to change the values of the offsets in a coordinate
! system.
! (add here)
! \layout Section
!
! G92 Offsets
! \layout Standard
!
! G92 is the most misunderstood and maligned part of EMC programming.
! The way that it works has changed just a bit from the early days to the
! current releases.
! This change has confused many users.
! It should be thought of as a temporary offset that is applied to all other
! offsets.
!
! \layout Standard
!
! In response to criticism of it, Ray Henry studied it by comparing the way
! the interpreter authors expected it to work and the way that it worked
! on his Grizzly minimill.
! The following quoted paragraphs are extracted from his paper which is available
! in several text formats in the dropbox at
! \begin_inset LatexCommand \url{http://www.linuxcnc.org}
!
! \end_inset
!
! .
! \layout Subsection
!
! The G92 commands
! \layout Standard
!
! This set of commands include;
! \layout Description
! \pextra_type 1 \pextra_widthp 5
!
! G92 This command, when used with axis names, sets values to offset variables.
! \layout Description
! \pextra_type 1 \pextra_widthp 5
!
! G92.1 This command sets zero values to the g92 variables.
! \layout Description
! \pextra_type 1 \pextra_widthp 5
!
! G92.2 This command suspends but does not zero out the g92 variables.
! \layout Description
! \pextra_type 1 \pextra_widthp 5
!
! G92.3 This command applies offset values that have been suspended.
! \layout Standard
!
! When the commands are used as described above, they will work pretty much
! as you would expect.
! \layout Quotation
!
! A user must understand the correct ways that the g92 values work.
! They are set based upon the location of each axis when the g92 command
! is invoked.
! The NIST document is clear that,
! \begin_inset Quotes eld
! \end_inset
!
! To make the
! \noun on
!
! \noun default
! current point have the coordinates
! \begin_inset Quotes erd
! \end_inset
!
! x0, y0, and z0 you would use g92 x0 y0 z0.
! G92
! \emph on
! does not work from absolute machine coordinates
! \emph default
! .
! It works from
! \emph on
! current location
! \emph default
! .
!
! \layout Quotation
!
! G92 also works from current location as modified by any other offsets that
! are in effect when the g92 command is invoked.
! While testing for differences between work offsets and actual offsets it
! was found that a g54 offset could cancel out a g92 and thus give the appearance
! that no offsets were in effect.
! However, the g92 was still in effect for all coordinates and did produce
! expected work offsets for the other coordinate systems.
!
! \layout Quotation
!
! It is likely that the absence of home switches and proper home procedures
! will result in very large errors in the application of g92 values if they
! exist in the var file.
! Many EMC users do not have home switches in place on their machines.
! For them home should be found by moving each axis to a location and issuing
! the home command.
! When each axis is in a known location, the home command will recalculate
! how the g92 values are applied and will produce consistent results.
! Without a home sequence, the values are applied to the position of the
! machine when the EMC begins to run.
! \layout Subsection
!
! Setting G92 values
! \layout Standard
!
! There are at least two ways to set G92 values.
! \layout Itemize
!
! right mouse click on position displays of tkemc will popup a window into
! which you can type a value.
!
! \layout Itemize
!
! the g92 command
! \layout Standard
!
! Both of these work from the current location of the axis to which the offset
! is to be applied.
!
! \layout Quotation
!
! Issuing g92 x y z a b c does in fact set values to the g92 variables such
! that each axis takes on the value associated with it's name.
! These values are assigned to the current position of the machine axis.
! These results satisfy paragraphs one and two of the NIST document.
! \layout Quotation
!
! G92 commands work from current axis location and add and subtract correctly
! to give the current axis position the value assigned by the g92 command.
! The effects work even though previous offsets are in.
! \layout Standard
!
! So if the X axis is currently showing 2.0000 as its position a G92 x0 will
! set an offset of -2.0000 so that the current location of X becomes zero.
! A G92 X2 will set an offset of 0.0000 and the displayed position will not
! change.
! A G92 X5.0000 will set an offset of 3.0000 so that the current displayed
! position becomes 5.0000.
!
! \layout Subsection
!
! G92 Cautions
! \layout Standard
!
! Sometimes the values of a G92 offset get stuck in the VAR file.
! When this happens reset or a startup will cause them to become active again.
! The variables are named
! \layout Standard
! \pextra_type 1 \pextra_widthp 5
!
! 5211\SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! 0.000000
! \layout Standard
! \pextra_type 1 \pextra_widthp 5
!
! 5212\SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! 0.000000
! \layout Standard
! \pextra_type 1 \pextra_widthp 5
!
! 5213\SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! 0.000000
! \layout Standard
! \pextra_type 1 \pextra_widthp 5
!
! 5214\SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! 0.000000
! \layout Standard
! \pextra_type 1 \pextra_widthp 5
!
! 5215\SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! 0.000000
! \layout Standard
! \pextra_type 1 \pextra_widthp 5
!
! 5216\SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! 0.000000
! \layout Standard
!
! where 5211 is the X axis offset and so on.
! If you are seeing unexpected positions as the result of a commanded move,
! or even unexpected numbers in the position displays when you start up,
! look at these variables in the VAR file and see if they contain values.
! If they do, set them to zeros and the problems should go away.
! \layout Quotation
!
! With these tests we can see that reset returns g92 to the condition that
! it had when the interpreter started up.
! The reader should note that we have established ...
! that no write of these values occurs during a normal run so if no g92 was
! set at the startup, none will be read in during a reset.
! \layout Quotation
!
! It may be that this is the heart of the problem that some have experienced
! with differences between the old and the new interpreter.
! It may well be, but I leave it to others to test, that the old interpreter
! and task programs immediately wrote values to the var file and then found
! those values during a reset.
!
! \layout Standard
!
! On the other hand, if G92 values existed in the VAR file when the EMC started
! up
! \layout Quotation
!
! ...
! starting the EMC with g92 values in the var file is that it will apply
! the values to current location of each axis.
! If this is home position and home position is set as machine zero everything
! will be correct.
! Once home has been established using real machine switches or moving each
! axis to a known home position and issuing an axis home command, g92 commands
! and values work as advertised.
! \layout Quotation
!
! These tests did not study the effect of re-reading the var file while they
! contain numbers.
! This could cause problems if g92 offsets had been removed with g92.1 but
! the var file still contained the previous numbers.
!
! \layout Standard
!
! It is this complexity that causes us to say that G92 values must be treated
! as temporary.
! They should be used to set global short term offsets.
! The G54-59.3 coordinate systems should be used whenever long lasting and
! predictable offsets are needed.
! \layout Section
!
! Sample Program Using Offsets
! \layout Standard
!
! This sample engraving project mills a set of four .1 radius circles in roughly
! a star shape around a center circle.
! We can setup the individual circle pattern like this.
! \layout Standard
! \pextra_type 1 \pextra_widthp 5
!
! G10 L2 P1 x0 y0 z0 (ensure that g54 is set to machine zero)
! \layout Standard
! \pextra_type 1 \pextra_widthp 5
!
! g0 x-.1 y0 z0
! \layout Standard
! \pextra_type 1 \pextra_widthp 5
!
! g1 f1 z-.25
! \layout Standard
! \pextra_type 1 \pextra_widthp 5
!
! g3 x-.1 y0 i.1 j0
! \layout Standard
! \pextra_type 1 \pextra_widthp 5
!
! g0 z0
! \layout Standard
! \pextra_type 1 \pextra_widthp 5
!
! m2
! \layout Standard
!
! We can issue a set of commands to create offsets for the four other circles
! like this.
! \layout Standard
! \pextra_type 1 \pextra_widthp 5
!
! G10 L2 P2 x0.5 (offsets g55 x value by 0.5 inch)
! \layout Standard
! \pextra_type 1 \pextra_widthp 5
!
! G10 L2 P3 x-0.5 (offsets g56 x value by -0.5 inch)
! \layout Standard
! \pextra_type 1 \pextra_widthp 5
!
! G10 L2 P4 y0.5 (offsets g57 y value by 0.5 inch)
! \layout Standard
! \pextra_type 1 \pextra_widthp 5
!
! G10 L2 P5 y-0.5 (offsets g58 y value by -0.5 inch)
! \layout Standard
!
! We put these together in the following program.
! \layout Standard
! \pextra_type 1 \pextra_widthp 5
!
! (a program for milling five small circles in a diamond shape)
! \layout Standard
! \pextra_type 1 \pextra_widthp 5
!
! G10 L2 P1 x0 y0 z0 (ensure that g54 is machine zero)
! \layout Standard
! \pextra_type 1 \pextra_widthp 5
!
! G10 L2 P2 x0.5 (offsets g55 x value by 0.5 inch)
! \layout Standard
! \pextra_type 1 \pextra_widthp 5
!
! G10 L2 P3 x-0.5 (offsets g56 x value by -0.5 inch)
! \layout Standard
! \pextra_type 1 \pextra_widthp 5
!
! G10 L2 P4 y0.5 (offsets g57 y value by 0.5 inch)
! \layout Standard
! \pextra_type 1 \pextra_widthp 5
!
! G10 L2 P5 y-0.5 (offsets g58 y value by -0.5 inch)
! \layout Standard
! \pextra_type 1 \pextra_widthp 5
!
! g54 g0 x-.1 y0 z0 (center circle)
! \layout Standard
! \pextra_type 1 \pextra_widthp 5
!
! g1 f1 z-.25
! \layout Standard
! \pextra_type 1 \pextra_widthp 5
!
! g3 x-.1 y0 i.1 j0
! \layout Standard
! \pextra_type 1 \pextra_widthp 5
!
! g0 z0
! \layout Standard
! \pextra_type 1 \pextra_widthp 5
!
! g55 g0 x-.1 y0 z0 (first offset circle)
! \layout Standard
! \pextra_type 1 \pextra_widthp 5
!
! g1 f1 z-.25
! \layout Standard
! \pextra_type 1 \pextra_widthp 5
!
! g3 x-.1 y0 i.1 j0
! \layout Standard
! \pextra_type 1 \pextra_widthp 5
!
! g0 z0
! \layout Standard
! \pextra_type 1 \pextra_widthp 5
!
! g56 g0 x-.1 y0 z0 (second offset circle)
! \layout Standard
! \pextra_type 1 \pextra_widthp 5
!
! g1 f1 z-.25
! \layout Standard
! \pextra_type 1 \pextra_widthp 5
!
! g3 x-.1 y0 i.1 j0
! \layout Standard
! \pextra_type 1 \pextra_widthp 5
!
! g0 z0
! \layout Standard
! \pextra_type 1 \pextra_widthp 5
!
! g57 g0 x-.1 y0 z0 (third offset circle)
! \layout Standard
! \pextra_type 1 \pextra_widthp 5
!
! g1 f1 z-.25
! \layout Standard
! \pextra_type 1 \pextra_widthp 5
!
! g3 x-.1 y0 i.1 j0
! \layout Standard
! \pextra_type 1 \pextra_widthp 5
!
! g0 z0
! \layout Standard
! \pextra_type 1 \pextra_widthp 5
!
! g58 g0 x-.1 y0 z0 (fourth offset circle)
! \layout Standard
! \pextra_type 1 \pextra_widthp 5
!
! g1 f1 z-.25
! \layout Standard
! \pextra_type 1 \pextra_widthp 5
!
! g3 x-.1 y0 i.1 j0
! \layout Standard
! \pextra_type 1 \pextra_widthp 5
!
! g54 g0 x0 y0 z0
! \layout Standard
! \pextra_type 1 \pextra_widthp 5
!
! m2
! \layout Standard
!
! Now comes the time when we might apply a set of G92 offsets to this program.
! You'll see that it is running in each case at z0.
! If the mill were at the zero position, a g92 z1.0000 issued at the head
! of the program would shift everything down an inch.
! You might also shift the whole pattern around in the XY plane by adding
! some x and y offsets with g92.
! If you do this you should add a G92.1 command just before the m2 that ends
! the program.
! If you do not, other programs that you might run after this one will also
! use that g92 offset.
! Furthermore it would save the g92 values when you shut down the EMC and
! they will be recalled when you start up again.
\the_end
Index: User_Linux.lyx
===================================================================
RCS file: /cvsroot/emc/documents/lyx/User_Linux.lyx,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** User_Linux.lyx 5 Jul 2003 01:44:29 -0000 1.1
--- User_Linux.lyx 18 Jul 2003 18:46:07 -0000 1.2
***************
*** 504,515 ****
\layout Standard
! This is in essence how the entire text mode of Linux works works.
At a prompt, you enter a command and press the <enter> key.
!
\layout Standard
! The command may have arguments that go along with it.
Let me illustrate with the Linux equivalent of the ms-dos dir command.
! That command is ls (lower case LS).
The response that I get to this command is a window full of file names.
They may arranged in multiple columns, but that depends upon the size of
--- 504,517 ----
\layout Standard
! This is in essence how the entire text mode of Linux works.
At a prompt, you enter a command and press the <enter> key.
! Linux runs the command that you have typed in and returns a response.
! If no response is called for it will return the prompt so that you can
! enter another command.
\layout Standard
! A command may have arguments that go along with it.
Let me illustrate with the Linux equivalent of the ms-dos dir command.
! That Linux command is ls (lower case LS).
The response that I get to this command is a window full of file names.
They may arranged in multiple columns, but that depends upon the size of
***************
*** 588,592 ****
The fact that you entered a single word, info, and the terminal executed
! a program named info is the significant point here.
There are thousands of commands.
Any file marked with executable permissions is an acceptable command to
--- 590,594 ----
The fact that you entered a single word, info, and the terminal executed
! a program named info is the significant point.
There are thousands of commands.
Any file marked with executable permissions is an acceptable command to
***************
*** 606,610 ****
available to users of Linux.
! Right now I can almost hear you gasp --
\begin_inset Quotes eld
\end_inset
--- 608,612 ----
available to users of Linux.
! Right now I can almost hear you gasp,
\begin_inset Quotes eld
\end_inset
***************
*** 614,619 ****
\end_inset
! Most all of the shells will execute a command like ls and will start a
! binary file for you.
Which shell you are running becomes important if the file that you want
to run is a script.
--- 616,621 ----
\end_inset
! The good news is that most all of the shells will execute a command like
! ls and will start a binary file for you.
Which shell you are running becomes important if the file that you want
to run is a script.
***************
*** 1193,1197 ****
It is a good idea to use this script program when you are debugging an
EMC.
! From it you can cut and past the problem lines into your email requests
for help.
You will need to rename the typescript file after each session if you want
--- 1195,1199 ----
It is a good idea to use this script program when you are debugging an
EMC.
! From it you can cut and paste the problem lines into your email requests
for help.
You will need to rename the typescript file after each session if you want
Index: User_Whatis_EMC.lyx
===================================================================
RCS file: /cvsroot/emc/documents/lyx/User_Whatis_EMC.lyx,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** User_Whatis_EMC.lyx 16 Jul 2003 19:47:20 -0000 1.2
--- User_Whatis_EMC.lyx 18 Jul 2003 18:46:07 -0000 1.3
***************
*** 6,17 ****
\fontscheme bookman
\graphics default
! \float_placement h
\paperfontsize 10
\spacing single
! \papersize Default
! \paperpackage a4wide
! \use_geometry 0
\use_amsmath 0
\paperorientation portrait
\secnumdepth 5
\tocdepth 5
--- 6,23 ----
\fontscheme bookman
\graphics default
! \float_placement !!h
\paperfontsize 10
\spacing single
! \papersize Custom
! \paperpackage a4
! \use_geometry 1
\use_amsmath 0
\paperorientation portrait
+ \paperwidth 8.5in
+ \paperheight 11in
+ \leftmargin 1.2in
+ \topmargin 1in
+ \rightmargin 0.6in
+ \bottommargin 0.6in
\secnumdepth 5
\tocdepth 5
***************
*** 322,325 ****
--- 328,337 ----
machine kinematics routines.
+ \layout Standard
+
+ The motion controllers that you will be using with your stepper motors will
+ most likely be steppermod or freqmod.
+ The ability and requirements of each of these will be described when we
+ get to hardware and how to configure the EMC for your specific hardware.
\layout Subsection
***************
*** 333,336 ****
--- 345,357 ----
machine actions like lube, coolant, and spindle direction and speed.
+ \layout Standard
+
+ There are a couple of versions of I/O controllers that are a part of most
+ every EMC release.
+ These are minimillio and bridgeportio.
+ You guessed it the one that we will be working with here is minimillio.
+ The hardware chapter will talk just a bit about bridgeportio in case you
+ want to add some of the extra features available with it to your minimill.
+
\layout Subsection
***************
*** 409,412 ****
--- 430,439 ----
input or output systems and sends blocks of canonical commands to the task
and motion planning programs.
+ \layout Standard
+
+ There are also at least two task controllers included in most every release
+ of the EMC.
+ These are named minimilltask and bridgeporttask.
+ These complement the I/O programs.
\layout Section
***************
*** 426,430 ****
Broken tools, gouged vices, and scars are the evidence of lessons taught.
! Good part finish and close tolerances are the evidence of lessons learned.
No machine, no computer program, can take the place of human experience.
\layout Standard
--- 453,458 ----
Broken tools, gouged vices, and scars are the evidence of lessons taught.
! Good part finish, close tolerances, and careful work are the evidence of
! lessons learned.
No machine, no computer program, can take the place of human experience.
\layout Standard
***************
*** 435,438 ****
--- 463,470 ----
It is a machine that is either waiting for your command or executing the
command that you have just given it.
+ Throughout these pages we will give information that will help you become
+ a good operator of the EMC minimill.
+ You will need some information right up front here so that the following
+ pages will make sense to you.
\layout Subsection
***************
*** 442,446 ****
When an EMC is running, there are three different major modes used for inputting
! commands, manual, auto, and mdi.
Changing from one mode to another makes a big difference in the way that
the EMC behaves.
--- 474,479 ----
When an EMC is running, there are three different major modes used for inputting
! commands.
! These are manual, auto, and mdi.
Changing from one mode to another makes a big difference in the way that
the EMC behaves.
***************
*** 453,457 ****
\layout Standard
! In manual mode, each command is entered as a separate command.
In human terms a manual command might be
\begin_inset Quotes eld
--- 486,490 ----
\layout Standard
! In manual mode, each command is entered as separate.
In human terms a manual command might be
\begin_inset Quotes eld
***************
*** 470,475 ****
\end_inset
! These commands are normally handled on the graphical interface by pressing
! a button with the mouse or holding down a key on the keyboard.
In auto mode, a similar button or keypress might be used to load or start
the running of a whole program of G-code that is stored in a file.
--- 503,510 ----
\end_inset
! These are roughly equivalent to flipping a switch or turning the handwheel
! for an axis.
! These commands are normally handled on one of the graphical interfaces
! by pressing a button with the mouse or holding down a key on the keyboard.
In auto mode, a similar button or keypress might be used to load or start
the running of a whole program of G-code that is stored in a file.
***************
*** 481,484 ****
--- 516,520 ----
in motion in all modes.
These include abort, estop, and feedrate override.
+ Commands like these are pretty self explanitory.
\layout Subsection
***************
*** 547,552 ****
Most of this is not the topic of this book but there are a few things that
you will have to understand in order to make our little minimill work for
! us.
\layout Subsection
--- 583,662 ----
Most of this is not the topic of this book but there are a few things that
you will have to understand in order to make our little minimill work for
! us like we expect it to work.
!
! \layout Subsection
!
! Units
! \layout Standard
!
! Units can be confusing.
! A newbie recently asked,
! \begin_inset Quotes eld
! \end_inset
!
! Does it work in inches, feet, centimeters, millimeters, or what?
! \begin_inset Quotes erd
! \end_inset
!
! There are several possible answers to this question but the best one is
! that it works in the units that you set it to work in.
!
! \layout Standard
!
! At a machine level, we set each axis' units to some value using an INI variable
! that looks like this.
! \layout Standard
! \pextra_type 1 \pextra_widthp 5
!
! UNITS=\SpecialChar ~
! \SpecialChar ~
! 1
! \layout Standard
! \pextra_type 1 \pextra_widthp 5
!
! or
! \layout Standard
! \pextra_type 1 \pextra_widthp 5
!
! UNITS =\SpecialChar ~
! \SpecialChar ~
! 0.03937007874016
! \layout Standard
!
! Math folk will get a clue from these numbers because the long decimal number
! is the distance represented by one millimeter if we convert it into inches.
+ \begin_inset Quotes eld
+ \end_inset
+
+ So,
+ \begin_inset Quotes erd
+ \end_inset
+
+ you say,
+ \begin_inset Quotes eld
+ \end_inset
+
+ the EMC uses millimeters internally.
+ \begin_inset Quotes erd
+ \end_inset
+
+ If we use UNITS = 1 then we have defined our user units as millimeters.
+ If we use UNITS = 0.03937007874016 then we have defined our user units as
+ inches.
+ Using similar maths we could set our units to most any value we wanted.
+ (Some of the EMC people who run vehicles with the EMC set units to kilometers
+ or miles.)
+ \layout Standard
+
+ After we have decided upon a value for the units for an axis, we tell the
+ emc how may step pulses or encoder pulses it should send or read for each
+ unit of distance to be traveled.
+ Once we have done this, the EMC knows how to count units of distance.
+ However it is very important to understand that this counting of distance
+ is different from the commanding of distance.
+ You can command distance in millimeters or inches without even thinking
+ about the units that you defined.
+ There are G-codes that allow you to switch easily between metric and imperial.
\layout Subsection
***************
*** 577,599 ****
There are four kinds of configuration files: INI, NML, TBL, VAR.
! These are reflected in lower case file extensions.
They may be named emc.tbl or generic.tbl but they do the same thing when
they are read by the EMC as it starts up.
\layout Standard
! The first, emc.ini, contains all the machine parameters such as servo gains,
! scale factors, cycle times, units, etc.
and will certainly need to be edited.
! emc.nml contains communication settings for shared memory and network ports
you may need to override on your system, although it is likely that you
can leave these settings alone.
! tool.tbl contains the tool information such as which pocket contains which
tool, and the length and diameter for each tool.
! rs274ngc.var contains variables specific to the RS-274-NGC dialect of NC
code, notably for setting the persistent numeric variables for the nine
work coordinate systems.
- We will get into some of the details of these files as we begin to hook
- up and operate our little machine.
\the_end
--- 687,745 ----
There are four kinds of configuration files: INI, NML, TBL, VAR.
! These are reflected in lower case file extensions to a file name.
They may be named emc.tbl or generic.tbl but they do the same thing when
they are read by the EMC as it starts up.
+ Many users copy these and name them for the specific machine that they
+ are editing them for.
+ A set of these files named Sherlinemill.ini, Sherlinemill.var, Sherlinemill.tbl
+ and Sherlinemill.nml are certainly more descriptive than a bunch of files
+ named generic.
\layout Standard
! These files each contain specific information for your CNC.
! \layout Itemize
!
! emc.ini, contains all the machine parameters such as servo gains, scale factors,
! cycle times, units, etc.
and will certainly need to be edited.
!
! \layout Itemize
!
! emc.nml contains communication settings for shared memory and network ports
you may need to override on your system, although it is likely that you
can leave these settings alone.
!
! \layout Itemize
!
! tool.tbl contains the tool information such as which pocket contains which
tool, and the length and diameter for each tool.
!
! \layout Itemize
!
! rs274ngc.var contains variables specific to the RS-274-NGC dialect of NC
code, notably for setting the persistent numeric variables for the nine
work coordinate systems.
+ \layout Standard
+
+ We'll get into some of the details of these files as we begin to hook up
+ and operate our little machine.
+ \layout Standard
+
+ In addition to these four files, there is a standard startup file.
+ Back in the early days of the EMC it was common to have to start up several
+ different tasks in different terminal windows in order to get the EMC to
+ run a machine.
+ Each of these tasks had to be supplied a bunch of information in the form
+ of arguments in order to be certain that the task started the way that
+ we expected it to.
+ All of this was a tedius thing.
+ All of this has been replaced with the run script file.
+ It is named with a .run extension.
+ This executable script file controls the startup of all of the modules
+ needed to run a standard version of the EMC.
+ These run files are all pretty much the same.
+ You may want to edit the name of the ini file that will be called by the
+ run file that you choose to use but the rest of it can be left alone.
\the_end
|