Extend linuxcnc with G65 Pxxx to emulate renishaw macros (python)
29 Dec 2017 09:41 #103816
by perra_e
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
Python script
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.
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
REMAP=G65 modalgroup=1 argspec=xyzpqrstuf python=g65tst
Python script
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.
Please Log in or Create an account to join the conversation.
30 Dec 2017 20:52 #103872
by mataf01
Replied by mataf01 on topic Extend linuxcnc with G65 Pxxx to emulate renishaw macros (python)
Hello,
Wahouuu it would be great if we could use the probe tools of fusion 360 in linuxcnc.
Unfortunately I can't help you as its way over my knowledges, but you have all my moral support.
Please qualified members reading this, Help him.
Patrick
Wahouuu it would be great if we could use the probe tools of fusion 360 in linuxcnc.
Unfortunately I can't help you as its way over my knowledges, but you have all my moral support.
Please qualified members reading this, Help him.
Patrick
Please Log in or Create an account to join the conversation.
02 Jan 2018 12:08 #103950
by perra_e
Replied by perra_e on topic Extend linuxcnc with G65 Pxxx to emulate renishaw macros (python)
I think I Will have a new approach and do all the work in the postprocessor.
I dont have so much time for this now in the beginning of the year, but I Will post here when I have somthing usefull.
—Per
I dont have so much time for this now in the beginning of the year, but I Will post here when I have somthing usefull.
—Per
Please Log in or Create an account to join the conversation.
02 Jan 2018 12:23 #103951
by tecno
Replied by tecno on topic Extend linuxcnc with G65 Pxxx to emulate renishaw macros (python)
Very interesting Per.
God fortsättning
God fortsättning
Please Log in or Create an account to join the conversation.
12 Jan 2018 17:26 #104350
by andypugh
(I would have replied sooner to this, but I am a long way behind as I have been away from my workshop since before christmas, and it doesn't look like I will be back until mid february.
Anyway, you can use the "canon" interface to set parameters, but pretty much only from inside a remap, not from externally loaded code.
This code (part of the remap "stdglue" sets (and creates) some parameters.
github.com/LinuxCNC/linuxcnc/blob/master...n-stdglue/stdglue.py
Replied by andypugh on topic Extend linuxcnc with G65 Pxxx to emulate renishaw macros (python)
I don't know how to get the global parameters to be updated within a pyton script.
(I would have replied sooner to this, but I am a long way behind as I have been away from my workshop since before christmas, and it doesn't look like I will be back until mid february.
Anyway, you can use the "canon" interface to set parameters, but pretty much only from inside a remap, not from externally loaded code.
This code (part of the remap "stdglue" sets (and creates) some parameters.
github.com/LinuxCNC/linuxcnc/blob/master...n-stdglue/stdglue.py
Please Log in or Create an account to join the conversation.
Time to create page: 0.155 seconds