what's wrong with my tooltable?

More
03 Dec 2019 10:17 #151830 by andypugh
My guess... This is a locale setting problem. I am speculating that with a name like "Reinhard" you are in mainland Europe?

11.811023622047244 is being parsed (probably by Python) with the "." as a thousands separator rather than a decimal point.
One flaw with this explanation is that the numbers should be E16 with the number of decimal places output.

Incidentally, the tool table units are expected to be the base units of the configuration. LinuxCNC is internally all-metric. Except for the Axis GUI, which is internally Imperial...

Please Log in or Create an account to join the conversation.

More
03 Dec 2019 13:15 #151854 by Reinhard
Hi Andy,
.

My guess ...

You're right for sure :)
.

11.811023622047244 is being parsed (probably by Python) with the "." as a thousands separator rather than a decimal point.

Well I thought similar and therefore I wanted to know it for sure and started a little research.

First I searched for the command I issue for reload EMC_TOOL_LOAD_TOOL_TABLE
and found these positive triggers:
src/emc/task/emctaskmain.cc
src/emc/nml_intf/emc.cc
src/emc/usr_intf/shcom.cc
src/emc/iotask/ioControl.cc
src/emc/iotask/ioControl_v2.cc
Then I started to look at each hit for the usage of the keyword.
src/emc/task/emctaskmain.cc:        case EMC_TOOL_LOAD_TOOL_TABLE_TYPE:
   load_tool_table_msg = (EMC_TOOL_LOAD_TOOL_TABLE *) cmd;
   retval = emcToolLoadToolTable(load_tool_table_msg->file);
... search for emcToolLoadToolTable ...
emcToolLoadToolTable -> iotaskinf.cc
        ... sendCommand( ... )
Ah - send command - not of interest for incomming command processing.

Next hit was src/emc/nml_intf/emc.cc, which is internal stuff like update only. Not of interest too.
src/emc/usr_intf/shcom.cc results in a sendCommand too and for so not of interest.

src/emc/iotask/ioControl.cc is indentical to src/emc/iotask/ioControl_v2.cc respect to keyword usage and finally is the only place of interest:
case EMC_TOOL_LOAD_TOOL_TABLE_TYPE:
    loadToolTable( ... )
        reload_tool_number( ... )
loadToolTable() is found in emc/rs274ngc/tool_parse.cc and that was the code, I extracted for debugging purpose.
The number scanning is straight forward plain C (without any python influences) and looks like this
case 'Z':
    if (sscanf(&token[1], "%lf", &offset.tran.z) != 1)
       valid = 0;
    break;
AFAIK sscanf does not care about active LOCALE settings and uses LOCALE "C" - always and everytime, so I can't imagine, that sscanf has different behaviour on the same machine/pc.

Remember: on my tests I used the loadToolTable function from linuxcnc unchanged in a standalone app, where I parsed the same file (which I overwrite from my app and ask the linuxcnc-backend to reparse) again and again.
So three or if you like four parties parsed the same file.
Axis on opening tooltable showed the right values, therefore I guess, that axis parses the file itself without reading the status area for tooltable.

So the wrong number handling happens between reading tooltable file and writing the values to shared memory.

I thought: may be the reloading of tooltable is broken, but when I overwrite my generated tooltable (which leads to wrong Z-values) with the original tooltable from axis, Z-values from linuxcnc backend are correct.
.

Incidentally, the tool table units are expected to be the base units of the configuration.

Well - that is the best way!
.

LinuxCNC is internally all-metric. Except for the Axis GUI, which is internally Imperial...

Is this related to the ini-files - or does this means, that axis GUI uses a different backend than all other screens?

Please Log in or Create an account to join the conversation.

More
03 Dec 2019 13:30 #151857 by andypugh
So, Axis gets the right numbers?
What doesn't get the right numbers?

