load gcode file from python

More
9 years 1 day ago #101001 by albova
hi,
I did a python program that should load a gcode.ngc using the linuxcnc.command commands. The program is launched from M100 with a button defined in Axis. It works, it only has a problem: it does not update the Axis graphic part or even the list below. If I start the program, it runs correctly with the uploaded file. What did I forget?

Alessandro

Please Log in to join the conversation.

More
9 years 5 minutes ago #101058 by andypugh
You are already "in" Python, so it looks like this approach will be fairly easy.

forum.linuxcnc.org/21-axis/29552-reload-...h-pin?start=20#61763

(shell-out to the axis-remote command to force refresh)

Please Log in to join the conversation.

More
8 years 11 months ago #101105 by albova
Replied by albova on topic load gcode file from python
Hi Andy,
I tried to reload the program with the axis tab but the program that is loaded is the one before writing the program done with the python. I think even using axis-remote --reload, the result is the same. In the Axis status window, I see correctly the program that I produced with the python, but with the reload, go back to the previous one. Some idea ?
Ale

Please Log in to join the conversation.

More
8 years 11 months ago #101109 by albova
Replied by albova on topic load gcode file from python
Good news,
instead of the linuxcnc.command() "program_open" statement, I used to load the file, os.system ("axis-remote file.ngc") in the python program. So it works. I did not understand the difference between linuxcnc program_open file and axis-remote. The first one does not show the gcode in axis even if it runs it correctly, the second shows it and executes it.
Regards
Ale

Please Log in to join the conversation.

Time to create page: 0.076 seconds
Powered by Kunena Forum