load specific g-file with button

More
28 Dec 2015 12:05 #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:
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 or Create an account to join the conversation.

More
28 Dec 2015 16:46 #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
The following user(s) said Thank You: markder13

Please Log in or Create an account to join the conversation.

More
29 Dec 2015 09:14 #67440 by markder13
Thanks

This solved the problem

Please Log in or Create an account to join the conversation.

More
30 Dec 2015 13:40 #67513 by andypugh

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 or Create an account to join the conversation.

Moderators: HansU
Time to create page: 0.163 seconds
Powered by Kunena Forum