Places that you can see the tool offsets are
Active GUI
G-code numbered parameter (MDI the command "(DEBUG, #5403)")
HAL pins, in the terminal "halcmd show pin halui.tool.length−offset.z"
The Python interface:
python
import linuxcnc
s = linuxcnc.stat()
s.poll()
print s.tool_offset()
print s.tool_offset
print s.tool_table()
print s.tool_table
exit()
(Note how I am hedging my bets by having both bracketed and non-bracketed versions :-)

Please Log in or Create an account to join the conversation.

More
03 Dec 2019 13:50 #151861 by Reinhard

So, Axis gets the right numbers?

Brrrh - keep calm! :)

When you open tooltable from file-menu from main menu of axis gui, the toolmanager then shows the right values.
My guess was, that axis gui parses the tooltable file itself, without caring about the values from backend.
... and my guess seems to be right.
.

MDI the command "(DEBUG, #5403)"

OK, didn't know that.
A quick shot resulted in 0.00...
So backend has no Z-value and axis has read the values from file itself. QED :)
.

halcmd show pin halui.tool.length−offset.z

That did not show anything beside the headline
.

python

Sorry - but I don't like to bother with python any more

Please Log in or Create an account to join the conversation.

More
03 Dec 2019 13:59 #151863 by andypugh
#5403 will be zero until a tool is loaded and G43 is issued.

Please Log in or Create an account to join the conversation.

More
03 Dec 2019 14:03 #151865 by cmorley
AXIS doesn't read the tool file directly. It uses the python linuxcnc module which uses NML (it's written in C++)

It's probably why Andy suggested checking with python.

Please Log in or Create an account to join the conversation.

More
03 Dec 2019 14:44 #151874 by Reinhard
Hi Chris,

I know the function "Stat_tool_table" from emcmodule.cc, but I don't believe, that when axis reads the same source than I, that it can lead to different result.
That's why I suspected, that the toolmanager from axis reads the tooltable file directly - and it looks that other screens do it the same way ...

I wanted to check out other screens, but I did not found any other screen that is usable at first sight.
It's tedious to start an old debian, try different screens and find out, that none of them is usable ...

Currently my app is broken, so I can't continue research. Have to fix it first.

Please Log in or Create an account to join the conversation.

More
03 Dec 2019 15:19 #151879 by cmorley
What are you calling AXIS tool manager?
Looking at AXIS's source I can see where AXIS reads for tool info.

Gscreen, Gmoccapy, and Qtvcp use a widget to read the var file for tools other then the current tool - but the current tool offsets are still read from linuxcnc's Stat...

It would be helpful if you tried or answered the questions or suggestions that Andy and I suggested.

Oh I tried to run your app but it couldn't find something;
Error: Could not find or load main class de.schwarzrot.app.LinuxCNCClient
and I assumed default-jre is the right java...

Chris

Please Log in or Create an account to join the conversation.

More
03 Dec 2019 15:37 #151882 by Reinhard

What are you calling AXIS tool manager?

Well, from axis main menue: file -> tooltable (or the 4th entry from bottom counted)
.

- but the current tool offsets are still read from linuxcnc's Stat...

Sorry Chris, but I NEVER talked about current tool offsets.
.

It would be helpful if you tried or answered the questions or suggestions that Andy and I suggested.

Well, that's what I try to do. Always.
But may be I don't find the right words to describe what I mean - so sorry for any annoyance that I caused!
.

Oh I tried to run your app but it couldn't find something;

Ok, I assume, you followed the readme ...
Is there another way to communicate?
This forum has no private messages and I can't edit the email in profile. Can you see the email I used to register? If so, can you write me a mail?

Please Log in or Create an account to join the conversation.

More
03 Dec 2019 16:08 #151884 by Reinhard

Error: Could not find or load main class de.schwarzrot.app.LinuxCNCClient

look at the starterscript - second source line is the directory, where you extracted the archive (UI_BaseDir).
May be you have to adjust the path?

Please Log in or Create an account to join the conversation.

Time to create page: 0.089 seconds
Powered by Kunena Forum