- Posts: 1
- Thank you received: 0
executing subroutines even during import of GCODE file
- filipkochan
- Topic Author
- Offline
- New Member
-
Less
More
1 year 6 months ago #326183
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 to join the conversation.
1 year 6 months ago #326185
by Aciera
Replied by Aciera on topic executing subroutines even during import of GCODE file
You can use the 'task' parameter like this:
Code:
o100 if [#<_task> EQ 1]
;everything in here is only executed during actual gcode execution
o100 endif
Please Log in to join the conversation.
Time to create page: 0.067 seconds
