Hi,
after some efforts I finallized my script. In the simulation it works fine, but not at the real machine ;(
here is the relevant code from my script:
Code:
origin = self.inifile.find("AXIS_2", "MIN_LIMIT")
# calculate absolute position from blockheight
a = self.probed_position_with_offsets()
blockheight = a[2]
probeheight = self.prefs.getpref("probeheight", 0, float)
origin = float(origin) + blockheight
self.prefs.putpref("blockheight", blockheight, float)
self.prefs.putpref("probeheight", probeheight, float)
# set koordinate system to new origin
self.command.mode( linuxcnc.MODE_MDI )
self.command.wait_complete()
self.command.mdi( "G10 L2 P0 Z%s" % origin )
self.command.mode( linuxcnc.MODE_MANUAL )
self.command.wait_complete()
When I Set the blockheight with this Code, all the G54 Codes seems to be set right. In the Simulation oll the calculations are ok. If I move to the real machine the code is working well for measuring and setting blockheight.
But when I start my Testprogramm with the autotoolchager, the tool compensation is not working and the tool is not stopping at the correct height (it's going to much lower z values)
If I just set the Blockheight manually, the testprogramm works fine.
It seems to me that nothing is "saved" when I use my script.
Any Ideas?
Matthias