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
(21) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <ms...@us...> - 2003-07-21 02:51:38
|
Update of /cvsroot/emc/emc/src/emcnml
In directory sc8-pr-cvs1:/tmp/cvs-serv20968/src/emcnml
Modified Files:
emc.cc emc.hh emcops.cc iniaxis.cc
Log Message:
Substantial changes to freqmod and new ini file variables
Index: emc.cc
===================================================================
RCS file: /cvsroot/emc/emc/src/emcnml/emc.cc,v
retrieving revision 1.28
retrieving revision 1.29
diff -C2 -d -r1.28 -r1.29
*** emc.cc 7 May 2003 19:49:50 -0000 1.28
--- emc.cc 21 Jul 2003 02:51:34 -0000 1.29
***************
*** 29,33 ****
#endif
#ifndef EMCNAME_LIST_LENGTH
! #define EMCNAME_LIST_LENGTH 156
#endif
--- 29,33 ----
#endif
#ifndef EMCNAME_LIST_LENGTH
! #define EMCNAME_LIST_LENGTH 157
#endif
***************
*** 76,79 ****
--- 76,80 ----
"EMC_AXIS_SET_UNITS", /* 45,102 */
"EMC_AXIS_STAT", /* 46,199 */
+ "EMC_AXIS_SET_STEP_PARAMS",
"EMC_COOLANT_ABORT", /* 49,1403 */
"EMC_COOLANT_FLOOD_OFF", /* 51,1407 */
***************
*** 233,236 ****
--- 234,238 ----
EMC_AXIS_SET_UNITS_TYPE, /* 45,102 */
EMC_AXIS_STAT_TYPE, /* 46,199 */
+ EMC_AXIS_SET_STEP_PARAMS_TYPE,
EMC_COOLANT_ABORT_TYPE, /* 49,1403 */
EMC_COOLANT_FLOOD_OFF_TYPE, /* 51,1407 */
***************
*** 390,393 ****
--- 392,396 ----
sizeof(EMC_AXIS_SET_UNITS),
sizeof(EMC_AXIS_STAT),
+ sizeof(EMC_AXIS_SET_STEP_PARAMS),
sizeof(EMC_COOLANT_ABORT),
sizeof(EMC_COOLANT_FLOOD_OFF),
***************
*** 1103,1106 ****
--- 1106,1112 ----
((EMC_AXIS_STAT *) buffer)->update(cms);
break;
+ case EMC_AXIS_SET_STEP_PARAMS_TYPE:
+ ((EMC_AXIS_SET_STEP_PARAMS *) buffer)->update(cms);
+ break;
case EMC_COOLANT_ABORT_TYPE:
((EMC_COOLANT_ABORT *) buffer)->update(cms);
***************
*** 1540,1543 ****
--- 1546,1551 ----
case EMC_AXIS_STAT_TYPE:
return "EMC_AXIS_STAT";
+ case EMC_AXIS_SET_STEP_PARAMS_TYPE:
+ return "EMC_AXIS_SET_STEP_PARAMS";
case EMC_COOLANT_ABORT_TYPE:
return "EMC_COOLANT_ABORT";
***************
*** 3656,3659 ****
--- 3664,3669 ----
cms->update_with_name("minFerror",minFerror);
cms->update_with_name("homingVel",homingVel);
+ cms->update_with_name("setup_time",setup_time);
+ cms->update_with_name("hold_time",hold_time);
cms->update_with_name("homeOffset",homeOffset);
cms->update_with_name("enablePolarity",enablePolarity);
***************
*** 5593,5596 ****
--- 5603,5628 ----
cms->endClass("EMC_AXIS_SET_MIN_OUTPUT_LIMIT","EMC_AXIS_CMD_MSG");
+
+ }
+
+
+ /*
+ * NML/CMS Update function for EMC_AXIS_SET_STEP_PARAMS
+ * Manually generated by Matt Shaver.
+ * on Fri Jul 18 19:25:01-27/64 EDT 2003
+ */
+ void EMC_AXIS_SET_STEP_PARAMS::update(CMS *cms)
+ {
+
+ cms->beginClass("EMC_AXIS_SET_STEP_PARAMS","EMC_AXIS_CMD_MSG");
+
+ cms->beginBaseClass("EMC_AXIS_CMD_MSG");
+ EMC_AXIS_CMD_MSG::update(cms);
+ cms->endBaseClass("EMC_AXIS_CMD_MSG");
+
+ cms->update_with_name("setup_time",setup_time);
+ cms->update_with_name("hold_time",hold_time);
+
+ cms->endClass("EMC_AXIS_SET_STEP_PARAMS","EMC_AXIS_CMD_MSG");
}
Index: emc.hh
===================================================================
RCS file: /cvsroot/emc/emc/src/emcnml/emc.hh,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** emc.hh 27 Mar 2003 20:11:36 -0000 1.16
--- emc.hh 21 Jul 2003 02:51:34 -0000 1.17
***************
*** 9,12 ****
--- 9,13 ----
Modification history:
+ 18-Jul-2002 MGS added EMC_AXIS_SET_STEP_PARAMS stuff.
27-Mar-2003 WPS changed a number of #defines to enum values.
(This is necessary for making the xml readable.)
***************
*** 144,147 ****
--- 145,149 ----
#define EMC_AXIS_LOAD_COMP_TYPE ((NMLTYPE) 131)
#define EMC_AXIS_ALTER_TYPE ((NMLTYPE) 132)
+ #define EMC_AXIS_SET_STEP_PARAMS_TYPE ((NMLTYPE) 133)
#define EMC_AXIS_STAT_TYPE ((NMLTYPE) 199)
***************
*** 489,492 ****
--- 491,495 ----
extern int emcAxisSetMinFerror(int axis, double ferror);
extern int emcAxisSetHomingVel(int axis, double homingVel);
+ extern int emcAxisSetStepParams(int axis, double setup_time, double hold_time);
extern int emcAxisSetHome(int axis, double home);
extern int emcAxisSetHomeOffset(int axis, double offset);
***************
*** 1246,1249 ****
--- 1249,1269 ----
};
+ /**
+ * Set the step parameters.
+ * This command sets the setup time of the direction signal,
+ * and the hold time of the step signal.
+ */
+ class EMC_AXIS_SET_STEP_PARAMS : public EMC_AXIS_CMD_MSG
+ {
+ public:
+ EMC_AXIS_SET_STEP_PARAMS() : EMC_AXIS_CMD_MSG(EMC_AXIS_SET_STEP_PARAMS_TYPE, sizeof(EMC_AXIS_SET_STEP_PARAMS)) {};
+
+ // For internal NML/CMS use only.
+ void update(CMS *cms);
+
+ double setup_time;
+ double hold_time;
+ };
+
// AXIS status base class
class EMC_AXIS_STAT_MSG : public RCS_STAT_MSG
***************
*** 1291,1294 ****
--- 1311,1316 ----
double minFerror;
double homingVel;
+ double setup_time;
+ double hold_time;
double homeOffset;
unsigned char enablePolarity;
Index: emcops.cc
===================================================================
RCS file: /cvsroot/emc/emc/src/emcnml/emcops.cc,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** emcops.cc 21 Dec 2000 16:22:11 -0000 1.3
--- emcops.cc 21 Jul 2003 02:51:34 -0000 1.4
***************
*** 8,11 ****
--- 8,12 ----
Modification history:
+ 19-Jul-2003 MGS added setup_time and hold_time to EMC_AXIS_STAT
31-Jan-1999 FMP added backlash, bias, maxError to EMC_AXIS_STAT
7-Oct-1998 FMP added init of homingVel to EMC_AXIS_STAT ctor
***************
*** 45,48 ****
--- 46,51 ----
maxFerror = 1.0;
homingVel = 1.0;
+ setup_time = 1;
+ hold_time = 2;
enablePolarity = 1;
minLimitSwitchPolarity = 1;
Index: iniaxis.cc
===================================================================
RCS file: /cvsroot/emc/emc/src/emcnml/iniaxis.cc,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** iniaxis.cc 7 May 2003 19:49:52 -0000 1.5
--- iniaxis.cc 21 Jul 2003 02:51:34 -0000 1.6
***************
*** 6,9 ****
--- 6,10 ----
Modification history:
+ 18-Jul-2003 MGS added EMC_AXIS_SET_STEP_PARAMS stuff.
10-Aug-2000 FMP added emcAxisLoadComp() call from COMP_FILE
20-Apr-2000 WPS changed rcs_print(ourAxisSection, "AXIS_%d", axis) to
***************
*** 75,78 ****
--- 76,81 ----
MIN_FERROR <float> minimum following error
HOMING_VEL <float> homing speed, positive
+ SETUP_TIME <float> number of periods dir change preceeds step
+ HOLD_TIME <float> number of periods step line is held low/high after active edge
ENABLE_POLARITY <0, 1> polarity for amp enable output
MIN_LIMIT_SWITCH_POLARITY <0, 1> polarity for min limit switch input
***************
*** 100,103 ****
--- 103,107 ----
emcAxisSetMinFerror(int axis, double ferror);
emcAxisSetHomingVel(int axis, double homingVel);
+ emcAxisSetStepParams(int axis, double setup_time, double hold_time);
emcAxisSetEnablePolarity(int axis, int level);
emcAxisSetMinLimitSwitchPolarity(int axis, int level);
***************
*** 128,131 ****
--- 132,137 ----
double limit;
double homingVel;
+ double setup_time;
+ double hold_time;
double home;
double maxVelocity;
***************
*** 684,687 ****
--- 690,738 ----
if (EMC_DEBUG & EMC_DEBUG_CONFIG) {
rcs_print_error("bad return from emcAxisSetHomingVel\n");
+ }
+ return -1;
+ }
+
+ if (NULL != (inistring = axisInifile->find("SETUP_TIME", axisString))) {
+ if (1 == sscanf(inistring, "%lf", &setup_time)) {
+ // found, and valid
+ }
+ else {
+ // found, but invalid
+ if (EMC_DEBUG & EMC_DEBUG_INVALID) {
+ rcs_print_error("invalid inifile value for [%s] SETUP_TIME: %s\n", axisString, inistring);
+ }
+ setup_time = 1; // default for setup time
+ }
+ }
+ else {
+ // not found at all
+ setup_time = 1;
+ if (EMC_DEBUG & EMC_DEBUG_DEFAULTS) {
+ rcs_print_error("can't find [%s] SETUP_TIME, using default\n", axisString);
+ }
+ }
+ if (NULL != (inistring = axisInifile->find("HOLD_TIME", axisString))) {
+ if (1 == sscanf(inistring, "%lf", &hold_time)) {
+ // found, and valid
+ }
+ else {
+ // found, but invalid
+ if (EMC_DEBUG & EMC_DEBUG_INVALID) {
+ rcs_print_error("invalid inifile value for [%s] HOLD_TIME: %s\n", axisString, inistring);
+ }
+ hold_time = 2; // default for setup time
+ }
+ }
+ else {
+ // not found at all
+ hold_time = 2;
+ if (EMC_DEBUG & EMC_DEBUG_DEFAULTS) {
+ rcs_print_error("can't find [%s] HOLD_TIME, using default\n", axisString);
+ }
+ }
+ if (0 != emcAxisSetStepParams(axis, setup_time, hold_time)) {
+ if (EMC_DEBUG & EMC_DEBUG_CONFIG) {
+ rcs_print_error("bad return from emcAxisSetStepParams\n");
}
return -1;
|
|
From: <ms...@us...> - 2003-07-21 02:51:37
|
Update of /cvsroot/emc/emc/src/emcmot
In directory sc8-pr-cvs1:/tmp/cvs-serv20968/src/emcmot
Modified Files:
emcmot.c emcmot.h
Log Message:
Substantial changes to freqmod and new ini file variables
Index: emcmot.c
===================================================================
RCS file: /cvsroot/emc/emc/src/emcmot/emcmot.c,v
retrieving revision 1.90
retrieving revision 1.91
diff -C2 -d -r1.90 -r1.91
*** emcmot.c 11 Jul 2003 06:53:49 -0000 1.90
--- emcmot.c 21 Jul 2003 02:51:34 -0000 1.91
***************
*** 7,10 ****
--- 7,13 ----
Modification history:
+ 18-Jul-2003 MGS rewrote freqfunc, added EMC_AXIS_SET_STEP_PARAMS, and
+ removed binfunc. Each axis should have a SETUP_TIME and HOLD_TIME entry
+ in the .ini file.
11-Jul-2003 MGS deleted unreachable code that was shadowed by an #ifdef/#else.
Also, moved an incorrectly placed #endif.
***************
*** 529,540 ****
[...1224 lines suppressed...]
rt_task_init(&freqTask, /* RT_TASK * */
--- 5457,5461 ----
break;
! case 0:
default: /* default is step/direction */
rt_task_init(&freqTask, /* RT_TASK * */
***************
*** 5927,5936 ****
rt_task_use_fp(&freqTask, 1);
- if(STEPPING_TYPE != 4)
- {
rt_task_make_periodic(&freqTask,
rt_get_time() + PERIOD,
PERIOD);
- }
#endif /* ! USE_RTL2 */
#endif /* STEPPER_MOTORS */
--- 5469,5475 ----
Index: emcmot.h
===================================================================
RCS file: /cvsroot/emc/emc/src/emcmot/emcmot.h,v
retrieving revision 1.28
retrieving revision 1.29
diff -C2 -d -r1.28 -r1.29
*** emcmot.h 17 Nov 2002 00:38:00 -0000 1.28
--- emcmot.h 21 Jul 2003 02:51:34 -0000 1.29
***************
*** 11,14 ****
--- 11,15 ----
Modification history:
+ 18-Jul-2003 MGS added EMCMOT_AXIS_SET_STEP_PARAMS stuff.
25-Sep-2002 P.C. Merged Jon Elson's ppmc code.
17-Aug-2001 FMP added EMCMOT_SET_AOUT,DOUT
***************
*** 173,178 ****
EMCMOT_SET_DOUT, /* sets a digital motion point for next move */
EMCMOT_SET_INDEX_BIT, /* Sets or clears a digital IO pin */
! EMCMOT_READ_INDEX_BIT /* Reads a digital IO pin */
!
};
--- 174,179 ----
EMCMOT_SET_DOUT, /* sets a digital motion point for next move */
EMCMOT_SET_INDEX_BIT, /* Sets or clears a digital IO pin */
! EMCMOT_READ_INDEX_BIT, /* Reads a digital IO pin */
! EMCMOT_SET_STEP_PARAMS /* sets setup_time and hold_time for freqtask */
};
***************
*** 197,201 ****
double maxLimit; /* pos value for position limit, output */
double minLimit; /* neg value for position limit, output */
! EmcPose pos; /* end for line, circle */
PmCartesian center; /* center for circle */
PmCartesian normal; /* normal vec for circle */
--- 198,202 ----
double maxLimit; /* pos value for position limit, output */
double minLimit; /* neg value for position limit, output */
! EmcPose pos; /* end for line, circle */
PmCartesian center; /* center for circle */
PmCartesian normal; /* normal vec for circle */
***************
*** 227,233 ****
int probeIndex; /* which wire the probe signal is on */
#endif
! int debug; /* debug level, from DEBUG in .ini file */
unsigned char out, start, end; /* motion index, start, and end bits */
unsigned char tail; /* flag count for mutex detect */
} EMCMOT_COMMAND;
--- 228,236 ----
int probeIndex; /* which wire the probe signal is on */
#endif
! int debug; /* debug level, from DEBUG in .ini file */
unsigned char out, start, end; /* motion index, start, and end bits */
unsigned char tail; /* flag count for mutex detect */
+ double setup_time; /* number of periods before step occurs that dir changes */
+ double hold_time; /* number of periods that step line is held low/high after transition */
} EMCMOT_COMMAND;
***************
*** 389,399 ****
} EMCMOT_STATUS;
!
typedef struct
{
! unsigned char head; /* flag count for mutex detect */
!
! int config_num; /* Incremented everytime configuration changed, should match status.config_num */
!
EMCMOT_AXIS_FLAG axisPolarity[EMCMOT_MAX_AXIS];
int numAxes;
--- 392,400 ----
} EMCMOT_STATUS;
! /* config struct */
typedef struct
{
! unsigned char head; /* flag count for mutex detect */
! int config_num; /* Incremented everytime configuration changed, should match status.config_num */
EMCMOT_AXIS_FLAG axisPolarity[EMCMOT_MAX_AXIS];
int numAxes;
***************
*** 401,427 ****
double servoCycleTime;
int interpolationRate;
! double maxLimit[EMCMOT_MAX_AXIS]; /* maximum axis limits, counts */
! double minLimit[EMCMOT_MAX_AXIS]; /* minimum axis limits, counts */
! double minOutput[EMCMOT_MAX_AXIS]; /* minimum output value allowed, volts */
! double maxOutput[EMCMOT_MAX_AXIS]; /* maximum output value allowed, volts */
! double minFerror[EMCMOT_MAX_AXIS]; /* minimum allowable following error */
! double maxFerror[EMCMOT_MAX_AXIS]; /* maximum allowable following error */
! double limitVel; /* scalar upper limit on vel */
double axisLimitVel[EMCMOT_MAX_AXIS]; /* scalar upper limit on axis vels */
! double homingVel[EMCMOT_MAX_AXIS]; /* scalar max homing vels */
! double homeOffset[EMCMOT_MAX_AXIS]; /* where to go after home, user units */
! int probeIndex; /* Which wire has the probe signal? */
! int probePolarity; /* Look for 0 or 1. */
KINEMATICS_TYPE kinematics_type;
PID_STRUCT pid[EMCMOT_MAX_AXIS];
! int STEPPING_TYPE; /* 0 = step/direction, 1 = phasing */
!
! int PERIOD; /* fundamental period for timer interrupts */
unsigned long int IO_BASE_ADDRESS;
! int debug; /* copy of DEBUG, from .ini file */
! unsigned char tail; /* flag count for mutex detect */
} EMCMOT_CONFIG;
typedef struct
{
--- 402,430 ----
double servoCycleTime;
int interpolationRate;
! double maxLimit[EMCMOT_MAX_AXIS]; /* maximum axis limits, counts */
! double minLimit[EMCMOT_MAX_AXIS]; /* minimum axis limits, counts */
! double minOutput[EMCMOT_MAX_AXIS]; /* minimum output value allowed, volts */
! double maxOutput[EMCMOT_MAX_AXIS]; /* maximum output value allowed, volts */
! double minFerror[EMCMOT_MAX_AXIS]; /* minimum allowable following error */
! double maxFerror[EMCMOT_MAX_AXIS]; /* maximum allowable following error */
! double limitVel; /* scalar upper limit on vel */
double axisLimitVel[EMCMOT_MAX_AXIS]; /* scalar upper limit on axis vels */
! double homingVel[EMCMOT_MAX_AXIS]; /* scalar max homing vels */
! double homeOffset[EMCMOT_MAX_AXIS]; /* where to go after home, user units */
! int probeIndex; /* Which wire has the probe signal? */
! int probePolarity; /* Look for 0 or 1. */
KINEMATICS_TYPE kinematics_type;
PID_STRUCT pid[EMCMOT_MAX_AXIS];
! int STEPPING_TYPE; /* 0 = step/direction, 1 = phasing */
! double setup_time[EMCMOT_MAX_AXIS]; /* number of periods before step occurs that dir changes */
! double hold_time[EMCMOT_MAX_AXIS]; /* number of periods that step line is held low/high after transition */
! int PERIOD; /* fundamental period for timer interrupts */
unsigned long int IO_BASE_ADDRESS;
! int debug; /* copy of DEBUG, from .ini file */
! unsigned char tail; /* flag count for mutex detect */
} EMCMOT_CONFIG;
+ /* debug struct */
typedef struct
{
|
Update of /cvsroot/emc/emc In directory sc8-pr-cvs1:/tmp/cvs-serv20968 Modified Files: emc.ini generic.ini lukas.ini minitetra.ini rs274ngc_new_sim.ini rtsim.ini sim.ini stepper.ini Log Message: Substantial changes to freqmod and new ini file variables Index: emc.ini =================================================================== RCS file: /cvsroot/emc/emc/emc.ini,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** emc.ini 10 Nov 2002 00:08:26 -0000 1.13 --- emc.ini 21 Jul 2003 02:51:32 -0000 1.14 *************** *** 162,165 **** --- 162,167 ---- MIN_FERROR = 0.010 HOMING_VEL = 0.1 + SETUP_TIME = 1 + HOLD_TIME = 2 HOME_OFFSET = 0.0 ENABLE_POLARITY = 0 *************** *** 213,216 **** --- 215,220 ---- MIN_FERROR = 0.010 HOMING_VEL = 0.1 + SETUP_TIME = 1 + HOLD_TIME = 2 HOME_OFFSET = 0.0 ENABLE_POLARITY = 0 *************** *** 264,267 **** --- 268,273 ---- MIN_FERROR = 0.010 HOMING_VEL = 0.1 + SETUP_TIME = 1 + HOLD_TIME = 2 HOME_OFFSET = 0.0 ENABLE_POLARITY = 0 Index: generic.ini =================================================================== RCS file: /cvsroot/emc/emc/generic.ini,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** generic.ini 10 Nov 2002 00:08:26 -0000 1.14 --- generic.ini 21 Jul 2003 02:51:32 -0000 1.15 *************** *** 181,184 **** --- 181,186 ---- MIN_FERROR = 0.010 HOMING_VEL = 0.1 + SETUP_TIME = 1 + HOLD_TIME = 2 HOME_OFFSET = 0.0 ENABLE_POLARITY = 0 *************** *** 232,235 **** --- 234,239 ---- MIN_FERROR = 0.010 HOMING_VEL = 0.1 + SETUP_TIME = 1 + HOLD_TIME = 2 HOME_OFFSET = 0.0 ENABLE_POLARITY = 0 *************** *** 283,286 **** --- 287,292 ---- MIN_FERROR = 0.010 HOMING_VEL = 0.1 + SETUP_TIME = 1 + HOLD_TIME = 2 HOME_OFFSET = 0.0 ENABLE_POLARITY = 0 Index: lukas.ini =================================================================== RCS file: /cvsroot/emc/emc/lukas.ini,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** lukas.ini 19 May 2002 01:02:48 -0000 1.2 --- lukas.ini 21 Jul 2003 02:51:32 -0000 1.3 *************** *** 158,161 **** --- 158,163 ---- MIN_FERROR = 1000.000 HOMING_VEL = 0.1 + SETUP_TIME = 1 + HOLD_TIME = 2 HOME_OFFSET = 0 ENABLE_POLARITY = 0 *************** *** 194,197 **** --- 196,201 ---- MIN_FERROR = 1000.000 HOMING_VEL = 0.1 + SETUP_TIME = 1 + HOLD_TIME = 2 HOME_OFFSET = 0 ENABLE_POLARITY = 0 *************** *** 230,233 **** --- 234,239 ---- MIN_FERROR = 1000.000 HOMING_VEL = 0.1 + SETUP_TIME = 1 + HOLD_TIME = 2 HOME_OFFSET = 0 ENABLE_POLARITY = 0 Index: minitetra.ini =================================================================== RCS file: /cvsroot/emc/emc/minitetra.ini,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** minitetra.ini 7 May 2003 19:49:50 -0000 1.22 --- minitetra.ini 21 Jul 2003 02:51:32 -0000 1.23 *************** *** 167,170 **** --- 167,172 ---- MIN_FERROR = 1.000 HOMING_VEL = 0.1 + SETUP_TIME = 1 + HOLD_TIME = 2 HOME_OFFSET = 0.0 ENABLE_POLARITY = 0 *************** *** 203,206 **** --- 205,210 ---- MIN_FERROR = 1.000 HOMING_VEL = 0.1 + SETUP_TIME = 1 + HOLD_TIME = 2 HOME_OFFSET = 0.0 ENABLE_POLARITY = 0 *************** *** 239,242 **** --- 243,248 ---- MIN_FERROR = 1.000 HOMING_VEL = 0.1 + SETUP_TIME = 1 + HOLD_TIME = 2 HOME_OFFSET = 0.0 ENABLE_POLARITY = 0 *************** *** 275,278 **** --- 281,286 ---- MIN_FERROR = 1.000 HOMING_VEL = 0.1 + SETUP_TIME = 1 + HOLD_TIME = 2 HOME_OFFSET = 0.0 ENABLE_POLARITY = 0 *************** *** 311,314 **** --- 319,324 ---- MIN_FERROR = 1.000 HOMING_VEL = 0.1 + SETUP_TIME = 1 + HOLD_TIME = 2 HOME_OFFSET = 0.0 ENABLE_POLARITY = 0 *************** *** 347,350 **** --- 357,362 ---- MIN_FERROR = 1.000 HOMING_VEL = 0.1 + SETUP_TIME = 1 + HOLD_TIME = 2 HOME_OFFSET = 0.0 ENABLE_POLARITY = 0 Index: rs274ngc_new_sim.ini =================================================================== RCS file: /cvsroot/emc/emc/rs274ngc_new_sim.ini,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** rs274ngc_new_sim.ini 19 May 2002 01:02:48 -0000 1.5 --- rs274ngc_new_sim.ini 21 Jul 2003 02:51:32 -0000 1.6 *************** *** 142,145 **** --- 142,147 ---- MIN_FERROR = 0.100 HOMING_VEL = 0.1 + SETUP_TIME = 1 + HOLD_TIME = 2 HOME_OFFSET = 0.1 ENABLE_POLARITY = 1 *************** *** 193,196 **** --- 195,200 ---- MIN_FERROR = 0.100 HOMING_VEL = 0.1 + SETUP_TIME = 1 + HOLD_TIME = 2 HOME_OFFSET = -0.1 ENABLE_POLARITY = 1 *************** *** 244,247 **** --- 248,253 ---- MIN_FERROR = 0.100 HOMING_VEL = 0.1 + SETUP_TIME = 1 + HOLD_TIME = 2 HOME_OFFSET = 0.0 ENABLE_POLARITY = 1 Index: rtsim.ini =================================================================== RCS file: /cvsroot/emc/emc/rtsim.ini,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** rtsim.ini 19 May 2002 01:02:48 -0000 1.3 --- rtsim.ini 21 Jul 2003 02:51:32 -0000 1.4 *************** *** 140,143 **** --- 140,145 ---- MIN_FERROR = 0.100 HOMING_VEL = 0.1 + SETUP_TIME = 1 + HOLD_TIME = 2 HOME_OFFSET = 0.1 ENABLE_POLARITY = 1 *************** *** 191,194 **** --- 193,198 ---- MIN_FERROR = 0.100 HOMING_VEL = 0.1 + SETUP_TIME = 1 + HOLD_TIME = 2 HOME_OFFSET = -0.1 ENABLE_POLARITY = 1 *************** *** 242,245 **** --- 246,251 ---- MIN_FERROR = 0.100 HOMING_VEL = 0.1 + SETUP_TIME = 1 + HOLD_TIME = 2 HOME_OFFSET = 0.0 ENABLE_POLARITY = 1 Index: sim.ini =================================================================== RCS file: /cvsroot/emc/emc/sim.ini,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** sim.ini 19 May 2002 01:02:48 -0000 1.17 --- sim.ini 21 Jul 2003 02:51:32 -0000 1.18 *************** *** 158,161 **** --- 158,163 ---- MIN_FERROR = 0.100 HOMING_VEL = 0.1 + SETUP_TIME = 1 + HOLD_TIME = 2 HOME_OFFSET = 0.0 ENABLE_POLARITY = 1 *************** *** 209,212 **** --- 211,216 ---- MIN_FERROR = 0.100 HOMING_VEL = 0.1 + SETUP_TIME = 1 + HOLD_TIME = 2 HOME_OFFSET = 0.0 ENABLE_POLARITY = 1 *************** *** 260,263 **** --- 264,269 ---- MIN_FERROR = 0.100 HOMING_VEL = 0.1 + SETUP_TIME = 1 + HOLD_TIME = 2 HOME_OFFSET = 0.0 ENABLE_POLARITY = 1 Index: stepper.ini =================================================================== RCS file: /cvsroot/emc/emc/stepper.ini,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** stepper.ini 7 May 2003 19:49:50 -0000 1.3 --- stepper.ini 21 Jul 2003 02:51:33 -0000 1.4 *************** *** 180,183 **** --- 180,185 ---- MIN_FERROR = 1.000 HOMING_VEL = 0.1 + SETUP_TIME = 1 + HOLD_TIME = 2 HOME_OFFSET = 0.0 ENABLE_POLARITY = 0 *************** *** 217,220 **** --- 219,224 ---- MIN_FERROR = 1.000 HOMING_VEL = 0.1 + SETUP_TIME = 1 + HOLD_TIME = 2 HOME_OFFSET = 0.0 ENABLE_POLARITY = 0 *************** *** 254,257 **** --- 258,263 ---- MIN_FERROR = 1.000 HOMING_VEL = 0.1 + SETUP_TIME = 1 + HOLD_TIME = 2 HOME_OFFSET = 0.0 ENABLE_POLARITY = 0 |
|
From: <ray...@us...> - 2003-07-20 14:30:41
|
Update of /cvsroot/emc/documents/lyx
In directory sc8-pr-cvs1:/tmp/cvs-serv5962
Modified Files:
User_Hardware.lyx
Log Message:
cleanup editing
Index: User_Hardware.lyx
===================================================================
RCS file: /cvsroot/emc/documents/lyx/User_Hardware.lyx,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** User_Hardware.lyx 19 Jul 2003 21:35:13 -0000 1.3
--- User_Hardware.lyx 20 Jul 2003 14:30:38 -0000 1.4
***************
*** 2495,2499 ****
\color black
! \begin_inset LatexCommand \index{MIN_FERROR}
\end_inset
--- 2495,2499 ----
\color black
! \begin_inset LatexCommand \index{MIN FERROR}
\end_inset
***************
*** 2653,2657 ****
Base address for the port used for IO.
You should set this so that it is different from the base address used
! for step and direction signals.
\layout Standard
--- 2653,2659 ----
Base address for the port used for IO.
You should set this so that it is different from the base address used
! for step and direction signals if there is a chance that you want to use
! the bridgeportio and bridgeporttask files rather than the minimillio and
! minimilltask.
\layout Standard
***************
*** 2672,2734 ****
\layout Section
- Configuring EMC
- \layout Subsection
-
Some Ini File Problems That I've Encountered
\layout Standard
! My system
! \layout Standard
!
! Tigerdirect cheapo tower and board - S3 chipset.
!
! \family typewriter
! \size small
!
! \newline
!
! \family default
! \size default
! Cyrix pr300 - 233 actual
! \family typewriter
! \size small
!
! \newline
!
! \family default
! \size default
! 64M ram memory
! \family typewriter
! \size small
!
! \newline
!
! \family default
! \size default
! Mandrake 7.0
! \family typewriter
! \size small
!
! \newline
!
! \family default
! \size default
! Rtlinux-2.0 prepatched (how is a subject that I am writing for handbook)
!
! \layout Standard
!
! emc-05-May-2000.tgz download and install (a problem with emcsh compile)Email
! me for my work arounds on these.
!
! \layout Standard
!
! Throughout this page I will use dark green letters to indicate the lines
! of text that I entered into the console (konsole).
! I will use dark red to indicate the response of the computer to my command.
! Medium red lines are the focus on the discussion. For the sake of brevity,
! I have edited many of the responses of the computer when it was asked to
! compile large numbers of files.
! Some of these lengthy responses are included as files and are linked to
! this document so that you can compare your results.
\layout Standard
--- 2674,2681 ----
\layout Section
Some Ini File Problems That I've Encountered
\layout Standard
! The following is from an EMC list post a couple of years ago by Ray Henry.
\layout Standard
***************
*** 2984,2988 ****
is registered to so I look in the Kmenu under settings / information /
I/O port information / in the popup menus for Mandrake 7.
! Yours may be different! [ part2/images/sysinfo.gif]
\layout Standard
--- 2931,2935 ----
is registered to so I look in the Kmenu under settings / information /
I/O port information / in the popup menus for Mandrake 7.
! Yours may be different!
\layout Standard
***************
*** 2997,3180 ****
\layout Standard
-
- Setting up Stepper Motors (from the nist page)
- \layout Standard
-
- Currently the EMC supports stepper motors with a 2-bit step-and-direction
- interface, with bits mapped to the parallel port.
- Each parallel port has 12 bits of output and 5 bits of input.
- The outputs are used to drive the step and direction of each motor.
- 12 bits of output mean that up to 6 stepper motors can be controlled.
- The inputs can be used to detect limit or home switch trips.
- 5 bits of input mean that only one axes can get full positive, negative,and
- home switch inputs.
- The EMC mapping compromises for 3 axes of stepper motor control, with all
- positive limit switches being mapped to one input, all negative limit switches
- being mapped to another input, and all home switches being mapped to a
- third input.
- Other permutations are possible, of course, and can be changed in the software.
- You could also add 2 additional parallel ports (LPT2, LPT3), and get 36
- bits of output and 15 bits of input.
- Some parallel ports also let you take 4 outputs and use them as inputs,
- for 8 outputs and 9 inputs for each parallel port.
- This would let you get 3 axes of control and full switch input per parallel
- port.
- \layout Comment
-
- See Using the PC parallel port for digital I/O for more information on the
- parallel port.
-
- \layout Standard
-
- The pin-out for the EMC stepper motor interface is as follows:
- \layout Standard
-
-
- \family typewriter
- \size small
- Output\SpecialChar ~
- \SpecialChar ~
- \SpecialChar ~
- \SpecialChar ~
- \SpecialChar ~
- \SpecialChar ~
- \SpecialChar ~
- \SpecialChar ~
- Parallel\SpecialChar ~
- Port
- \newline
- ------\SpecialChar ~
- \SpecialChar ~
- \SpecialChar ~
- \SpecialChar ~
- \SpecialChar ~
- \SpecialChar ~
- \SpecialChar ~
- \SpecialChar ~
- -------------
- \newline
- X\SpecialChar ~
- direction\SpecialChar ~
- \SpecialChar ~
- \SpecialChar ~
- D0,\SpecialChar ~
- pin\SpecialChar ~
- 2
- \newline
- X\SpecialChar ~
- clock\SpecialChar ~
- \SpecialChar ~
- \SpecialChar ~
- \SpecialChar ~
- \SpecialChar ~
- \SpecialChar ~
- \SpecialChar ~
- D1,\SpecialChar ~
- pin\SpecialChar ~
- 3
- \newline
- Y\SpecialChar ~
- direction\SpecialChar ~
- \SpecialChar ~
- \SpecialChar ~
- D2,\SpecialChar ~
- pin\SpecialChar ~
- 4
- \newline
- Y\SpecialChar ~
- clock\SpecialChar ~
- \SpecialChar ~
- \SpecialChar ~
- \SpecialChar ~
- \SpecialChar ~
- \SpecialChar ~
- \SpecialChar ~
- D3,\SpecialChar ~
- pin\SpecialChar ~
- 5
- \newline
- Z\SpecialChar ~
- direction\SpecialChar ~
- \SpecialChar ~
- \SpecialChar ~
- D4,\SpecialChar ~
- pin\SpecialChar ~
- 6
- \newline
- Z\SpecialChar ~
- clock\SpecialChar ~
- \SpecialChar ~
- \SpecialChar ~
- \SpecialChar ~
- \SpecialChar ~
- \SpecialChar ~
- \SpecialChar ~
- D5,\SpecialChar ~
- pin\SpecialChar ~
- 7
- \layout Standard
-
-
- \family typewriter
- \size small
- Input\SpecialChar ~
- \SpecialChar ~
- \SpecialChar ~
- \SpecialChar ~
- \SpecialChar ~
- \SpecialChar ~
- \SpecialChar ~
- \SpecialChar ~
- \SpecialChar ~
- Parallel\SpecialChar ~
- Port
- \newline
- -----\SpecialChar ~
- \SpecialChar ~
- \SpecialChar ~
- \SpecialChar ~
- \SpecialChar ~
- \SpecialChar ~
- \SpecialChar ~
- \SpecialChar ~
- \SpecialChar ~
- -------------
- \newline
- X/Y/Z\SpecialChar ~
- lim\SpecialChar ~
- +\SpecialChar ~
- \SpecialChar ~
- \SpecialChar ~
- S3,\SpecialChar ~
- pin\SpecialChar ~
- 15
- \newline
- X/Y/Z\SpecialChar ~
- lim\SpecialChar ~
- -\SpecialChar ~
- \SpecialChar ~
- \SpecialChar ~
- S4,\SpecialChar ~
- pin\SpecialChar ~
- 13
- \newline
- X/Y/Z\SpecialChar ~
- home\SpecialChar ~
- \SpecialChar ~
- \SpecialChar ~
- \SpecialChar ~
- S5,\SpecialChar ~
- pin\SpecialChar ~
- 12
- \layout Standard
- \pextra_type 2 \pextra_alignment 1 \pextra_widthp 70
-
- Stepper motor control is implemented using a second real-time task that
- runs at 100 microseconds.
- This task writes the parallel port output with bits set or cleared based
- on whether the pulse should be raised or lowered.
- This gives an effective period of 200 microseconds for a full up-and-down
- pulse, or a frequency limited to about 5 kilohertz.
- \layout Standard
\pextra_type 2 \pextra_alignment 1 \pextra_widthp 70
--- 2944,2947 ----
***************
*** 3557,3560 ****
--- 3324,3329 ----
0
\newline
+
+ \series bold
MIN_LIMIT_SWITCH_POLARITY =\SpecialChar ~
\SpecialChar ~
***************
*** 3583,3586 ****
--- 3352,3357 ----
1
\newline
+
+ \series default
HOMING_POLARITY =\SpecialChar ~
\SpecialChar ~
***************
*** 3632,3832 ****
\SpecialChar ~
\SpecialChar ~
! 1
! \newline
! ; Parameters for Inland Motor BMHS-0701 X 20
! \newline
! TORQUE_UNITS =\SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! OZ_IN
! \newline
! ARMATURE_RESISTANCE =\SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! 1.10
! \newline
! ARMATURE_INDUCTANCE =\SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! 0.0120
! \newline
! BACK_EMF_CONSTANT =\SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! 0.0254
! \newline
! ROTOR_INERTIA =\SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! 0.0104
! \newline
! DAMPING_FRICTION_COEFFICIENT =\SpecialChar ~
! \SpecialChar ~
! 0.083
! \newline
! SHAFT_OFFSET =\SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! 0
! \newline
! REVS_PER_UNIT =\SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! 10
! \newline
! ; Parameters for generic amplifier
! \newline
! AMPLIFIER_GAIN =\SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! 1
! \newline
! MAX_OUTPUT_CURRENT =\SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! 10
! \newline
! LOAD_RESISTANCE =\SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! 1
! \newline
! ; parameters for generic encoder
! \newline
! COUNTS_PER_REV =\SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! \SpecialChar ~
! 4096
\layout Standard
--- 3403,3407 ----
\SpecialChar ~
\SpecialChar ~
! 1
\layout Standard
***************
*** 3838,3843 ****
That way it will home as soon as we press the home button.
And it will never hit a hard limit.
! I should caution you that you don't want to run a real machine this way,
! at least not for long.
\layout Standard
--- 3413,3418 ----
That way it will home as soon as we press the home button.
And it will never hit a hard limit.
! I should caution you that you don't want to run a very big real machine
! this way, at least not for long.
\layout Standard
***************
*** 4029,4033 ****
file is trying to tell me, I'll just switch definitions of the I/O system.
I can do this by changing one line.
! [part2/images/ioshow2.gif]
\layout Standard
\align center \pextra_type 2 \pextra_alignment 1 \pextra_hfill 1 \pextra_start_minipage 1 \pextra_widthp 30
--- 3604,3608 ----
file is trying to tell me, I'll just switch definitions of the I/O system.
I can do this by changing one line.
!
\layout Standard
\align center \pextra_type 2 \pextra_alignment 1 \pextra_hfill 1 \pextra_start_minipage 1 \pextra_widthp 30
***************
*** 4201,4212 ****
\layout Standard
! When If you have stepper motors and a stepper motor controller that requires
! phase stepping, then freqmod.o is a solution.
! Phase stepping requires the computer to output the motor phase signals
! directly, the stepper driver is just an amplifier.
! \layout Standard
!
! This procedure version 1.0 John Sheahan 11 September 2001, Developed with
! linux kernel2.2.18 / rtlinux-rtl3.0-6 / :emc-2.07.
Setup of linux/emc is covered elsewhere and must be done first
\layout Standard
--- 3776,3781 ----
\layout Standard
! This procedure version 1.0 was written by John Sheahan 11 September 2001.
! It was developed with linux kernel2.2.18 / rtlinux-rtl3.0-6 / :emc-2.07.
Setup of linux/emc is covered elsewhere and must be done first
\layout Standard
***************
*** 4870,4877 ****
click run and watch it all whir.
then its probably time to connect up more mechanics and test some more.
-
- \layout Standard
-
- John Sheahan
\layout Section
--- 4439,4442 ----
|
|
From: <ray...@us...> - 2003-07-20 13:53:01
|
Update of /cvsroot/emc/documents/lyx
In directory sc8-pr-cvs1:/tmp/cvs-serv31363
Modified Files:
User_Linux.lyx
Log Message:
edit
Index: User_Linux.lyx
===================================================================
RCS file: /cvsroot/emc/documents/lyx/User_Linux.lyx,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** User_Linux.lyx 18 Jul 2003 18:46:07 -0000 1.2
--- User_Linux.lyx 20 Jul 2003 13:52:58 -0000 1.3
***************
*** 61,64 ****
--- 61,69 ----
Login
+ \begin_inset LatexCommand \index{Login}
+
+ \end_inset
+
+
\layout Standard
***************
*** 89,93 ****
\layout LyX-Code
! Password: _
\layout Standard
--- 94,103 ----
\layout LyX-Code
! Password
! \begin_inset LatexCommand \index{Password}
!
! \end_inset
!
! : _
\layout Standard
***************
*** 1175,1179 ****
\layout LyX-Code
! script
\layout Standard
--- 1185,1194 ----
\layout LyX-Code
! script
! \begin_inset LatexCommand \index{script}
!
! \end_inset
!
!
\layout Standard
***************
*** 1182,1186 ****
\layout LyX-Code
! typescript
\layout Standard
--- 1197,1206 ----
\layout LyX-Code
! typescript
! \begin_inset LatexCommand \index{typescript}
!
! \end_inset
!
!
\layout Standard
|
|
From: <ray...@us...> - 2003-07-20 13:49:19
|
Update of /cvsroot/emc/documents/lyx
In directory sc8-pr-cvs1:/tmp/cvs-serv30939
Modified Files:
User_BDI_Install.lyx
Log Message:
fixup a bit
Index: User_BDI_Install.lyx
===================================================================
RCS file: /cvsroot/emc/documents/lyx/User_BDI_Install.lyx,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** User_BDI_Install.lyx 15 Jul 2003 19:11:51 -0000 1.2
--- User_BDI_Install.lyx 20 Jul 2003 13:49:14 -0000 1.3
***************
*** 74,78 ****
\layout Subsection
! BDI 2.xx
\layout Standard
--- 74,83 ----
\layout Subsection
! BDI-2.xx
! \begin_inset LatexCommand \index{BDI-2.xx}
!
! \end_inset
!
!
\layout Standard
***************
*** 103,107 ****
\layout Subsection
! TNG
\layout Standard
--- 108,117 ----
\layout Subsection
! BDI-TNG
! \begin_inset LatexCommand \index{BDI-TNG}
!
! \end_inset
!
!
\layout Standard
***************
*** 121,128 ****
\layout Subsection
! Live
\layout Standard
! The BDI-Live is based on the Morphix distribution of Linux.
This distribution is intended as a way for potential users to test out
the EMC without having to install in on a hard drive.
--- 131,148 ----
\layout Subsection
! BDI-Live
! \begin_inset LatexCommand \index{BDI-Live}
!
! \end_inset
!
!
\layout Standard
! The BDI-Live is based on the Morphix
! \begin_inset LatexCommand \index{Morphix}
!
! \end_inset
!
! distribution of Linux.
This distribution is intended as a way for potential users to test out
the EMC without having to install in on a hard drive.
***************
*** 231,235 ****
\layout Standard
! Checksum is not a complicated thing.
It is defined as,
\layout Quote
--- 251,260 ----
\layout Standard
! Checksum
! \begin_inset LatexCommand \index{Checksum}
!
! \end_inset
!
! is not a complicated thing.
It is defined as,
\layout Quote
***************
*** 348,351 ****
--- 373,439 ----
installing linux.
Buy buy a cheap desktop computer and dedicate that to the CNC.
+ \layout Standard
+
+ (expand to include a listing of all questions that need answers)
+ \layout Section
+
+ Installing the BDI TNG
+ \layout Standard
+
+ (add this section)
+ \layout Section
+
+ Running with the BDI Live
+ \layout Standard
+
+ BDI Live will boot and run an EMC from the CDROM device if your computer
+ will boot from CD.
+ This mode of operation requires not space on a hard drive and does not
+ alter the installation of any other OS on the computer.
+ \layout Standard
+
+ If you wish you may add some directories to the hard drive that will permit
+ you to edit the INI and RUN files and save VAR and TBL values.
+ The addition of these directories to your hard drive do not alter the proper
+ operation of any other OS on that hard drive.
+ \layout Section
+
+ Installing the BDI Live
+ \layout Standard
+
+ There is an install script under the Morphix menu.
+ This will quickly install an image of the CD on the hard drive and will
+ allow you to add Debian packages to your computer.
+ Doing this will remove another OS from the hard drive unless you add another
+ hard drive and set up a dual boot system.
+ \layout Standard
+
+ (add this and include the lilo problems for the early release candidates)
+ \layout Section
+
+ Notes on setting up a graphical environment
+ \layout Standard
+
+ Linux by itself is a text mode operating system.
+ During the installation of a BDI you can choose to set up a graphical system.
+ This will include X-Windows
+ \begin_inset LatexCommand \index{X-Windows}
+
+ \end_inset
+
+ and some sort of window manager.
+ Both the 2.2xx and TNG series have KDE and GNOME window managers.
+ These are complete point and click environments.
+ The Live disk uses a lighter, smaller, less computer intensive window manager,
+ Icewm.
+ \layout Standard
+
+ Live will find most any hardware graphic driver and screen and will do that
+ very accurately.
+ 2.xx will only find older drivers but can handle many different monitors.
+ The TNG will find most newer graphic drivers and monitors.
+ There are combinations that do not work very well during install.
+ For these you can install in text mode and then configure the graphic display
+ after the install is complete.
\layout Subsection
***************
*** 368,371 ****
--- 456,487 ----
+ \layout Standard
+
+ You can also type text when the BDI asks if you are ready to install.
+ This will ask the same questions but will do it in text mode rather than
+ full graphical mode.
+ When the install is finished and your computer reboots, it will start in
+ a terminal.
+ Log in as root and issue the command
+ \begin_inset Quotes eld
+ \end_inset
+
+ setup
+ \begin_inset Quotes erd
+ \end_inset
+
+ and select X Configuration
+ \begin_inset LatexCommand \index{X-Configuration}
+
+ \end_inset
+
+ .
+ The steps here will allow you to set the type of display driver and monitor
+ that you have and test the choices until you find a combination that works
+ for you.
+ \layout Standard
+
+ We've found that the custom, noninterlaced 1024x768 works for a wide range
+ of monitors.
\layout Section
***************
*** 387,398 ****
- \layout Section
-
- Can I print from the BDI linux ?
- \layout Standard
-
- Yes - But to configure the print driver, you will need two files found on
- the Programs page.
- Install control-panel followed by printtool then open up a console window
- and run printtool (you'll need to be root to do this).
\the_end
--- 503,505 ----
|
|
From: <ray...@us...> - 2003-07-20 13:42:29
|
Update of /cvsroot/emc/documents/lyx In directory sc8-pr-cvs1:/tmp/cvs-serv27209 Modified Files: User_Gcode_Computation.lyx Log Message: added RS274NGC quote Index: User_Gcode_Computation.lyx =================================================================== RCS file: /cvsroot/emc/documents/lyx/User_Gcode_Computation.lyx,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** User_Gcode_Computation.lyx 5 Jul 2003 01:44:29 -0000 1.1 --- User_Gcode_Computation.lyx 20 Jul 2003 13:42:26 -0000 1.2 *************** *** 29,32 **** \layout Standard ! (Write this) \the_end --- 29,107 ---- \layout Standard ! (This chapter needs examples) ! \layout Quotation ! ! Expressions and Binary Operations ! \layout Quotation ! ! An expression is a set of characters starting with a left bracket [ and ! ending with a balancing right bracket ]. ! In between the brackets are numbers, parameter values, mathematical operations, ! and other expressions. ! An expression may be evaluated to produce a number. ! The expressions on a line are evaluated when the line is read, before anything ! on the line is executed. ! An example of an expression is [ 1 + acos[0] - [#3 ** [4.0/2]]]. ! ! \layout Quotation ! ! Binary operations appear only inside expressions. ! Nine binary operations are defined. ! There are four basic mathematical operations: addition (+), subtraction ! (-), multiplication (*), and division (/). ! There are three logical operations: non-exclusive or (OR), exclusive or ! (XOR), and logical and (AND). ! The eighth operation is the modulus operation (MOD). ! The ninth operation is the "power" operation (**) of raising the number ! on the left of the operation to the power on the right. ! ! \layout Quotation ! ! The binary operations are divided into three groups. ! The first group is: power. ! The second group is: multiplication, division, and modulus. ! The third group is: addition, subtraction, logical non-exclusive or, logical ! exclusive or, and logical and. ! If operations are strung together (for example in the expression [2.0 / ! 3 * 1.5 - 5.5 / 11.0]), operations in the first group are to be performed ! before operations in the second group and operations in the second group ! before operations in the third group. ! If an expression contains more than one operation from the same group (such ! as the first / and * in the example), the operation on the left is performed ! first. ! Thus, the example is equivalent to: [((2.0 / 3) * 1.5) - (5.5 / 11.0)] , which ! simplifies to [1.0 - 0.5] , which is 0.5. ! ! \layout Quotation ! ! The logical operations and modulus are to be performed on any real numbers, ! not just on integers. ! The number zero is equivalent to logical false, and any non-zero number ! is equivalent to logical true. ! ! \layout Quotation ! ! 3.3.2.4 Unary Operation Value ! \layout Quotation ! ! A unary operation value is either "ATAN" followed by one expression divided ! by another expression (for example "ATAN[2]/[1+3]") or any other unary ! operation name followed by an expression (for example "SIN[90]"). ! The unary operations are: ABS (absolute value), ACOS (arc cosine), ASIN ! (arc sine), ATAN (arc tangent), COS (cosine), EXP (e raised to the given ! power), FIX (round down), FUP (round up), LN (natural logarithm), ROUND ! (round to the nearest whole number), SIN (sine), SQRT (square root), and ! TAN (tangent). ! Arguments to unary operations which take angle measures (COS, SIN, and ! TAN) are in degrees. ! Values returned by unary operations which return angle measures (ACOS, ! ASIN, and ATAN) are also in degrees. ! ! \layout Quotation ! ! The FIX operation rounds towards the left (less positive or more negative) ! on a number line, so that FIX[2.8] =2 and FIX[-2.8] = -3, for example. ! The FUP operation rounds towards the right (more positive or less negative) ! on a number line; FUP[2.8] = 3 and FUP[-2.8] = -2, for example. ! \the_end |
|
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 ---- |