Open TurBoss opened 2 months ago
Python time.sleep() is a blocking call and all processing stops until it times out.
time.sleep(secs)
Suspend execution of the calling thread for the given number of seconds.
The argument may be a floating point number to indicate a more precise sleep time.
If the sleep is interrupted by a signal and no exception is raised by the signal handler,
the sleep is restarted with a recomputed timeout.
The suspension time may be longer than requested by an arbitrary amount,
because of the scheduling of other activity in the system.
But this python context is gcode(motion controller), the GUI should no be affected.as it's a different python Interpreter. Something sounds not right. Is there any other info you can give?
what GUI are you using?
Thanks Chris, I didn't know that the gcode was executed with a different python instance.
Well I may he miss understanding. I don't see in thr docs where an oword sub can be made in python.
And I just looked as well and could not find anything about an oword sub in python. AFAIK only M100-199 can be in a programming language.
Running Axis sim and creating the file and running the oword command I get:
EOF in file:usr/share/axis/images/axis.ngc
seeking o-word: o
Well, you probably can run Python as an O-word sub, but it's not well documented.
This works as a subroutine....
O<pytest> SUB
;py,import sys
;py,print(sys.version)
O<pytest> ENDSUB
M2
hello,
thanks for your responses
calling python from gcode sub also has the same issue
o<pytest> sub
;py,import time
;py,time.sleep(10)
o<pytest> endsub
o<pytest> call
while this works
o<sleep> sub
G1 x1 F10
G4 P10
G1 x2 F10
o<sleep> endsub
o<sleep> call
this seems to be a very obscure and unsafe feature.
o<pytest> sub
;py,while True: pass
o<pytest> endsub
o<pytest> call
I suspect the GUIs block at status update (ngc-interpreter is occupied in python and doesn't answer).
Hello
python OWORD freezes UI
Here are the steps I follow to reproduce the issue:
This was tested on axis
oword.py
file with this contento<test_sleep> call [10]
This is what I expected to happen:
The UI to begin responsive while OWORD is waiting
This is what happened instead:
The UI gets stuck until sleep ends and is not possible to interact with any element
I`m not sure if this is an issue or its normal
Thanks