Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gmoccapy - command.mdi() must be call in mode IDLE only #2524

Closed
zz912 opened this issue Jun 15, 2023 · 1 comment
Closed

Gmoccapy - command.mdi() must be call in mode IDLE only #2524

zz912 opened this issue Jun 15, 2023 · 1 comment

Comments

@zz912
Copy link
Contributor

zz912 commented Jun 15, 2023

This bug may be the cause of this bug:
#2453
But I don't want to deal with this connection now.
I would like to fix this bug only to increase the reliability of Gmoccapy.

Here is the definition of the proper use of self.command.mdi() :
http://linuxcnc.org/docs/2.9/html/config/python-interface.html#_preparing_to_send_commands

Here is a call to self.command.mdi("G43) without checking that the mode is IDLE:

if "G43" in self.active_gcodes and self.stat.task_mode != linuxcnc.MODE_AUTO:
self.command.mode(linuxcnc.MODE_MDI)
self.command.wait_complete()
self.command.mdi("G43")
self.command.wait_complete()

The condition self.stat.task_mode != linuxcnc.MODE_AUTO does not solve the state when the MDI command was started using HALUI.

I could fix it like this:

self.stat.poll()
 if "G43" in self.active_gcodes and self.stat.task_mode != linuxcnc.MODE_AUTO and self.stat.interp_state == linuxcnc.INTERP_IDLE: 
     self.command.mode(linuxcnc.MODE_MDI) 
     self.command.wait_complete() 
     self.command.mdi("G43") 
     self.command.wait_complete() 

The problem is that I don't know why command G43 is called?
If the condition self.stat.interp_state == linuxcnc.INTERP_IDLE is not met, command G43 will not be executed.
Is it necessary to call command G43 then?

@gmoccapy
Copy link
Collaborator

gmoccapy commented Oct 8, 2023

Tool handling is redesigned by ReneDev, that should solve this issue. may also be related to #2613
no work on tool handling, as it will be much better in short time

@gmoccapy gmoccapy closed this as completed Oct 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants