load gcode file from python

More
30 Oct 2017 07:25 #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 or Create an account to join the conversation.

More
31 Oct 2017 13:31 #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 or Create an account to join the conversation.

More
01 Nov 2017 08:33 #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 or Create an account to join the conversation.

More
01 Nov 2017 09:24 #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 or Create an account to join the conversation.

Time to create page: 0.104 seconds
Powered by Kunena Forum