Python open .NGC
26 Apr 2018 17:29 #109675
by Donno
Python open .NGC was created by Donno
I am using linuxcnc command to do few commands for an external control panel i am building so far it is easy to use
l = linuxcnc.command()
l.program_open("/cnc/linuxcnc/nc_files/examples/3D_Chips.ngc")
For some unknown reason i cannot open file in python. I have checked permission, set different path, am i doing something wrong ?
l = linuxcnc.command()
l.program_open("/cnc/linuxcnc/nc_files/examples/3D_Chips.ngc")
For some unknown reason i cannot open file in python. I have checked permission, set different path, am i doing something wrong ?
Please Log in or Create an account to join the conversation.
26 Apr 2018 18:55 #109680
by Donno
Replied by Donno on topic Python open .NGC
It seems like the file is opening
l.mode(linuxcnc.MODE_MDI)
l.program_open("/home/cnc/Desktop/donno_external_arduino/3D_Chips.ngc")
os.system("axis-remote --reload ")
l.mode(linuxcnc.MODE_MANUAL)
I can even run the file but there is no g-code displayed, no g-code drawing
The image shows that is is running g-code program
Any way to display it on screen and lines being executed ?
l.mode(linuxcnc.MODE_MDI)
l.program_open("/home/cnc/Desktop/donno_external_arduino/3D_Chips.ngc")
os.system("axis-remote --reload ")
l.mode(linuxcnc.MODE_MANUAL)
I can even run the file but there is no g-code displayed, no g-code drawing
The image shows that is is running g-code program
Any way to display it on screen and lines being executed ?
Please Log in or Create an account to join the conversation.
- Todd Zuercher
- Offline
- Platinum Member
Less
More
- Posts: 5007
- Thank you received: 1441
26 Apr 2018 19:30 #109682
by Todd Zuercher
Replied by Todd Zuercher on topic Python open .NGC
Can't say as I've ever seen it do that before.
That file opens and shows the code and preview properly for me.
That file opens and shows the code and preview properly for me.
Please Log in or Create an account to join the conversation.
26 Apr 2018 19:35 #109683
by Donno
Replied by Donno on topic Python open .NGC
If I press o [Shortcut Key] it opens correctly but if open it through Python program_open() then it does that ! I have even os.system("axis-remote --reload ") but still the same. I edit file and program_open it and run g-code still same but new file executes must be a BUG
Please Log in or Create an account to join the conversation.
- Todd Zuercher
- Offline
- Platinum Member
Less
More
- Posts: 5007
- Thank you received: 1441
26 Apr 2018 20:14 #109686
by Todd Zuercher
Replied by Todd Zuercher on topic Python open .NGC
Oops, I didn't really read your question good enough. And I don't know enough about programming to answer it myself, but it looks like your question might be answered here.
forum.linuxcnc.org/21-axis/33504-load-gcode-file-from-python
forum.linuxcnc.org/21-axis/33504-load-gcode-file-from-python
Please Log in or Create an account to join the conversation.
26 Apr 2018 20:21 #109688
by Donno
Replied by Donno on topic Python open .NGC
I have read that Forum if you look at my code i do use the os.system("axis-remote --reload ")
I used that to fix a problem i was having when i G10 L20 P1 X0Y0Z0 and the display did not update the File after using :
os.system("axis-remote --reload ")
It was fixed but when program_open() there is no effect.
I used that to fix a problem i was having when i G10 L20 P1 X0Y0Z0 and the display did not update the File after using :
os.system("axis-remote --reload ")
It was fixed but when program_open() there is no effect.
Please Log in or Create an account to join the conversation.
- Todd Zuercher
- Offline
- Platinum Member
Less
More
- Posts: 5007
- Thank you received: 1441
26 Apr 2018 20:44 #109690
by Todd Zuercher
Replied by Todd Zuercher on topic Python open .NGC
I think you need to use "axis-remote" to load your file, instead of "program_open".
Please Log in or Create an account to join the conversation.
27 Apr 2018 14:33 #109713
by Donno
Replied by Donno on topic Python open .NGC
Do have an example please ?
Please Log in or Create an account to join the conversation.
- Todd Zuercher
- Offline
- Platinum Member
Less
More
- Posts: 5007
- Thank you received: 1441
27 Apr 2018 14:53 #109716
by Todd Zuercher
Replied by Todd Zuercher on topic Python open .NGC
I can't say exactly how you would use it in python, but from the command line, the command is just "axis-remote filename". For example to open the 3D-Chips.ngc file on my test machine, the command is.
axis-remote ~/linuxcnc/nc_files/examples/3D_Chips.ngc
Please Log in or Create an account to join the conversation.
13 May 2023 17:26 #271299
by Donno
Replied by Donno on topic Python open .NGC
instead of usinguse
c.program_open("foo.ngc")
os.system ("axis-remote foo.ngc")
The following user(s) said Thank You: Todd Zuercher
Please Log in or Create an account to join the conversation.
Time to create page: 0.218 seconds