> -----Original Message-----
> From: Andy Pugh [mailto:[email protected]]
> Sent: December 6, 2025 1:35 PM
> To: Enhanced Machine Controller
> Cc: Enhanced Machine Controller
> Subject: Re: [Emc-users] Accessing python hal valriables.
>
>
>
> > On 6 Dec 2025, at 19:31, John Dammeyer <[email protected]>
> wrote:
> >
> > How do I access from workpiece_measurement.py the
> > variable:
>
> One way would be to create a HAL pin and set the value in that part of the
> code.
> But �print� might be enough if you start LinuxCNC from the command line.
>
> _______________________________________________
Thanks Andy,
I always have it starting from the command line so I can look at the output for
other issues. Here's the print statement I added to the python program
# move X + 2 edge_length + 2 xy_clearance
tmpx = 2 * (self.halcomp["ps_edge_length"] +
self.halcomp["ps_xy_clearance"])
s = """G91
G1 X%f
G90""" % (
tmpx
)
print s
Oddly it showed up on the console like this:
G91
G1 X2.400000
G90
And the probe only moved 3/4 of the way across the part then went down and
faulted due to touching the work before the move completed. It has to have
taken the G91 correctly or the X2.4 would be 2.4" across from the rough center
of the part.
Yet if I jog back to that starting position and enter this into the MDI command
line
G91
G1 X2.4
G90
It moves all the way across the part to the position where it should go down.
So the distance is correct and the machine is left in G91 mode when the probe
faults the move.
Any ideas?
Thanks
John
_______________________________________________
Emc-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-users