- Posts: 8
- Thank you received: 0
LinuxCNC python
11 months 1 week ago #338912
by kwanlokto
LinuxCNC python was created by kwanlokto
I am looking to leverage
linuxcnc.org/docs/html/config/python-interface.html
to build an API which will be able to perform basic machine functions like homing the axis, measuring tool length and running gcode. Out of curiousity do you guys know of any github repos or any open source projects I can reference to start this project?
Please Log in to join the conversation.
11 months 1 week ago #338913
by cmorley
Replied by cmorley on topic LinuxCNC python
Do you mean like this ?
linuxcnc.org/docs/devel/html/gui/qtvcp-l...ml#_code_action_code
or something like this?
linuxcnc.org/docs/devel/html/man/man1/axis-remote.1.html
linuxcnc.org/docs/devel/html/gui/qtvcp-l...ml#_code_action_code
or something like this?
linuxcnc.org/docs/devel/html/man/man1/axis-remote.1.html
Please Log in to join the conversation.
10 months 3 weeks ago #339907
by JT
Replied by JT on topic LinuxCNC python
Please Log in to join the conversation.
6 months 4 weeks ago #345017
by Donb9261
Replied by Donb9261 on topic LinuxCNC python
Consider the following gcode lines:
197: G2 X[118.69393*#<scale>] Y[5.37699*#<scale>] I[5.36449*#<scale>] J[4.87005*#<scale>]
198: G2 X[118.27432*#<scale>] Y[8.23889*#<scale>] I[12.16539*#<scale>] J[3.2454*#<scale>]
199: G0 Z3.0
200: G55
201: M5
202: M30
LCNC reads/runs all the way down and stops at G0 Z3.0. And the program never resets. I stat.red_line, stat.motion_line, current_line, and see that motion_line is actually the line it is stuck on. In this case, it would be line 199. After 202: there is an EOF carraige return. I tried this using Axis, and all the others. I get the same result these do.
M30 should read and rewind to first line in the program which is RS-274 GCODE. But, no matter what I try, nope.
Any ideas?
Thanks,
Don
197: G2 X[118.69393*#<scale>] Y[5.37699*#<scale>] I[5.36449*#<scale>] J[4.87005*#<scale>]
198: G2 X[118.27432*#<scale>] Y[8.23889*#<scale>] I[12.16539*#<scale>] J[3.2454*#<scale>]
199: G0 Z3.0
200: G55
201: M5
202: M30
LCNC reads/runs all the way down and stops at G0 Z3.0. And the program never resets. I stat.red_line, stat.motion_line, current_line, and see that motion_line is actually the line it is stuck on. In this case, it would be line 199. After 202: there is an EOF carraige return. I tried this using Axis, and all the others. I get the same result these do.
M30 should read and rewind to first line in the program which is RS-274 GCODE. But, no matter what I try, nope.
Any ideas?
Thanks,
Don
Please Log in to join the conversation.
6 months 4 weeks ago #345018
by Donb9261
Replied by Donb9261 on topic LinuxCNC python
Attachment not found
Please Log in to join the conversation.
- tommylight
-
- Away
- Administrator
-
Less
More
- Posts: 22009
- Thank you received: 3
6 months 4 weeks ago #345080
by tommylight
Replied by tommylight on topic LinuxCNC python
@Don,
Do those replies belong on this topic, or am i missing something?
Do those replies belong on this topic, or am i missing something?
Please Log in to join the conversation.
6 months 3 weeks ago #345158
by Donb9261
Replied by Donb9261 on topic LinuxCNC python
Tommy,
The replies demo what is actually happening in hopes I may get some guidance to fix it. My question is above them.
The replies demo what is actually happening in hopes I may get some guidance to fix it. My question is above them.
Please Log in to join the conversation.
6 months 3 weeks ago #345161
by Donb9261
Replied by Donb9261 on topic LinuxCNC python
I made this work around that seems to be robust.
if cur_task_mode_mon == 1 and cur_interp_state_mon == 1 and cur_queue_mon == 0:
cmd.abort()
M30 is actually read into the buffer and executed, but the inerp has already reset before updating the line number que. That is a bug in Linuxcnc and breaks the standard function of M30 in RS274.
I may simply modify my lcnc to fix the issue. But for now, the above works and should only activate if the yask_mode is manual, which M30 does actually set on M30 read, the task_state is idle, which it should be, and the queue is empty. Which is the planner que.
if cur_task_mode_mon == 1 and cur_interp_state_mon == 1 and cur_queue_mon == 0:
cmd.abort()
M30 is actually read into the buffer and executed, but the inerp has already reset before updating the line number que. That is a bug in Linuxcnc and breaks the standard function of M30 in RS274.
I may simply modify my lcnc to fix the issue. But for now, the above works and should only activate if the yask_mode is manual, which M30 does actually set on M30 read, the task_state is idle, which it should be, and the queue is empty. Which is the planner que.
Please Log in to join the conversation.
- tommylight
-
- Away
- Administrator
-
Less
More
- Posts: 22009
- Thank you received: 3
6 months 3 weeks ago #345163
by tommylight
Replied by tommylight on topic LinuxCNC python
OK, thank you.
Please Log in to join the conversation.
Time to create page: 0.096 seconds
