From: Jeff E. <gi...@gi...> - 2010-10-29 19:42:55
|
Fix current tool information after reloading table The earlier "fix" c57f2d2 was busted from the start. On a nonrandom system, realod_tool_number() always called load_tool(0) which unloaded the current tool! Machines with random toolchangers never had this class of bug. For nonrandom systems, unless you start with pocket 1 (not 0) when searching for the pocket that contains the desired tool you will always unload the loaded tool instead of updating the status buffer with new tool information, because you'll *always* find the current tool in pocket 0. http://git.linuxcnc.org/?p=emc2.git;a=commitdiff;h=a317d61 --- src/emc/iotask/ioControl.cc | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/src/emc/iotask/ioControl.cc b/src/emc/iotask/ioControl.cc index 1fbb899..6815513 100644 --- a/src/emc/iotask/ioControl.cc +++ b/src/emc/iotask/ioControl.cc @@ -620,7 +620,8 @@ void load_tool(int pocket) { } void reload_tool_number(int toolno) { - for(int i=0; i<CANON_POCKETS_MAX; i++) { + if(random_toolchanger) return; // doesn't need special handling here + for(int i=1; i<CANON_POCKETS_MAX; i++) { if(emcioStatus.tool.toolTable[i].toolno == toolno) { load_tool(i); break; |