Extend linuxcnc with G65 Pxxx to emulate renishaw macros (python)

More
8 years 10 months ago #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
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.

Please Log in to join the conversation.

More
8 years 10 months ago #103872 by mataf01
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

Please Log in to join the conversation.

More
8 years 9 months ago #103950 by perra_e
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

Please Log in to join the conversation.

More
8 years 9 months ago #103951 by tecno
Very interesting Per.

God fortsättning

Please Log in to join the conversation.

More
8 years 9 months ago #104350 by andypugh

perra_e wrote: 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 to join the conversation.

Time to create page: 0.151 seconds
Powered by Kunena Forum