i'm working on an an extention to emulate some of renishaws probing macros.
I have made a post processor for Fusion360 that generates these macros for probing from fusion and I think it could be a nice feature for linuxcnc. But I have some trouble. I don't know how to get the global parameters to be updated within a pyton script.
Axis are moving as they should but no global parameters are updated.
I have made this very short test program.
Ini-file
Code:
REMAP=G65 modalgroup=1 argspec=xyzpqrstuf python=g65tst
Python script
Code:
from interpreter import INTERP_OK
from emccanon import MESSAGE
import sys
import linuxcnc
stat = linuxcnc.stat()
command = linuxcnc.command()
error = linuxcnc.error_channel()
def g65tst(self, **words):
cmd = "G0 X20"
self.execute(cmd)
stat.poll()
value = float(self.params[5420])
MESSAGE("after G0 x=%.4f"%value)
cmd = "G38.2 X22 F30"
self.execute(cmd)
stat.poll()
value = float(self.params[5461])
MESSAGE("after G38.2 x=%.4f"%value)
When I run a G65 from a program or from MDI when I have a strat pos for X=33 the messages are:
"after G0 x=33"
"after G38.2 x=0"
I have tried with stat.probed_position[0] and stat.current_x, but it is the same result.