- Posts: 137
- Thank you received: 0
Python open .NGC
8 years 6 months ago #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 to join the conversation.
8 years 6 months ago #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
Attachment not found
The image shows that is is running g-code program
Any way to display it on screen and lines being executed ?
Please Log in to join the conversation.
- Todd Zuercher
- Offline
- Platinum Member
-
Less
More
- Posts: 4739
- Thank you received: 2
8 years 6 months ago #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 to join the conversation.
8 years 6 months ago #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 to join the conversation.
- Todd Zuercher
- Offline
- Platinum Member
-
Less
More
- Posts: 4739
- Thank you received: 2
8 years 6 months ago #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 to join the conversation.
8 years 6 months ago #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 to join the conversation.
- Todd Zuercher
- Offline
- Platinum Member
-
Less
More
- Posts: 4739
- Thank you received: 2
8 years 6 months ago #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 to join the conversation.
8 years 6 months ago #109713
by Donno
Replied by Donno on topic Python open .NGC
Do have an example please ?
Please Log in to join the conversation.
- Todd Zuercher
- Offline
- Platinum Member
-
Less
More
- Posts: 4739
- Thank you received: 2
8 years 6 months ago #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.
Code:
axis-remote ~/linuxcnc/nc_files/examples/3D_Chips.ngc
Please Log in to join the conversation.
Time to create page: 0.096 seconds
