self.command.mdi() - without self.command.wait_complete()
15 Jun 2023 06:22 #273573
by zz912
self.command.mdi() - without self.command.wait_complete() was created by zz912
Hello,
I found:
github.com/LinuxCNC/linuxcnc/blob/67b814...ccapy.py#L4285-L4291
I think self.command.wait_complete() is missing here.
I think it should look like this:
Is it a bug?
Can be self.command.mdi() without self.command.wait_complete()
The same situation is also here:
github.com/LinuxCNC/linuxcnc/blob/67b814...ccapy.py#L4324-L4331
github.com/LinuxCNC/linuxcnc/blob/67b814...ccapy.py#L4342-L4346
github.com/LinuxCNC/linuxcnc/blob/67b814...ccapy.py#L4404-L4410
Maybe here:
github.com/LinuxCNC/linuxcnc/blob/67b814...ccapy.py#L3010-L3018
github.com/LinuxCNC/linuxcnc/blob/67b814...ccapy.py#L4960-L4964
github.com/LinuxCNC/linuxcnc/blob/67b814...py/gmoccapy.py#L4987
I found:
github.com/LinuxCNC/linuxcnc/blob/67b814...ccapy.py#L4285-L4291
def on_btn_zero_g92_clicked(self, widget, data=None):
self.command.mode(linuxcnc.MODE_MDI)
self.command.wait_complete()
self.command.mdi("G92.1")
self.command.mode(linuxcnc.MODE_MANUAL)
self.command.wait_complete()
self.widgets.btn_touch.emit("clicked")
I think self.command.wait_complete() is missing here.
I think it should look like this:
def on_btn_zero_g92_clicked(self, widget, data=None):
self.command.mode(linuxcnc.MODE_MDI)
self.command.wait_complete()
self.command.mdi("G92.1")
self.command.wait_complete()
self.command.mode(linuxcnc.MODE_MANUAL)
self.command.wait_complete()
self.widgets.btn_touch.emit("clicked")
Is it a bug?
Can be self.command.mdi() without self.command.wait_complete()
The same situation is also here:
github.com/LinuxCNC/linuxcnc/blob/67b814...ccapy.py#L4324-L4331
github.com/LinuxCNC/linuxcnc/blob/67b814...ccapy.py#L4342-L4346
github.com/LinuxCNC/linuxcnc/blob/67b814...ccapy.py#L4404-L4410
Maybe here:
github.com/LinuxCNC/linuxcnc/blob/67b814...ccapy.py#L3010-L3018
github.com/LinuxCNC/linuxcnc/blob/67b814...ccapy.py#L4960-L4964
github.com/LinuxCNC/linuxcnc/blob/67b814...py/gmoccapy.py#L4987
Please Log in or Create an account to join the conversation.
15 Jun 2023 06:30 #273575
by rodw
Replied by rodw on topic self.command.mdi() - without self.command.wait_complete()
I don't think its an issue but I don't know the Python interface.
to my knowledge, Gcodes are buffered so it makes sese to me to only wait after the last gcode command (eg wait for the buffer to empty).
to my knowledge, Gcodes are buffered so it makes sese to me to only wait after the last gcode command (eg wait for the buffer to empty).
The following user(s) said Thank You: zz912
Please Log in or Create an account to join the conversation.
15 Jun 2023 06:49 #273576
by zz912
Replied by zz912 on topic self.command.mdi() - without self.command.wait_complete()
For example here, it is written as I think it is correct.
github.com/LinuxCNC/linuxcnc/blob/67b814...ccapy.py#L4933-L4942
github.com/LinuxCNC/linuxcnc/blob/67b814...ccapy.py#L4933-L4942
Please Log in or Create an account to join the conversation.
15 Jun 2023 07:14 #273578
by zz912
In this case:
github.com/LinuxCNC/linuxcnc/blob/67b814...ccapy.py#L4285-L4291
github.com/LinuxCNC/linuxcnc/blob/67b814...ccapy.py#L4324-L4331
github.com/LinuxCNC/linuxcnc/blob/67b814...ccapy.py#L4342-L4346
github.com/LinuxCNC/linuxcnc/blob/67b814...ccapy.py#L4404-L4410
After self.command.mdi() is immidietaly change mode from MDI mode.
In this case:
github.com/LinuxCNC/linuxcnc/blob/67b814...ccapy.py#L3010-L3018
github.com/LinuxCNC/linuxcnc/blob/67b814...ccapy.py#L4960-L4964
github.com/LinuxCNC/linuxcnc/blob/67b814...py/gmoccapy.py#L4987
After self.command.mdi() could be change mode from MDI mode. I don't know what will happen next.
Here:
linuxcnc.org/docs/2.9/html/config/python...ing_to_send_commands
is written: "the mode is set to MDI mode"
I am currently working on this bug:
github.com/LinuxCNC/linuxcnc/issues/2453
I don't think the bug will be fixed by fixing these cases, but it might prevent similar problems in the future.
Replied by zz912 on topic self.command.mdi() - without self.command.wait_complete()
Waiting for buffer to empty is very important. I think.I don't think its an issue but I don't know the Python interface.
to my knowledge, Gcodes are buffered so it makes sese to me to only wait after the last gcode command (eg wait for the buffer to empty).
In this case:
github.com/LinuxCNC/linuxcnc/blob/67b814...ccapy.py#L4285-L4291
github.com/LinuxCNC/linuxcnc/blob/67b814...ccapy.py#L4324-L4331
github.com/LinuxCNC/linuxcnc/blob/67b814...ccapy.py#L4342-L4346
github.com/LinuxCNC/linuxcnc/blob/67b814...ccapy.py#L4404-L4410
After self.command.mdi() is immidietaly change mode from MDI mode.
In this case:
github.com/LinuxCNC/linuxcnc/blob/67b814...ccapy.py#L3010-L3018
github.com/LinuxCNC/linuxcnc/blob/67b814...ccapy.py#L4960-L4964
github.com/LinuxCNC/linuxcnc/blob/67b814...py/gmoccapy.py#L4987
After self.command.mdi() could be change mode from MDI mode. I don't know what will happen next.
Here:
linuxcnc.org/docs/2.9/html/config/python...ing_to_send_commands
is written: "the mode is set to MDI mode"
I am currently working on this bug:
github.com/LinuxCNC/linuxcnc/issues/2453
I don't think the bug will be fixed by fixing these cases, but it might prevent similar problems in the future.
Please Log in or Create an account to join the conversation.
16 Jun 2023 05:21 #273678
by newbynobi
Replied by newbynobi on topic self.command.mdi() - without self.command.wait_complete()
I have played in the past a lot with the command_wait_complete, and found that it had no effect to the GUI reactions, but that was in gmoccapy 1
So it might be worse to try with the actual code to add in all the mentioned cases the complete command.
If you have done that, just do make and please report back!
Norbert
So it might be worse to try with the actual code to add in all the mentioned cases the complete command.
If you have done that, just do make and please report back!
Norbert
The following user(s) said Thank You: zz912
Please Log in or Create an account to join the conversation.
16 Jun 2023 06:07 #273682
by cmorley
Replied by cmorley on topic self.command.mdi() - without self.command.wait_complete()
adding wait_complete before switching back to manual sounds right to me. Not doing it looks like a race condition to me.
Also I vaguely remember having a problem if I requested a mode that linuxcnc was already in.
It would cause odd problems that I now can't remember the details of.
I copied a function (from gladevcp) to checks the current mode and only changes it if required (and it waits for it to complete)
Also I vaguely remember having a problem if I requested a mode that linuxcnc was already in.
It would cause odd problems that I now can't remember the details of.
I copied a function (from gladevcp) to checks the current mode and only changes it if required (and it waits for it to complete)
The following user(s) said Thank You: zz912
Please Log in or Create an account to join the conversation.
16 Jun 2023 06:21 #273684
by zz912
Replied by zz912 on topic self.command.mdi() - without self.command.wait_complete()
Thanks for the responses. I will complete the commands and give feedback.
Please Log in or Create an account to join the conversation.
18 Jun 2023 12:50 #273776
by zz912
Replied by zz912 on topic self.command.mdi() - without self.command.wait_complete()
Hello,
I wanted to start experimenting with the self.command.wait_complete() function
I wanted to use the cooling button.
I added the following lines to the source code:
self.command.mode(linuxcnc.MODE_MDI)
self.command.wait_complete()
self.command.mdi("G91 G1 X5 F10")
self.command.wait_complete()
self.command.mode(linuxcnc.MODE_MANUAL)
self.command.wait_complete()
Unfortunately, it doesn't behave at all as I would imagine. Does anyone know why?
I wanted to start experimenting with the self.command.wait_complete() function
I wanted to use the cooling button.
I added the following lines to the source code:
self.command.mode(linuxcnc.MODE_MDI)
self.command.wait_complete()
self.command.mdi("G91 G1 X5 F10")
self.command.wait_complete()
self.command.mode(linuxcnc.MODE_MANUAL)
self.command.wait_complete()
Unfortunately, it doesn't behave at all as I would imagine. Does anyone know why?
Attachments:
Please Log in or Create an account to join the conversation.
18 Jun 2023 18:29 - 18 Jun 2023 18:31 #273795
by zz912
Replied by zz912 on topic self.command.mdi() - without self.command.wait_complete()
I solved it.
self.command.wait_complete() has time limit.
Sorry for the spam.
On the other hand, if self.command.wait_complete() times out, a warning message could be issued.
self.command.wait_complete() has time limit.
Sorry for the spam.
On the other hand, if self.command.wait_complete() times out, a warning message could be issued.
Last edit: 18 Jun 2023 18:31 by zz912.
Please Log in or Create an account to join the conversation.
18 Jun 2023 18:41 #273797
by Aciera
Replied by Aciera on topic self.command.mdi() - without self.command.wait_complete()
So, how much is the default time delay and can we adjust the time delay?
Please Log in or Create an account to join the conversation.
Time to create page: 0.129 seconds