- Posts: 34
- Thank you received: 0
Problem remapping T word
Using the basic stdglue.py file and a remap .ngc file works fine when calling T# from MDI but I can't load a program containing a T word. On loading a .ngc file, I get the following error:
T12 exists in the tool table and can be called from MDI. The problem seems to be in the stdglue.py prepare_prolog function when it searches for the pocket.
Adding a check for self.task as follows works around the issue:
With this change, the .ngc file can be loaded and the program will run fine. Without the check, self.find_tool_pocket returns INTERP_ERROR (5) for status and -1 for the pocket.
I would like to run the check for valid pocket numbers on program load. This is to prevent a program from being loaded that has tools that are not in the changer. Can someone suggest a way this might be done?
This is on version 2.8.1 and happens in both simulation and realtime modes.
Please Log in to join the conversation.
Put some print statements in the prepare_prolog and prepare_epilog to find out what is happening and what line is not working.
Start from terminal to see the output. That should narrow it down.
Are you setting random toolchanger?
Please Log in to join the conversation.
You can always deal with the pocket in M6 remap, as far as I remember the pocket in nonrandom will equal the tool#. so in M6 you can read the tool table and if the selected_tool's pocket_number is greater than 20 you can abort.
Please Log in to join the conversation.
Please Log in to join the conversation.
The problem is with the prepare_prolog code not getting the tool table info during file load.
I would think that the tool table would be loaded/valid when loading a .ngc file. The non-remap T code will error if a tool is not in the tool table when loading a .ngc. The default remap code will not detect this error.
Please Log in to join the conversation.
ZincBoy wrote: self.find_tool_pocket(tool) returns INTERP_ERROR with the -1 pocket. It only does this when loading a .ngc file. From what I can tell, this function searches the tool table and is supposed to return the pocket of the associated tool. It should not matter what is in the spindle.
The problem is with the prepare_prolog code not getting the tool table info during file load.
I would think that the tool table would be loaded/valid when loading a .ngc file. The non-remap T code will error if a tool is not in the tool table when loading a .ngc. The default remap code will not detect this error.
"Note that unless you set the `[EMCIO] RANDOM_TOOLCHANGER=1` parameter,
tool and pocket number are identical, and the pocket number from the
tool table is ignored." so when L cnc starts up, it gets -1 cause Lcnc doesnt save pocket number. Thats how I unsderstand it.
I dont know if this is still valid but I remember this when I was doing remap work on my machines. To me there is no clear documentation on the whole tool/changer remap on how things actually work. I know this has been discussed many times by many people and I still have no understanding of it. I got around it by dealing with everything in the remap code my way. right or wrong, it worked.
Please Log in to join the conversation.
