On Thu, May 24, 2018 at 8:01 AM, andy pugh <[email protected]> wrote:
> On 24 May 2018 at 13:42, Kenneth Lerman <[email protected]> wrote: > > > Someone should just update the code to accept 999 tools in the table. (Or > > maybe 9999.) > > The limit is set by the NML message size, rather than a conventional > memory limit, as far as I know. > > -- > atp > > I've had success with changing three lines of code and adding more entries to tool.tbl. I had been running with 256 tools for years and recently bumped it to 1000 tools. I don't run Axis so I don't know if this will play well with it. Beware: I found an array overrun in src/emc/rs274ngc/tool_parse.cc. If you have more than about 27 more entries in tool.tbl than CANON_POCKETS_MAX then io will segfault. Subject: [PATCH] Fixed silent segfault in 'io' from loadToolTable() in tool_parse.cc if more than 284 entries in tool.tbl with CANON_POCKETS_MAX set to 257. @@ -257,12 +258,16 @@ int loadToolTable(const char *filename, if (ttcomments && comment) strcpy(ttcomments[pocket], comment); + + if (!random_toolchanger && toolTable[0].toolno == toolTable[pocket].toolno) { + toolTable[0] = toolTable[pocket]; + } + } else { fprintf(stderr, "Unrecognized line skipped: %s", orig_line); } - if (!random_toolchanger && toolTable[0].toolno == toolTable[pocket].toolno) { - toolTable[0] = toolTable[pocket]; - } + + Change CANON_POCKETS_MAX in emctool.h and enlarge the buffer sizes of emcStatus and toolSts in linuxcnc.nml. --- configs/common/linuxcnc.nml | 4 ++-- src/emc/nml_intf/emctool.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/configs/common/linuxcnc.nml b/configs/common/linuxcnc.nml index 5f5bcd1..2ffa120 100644 --- a/configs/common/linuxcnc.nml +++ b/configs/common/linuxcnc.nml @@ -7,12 +7,12 @@ # Top-level buffers to EMC B emcCommand SHMEM localhost 8192 0 0 1 16 1001 TCP=5005 xdr -B emcStatus SHMEM localhost 35840 0 0 2 16 1002 TCP=5005 xdr +B emcStatus SHMEM localhost 131072 0 0 2 16 1002 TCP=5005 xdr B emcError SHMEM localhost 8192 0 0 3 16 1003 TCP=5005 xdr queue # These are for the IO controller, EMCIO B toolCmd SHMEM localhost 1024 0 0 4 16 1004 TCP=5005 xdr -B toolSts SHMEM localhost 36792 0 0 5 16 1005 TCP=5005 xdr +B toolSts SHMEM localhost 131072 0 0 5 16 1005 TCP=5005 xdr # Processes # Name Buffer Type Host Ops server? timeout master? cnum diff --git a/src/emc/nml_intf/emctool.h b/src/emc/nml_intf/emctool.h index d06b935..cd8a00c 100644 --- a/src/emc/nml_intf/emctool.h +++ b/src/emc/nml_intf/emctool.h @@ -20,7 +20,7 @@ #include "emcpos.h" /* Tools are numbered 1..CANON_TOOL_MAX, with tool 0 meaning no tool. */ -#define CANON_POCKETS_MAX 257 // max size of carousel handled +#define CANON_POCKETS_MAX 1001 // max size of carousel handled #define CANON_TOOL_ENTRY_LEN 256 // how long each file line can be struct CANON_TOOL_TABLE { -- 2.10.5 ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Emc-developers mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/emc-developers
