- Posts: 447
- Thank you received: 0
Setting machine mode back to manual in gcode/subroutine
2 years 9 months ago #289807
by Mecanix
Setting machine mode back to manual in gcode/subroutine was created by Mecanix
Hi, I'm having my MPG disabled after running a subroutine, that sub is called from a self.c.mdi(command).
When the subroutine is completed, the keyboard's jog keys works fine however the MPG is disabled.
Only way to re enable the MPG is to hit a keyboard jog arrow.
Problem is I never use a keyboard to jog, MPG only.
Tried #<_hal(halui.mode.manual> = 1 among several other ways, but nothing works.
What's the voodoo?
When the subroutine is completed, the keyboard's jog keys works fine however the MPG is disabled.
Only way to re enable the MPG is to hit a keyboard jog arrow.
Problem is I never use a keyboard to jog, MPG only.
Tried #<_hal(halui.mode.manual> = 1 among several other ways, but nothing works.
What's the voodoo?
Please Log in to join the conversation.
2 years 9 months ago #289814
by Mecanix
Replied by Mecanix on topic Setting machine mode back to manual in gcode/subroutine
[SOLVED]
Ofc it had to be voodoo'ed...
Ofc it had to be voodoo'ed...
Code:
def mdi_command(self, command, wait=True):
self.c.mode(linuxcnc.MODE_MDI)
self.c.wait_complete()
self.c.mdi(command)
if wait:
self.s.poll()
while (self.s.interp_state != linuxcnc.INTERP_IDLE):
time.sleep(.1)
self.s.poll()
self.c.mode(linuxcnc.MODE_MANUAL)
Code:
mdi_command(self, "O <mea_z_neg> call", wait=True)
Please Log in to join the conversation.
Time to create page: 0.078 seconds
