- GCode and Part Programs
- O Codes (subroutines) and NGCGUI
- executing subroutines even during import of GCODE file
executing subroutines even during import of GCODE file
- filipkochan
- Offline
- New Member
-
Less
More
- Posts: 1
- Thank you received: 0
12 Apr 2025 17:56 #326183
by filipkochan
executing subroutines even during import of GCODE file was created by filipkochan
Hello.
In my program, I use a custom subroutine where I wait for some input value to turn 1 and then continue. When I import the g code (with this function), LinuxCNC hangs and I have to kill it from terminal. Even with a simple function
o<myfunc> sub
#1 = 0
o150 while [#1 le 0]
o150 endwhile
o<myfunc> endsub
M2
and a minimal program
o<myfunc> call
M2
the import of the program hangs. As soon as I change "[#1 le 0]" to "[#1 lt 0]", it imports correctly. So my question is: does LinuxCNC execute all the subroutines even during importing of program? And since the change of value I am waiting for will never occur during import of program, what could I do? How to prevent linuxcnc from infinitely waiting in the while cycle?
In my program, I use a custom subroutine where I wait for some input value to turn 1 and then continue. When I import the g code (with this function), LinuxCNC hangs and I have to kill it from terminal. Even with a simple function
o<myfunc> sub
#1 = 0
o150 while [#1 le 0]
o150 endwhile
o<myfunc> endsub
M2
and a minimal program
o<myfunc> call
M2
the import of the program hangs. As soon as I change "[#1 le 0]" to "[#1 lt 0]", it imports correctly. So my question is: does LinuxCNC execute all the subroutines even during importing of program? And since the change of value I am waiting for will never occur during import of program, what could I do? How to prevent linuxcnc from infinitely waiting in the while cycle?
Please Log in or Create an account to join the conversation.
- Aciera
-
- Offline
- Administrator
-
Less
More
- Posts: 4305
- Thank you received: 1908
12 Apr 2025 18:11 - 12 Apr 2025 18:12 #326185
by Aciera
Replied by Aciera on topic executing subroutines even during import of GCODE file
You can use the 'task' parameter like this:
o100 if [#<_task> EQ 1]
;everything in here is only executed during actual gcode execution
o100 endif
Last edit: 12 Apr 2025 18:12 by Aciera.
The following user(s) said Thank You: filipkochan
Please Log in or Create an account to join the conversation.
- GCode and Part Programs
- O Codes (subroutines) and NGCGUI
- executing subroutines even during import of GCODE file
Time to create page: 0.083 seconds