load specific g-file with button

More
10 years 10 months ago #67394 by markder13
Hi,

I have write a separate python program that converts a G-code file. The file is loaded, modified and writen to new file. The python programm communicated with linuxcnc using the linuxcnc python module. Now I want to load the using this code:
Code:
import linuxcnc c = linuxcnc.command() c.mode(linuxcnc.MODE_AUTO) c.reset_interpreter() c.program_open('/home/user/linuxcnc/nc_files/test.ngc')
However nothing happens. But when change the file to a non existing I get a error messages that the file does not exist. Hence linuxcnc is opening the file.
How do I load as G-code in Axis ?

thx

Please Log in to join the conversation.

More
10 years 10 months ago #67402 by ArcEye
I think you are getting confused between linuxcnc and Axis.

Axis assumes it is the only GUI and knows nothing about what another program might try to do.
As far as it is concerned the only file loaded is one that was loaded through Axis.

If you want to load a file directly into Axis, probably best just to use axis-remote
eg
system("axis-remote filename.ngc")

That way, everything is in sync

regards

Please Log in to join the conversation.

More
10 years 10 months ago #67440 by markder13
Thanks

This solved the problem

Please Log in to join the conversation.

More
10 years 10 months ago #67513 by andypugh

markder13 wrote: I have write a separate python program that converts a G-code file. The file is loaded, modified and writen to new file.


You can probably run this Python file automatically as a filter file.

linuxcnc.org/docs/2.7/html/config/ini-co...html#_filter_section

Please Log in to join the conversation.

Time to create page: 0.075 seconds
Powered by Kunena Forum