g-code replacement filter?
02 Mar 2013 02:04 #30731
by tjamscad
g-code replacement filter? was created by tjamscad
I would like to have LinuxCNC run a program from multiple different machine programs. We have Fadal, Haas, Fanuc and Simmens conrtols on differnt machines. It would be a great help if I can create a filter/replace file to help with this.
I am still learning all of this so please dont attack me out of the gate. Will this work?
#This is my filter section in .ini
# [FILTER]
# PROGRAM_EXTENSION = .png,.gif,.jpg Greyscale Depth Image
# PROGRAM_EXTENSION = .py Python Script
# png = image-to-gcode
# gif = image-to-gcode
# jpg = image-to-gcode
# py = python
# gcode = gcode-convert
#A typical Fadal line
# N33G00G90G40M01E01
#will be changed to
# N33G00G90G40M01G54
#replace "E01" with "G54" on all lines
#This will change E01 to G54 on all lines.
#!/bin/bash
sed -e 's/\( E01\)\([0-1000000]*\)/ G54\2/' $1
I am still learning all of this so please dont attack me out of the gate. Will this work?
#This is my filter section in .ini
# [FILTER]
# PROGRAM_EXTENSION = .png,.gif,.jpg Greyscale Depth Image
# PROGRAM_EXTENSION = .py Python Script
# png = image-to-gcode
# gif = image-to-gcode
# jpg = image-to-gcode
# py = python
# gcode = gcode-convert
#A typical Fadal line
# N33G00G90G40M01E01
#will be changed to
# N33G00G90G40M01G54
#replace "E01" with "G54" on all lines
#This will change E01 to G54 on all lines.
#!/bin/bash
sed -e 's/\( E01\)\([0-1000000]*\)/ G54\2/' $1
Please Log in or Create an account to join the conversation.
02 Mar 2013 03:50 #30738
by BigJohnT
Replied by BigJohnT on topic g-code replacement filter?
Did you see my post for a script to add a W axis to G code. I'd think you could use a similar program. I don't know anything about sed...
John
John
Please Log in or Create an account to join the conversation.
02 Mar 2013 03:53 #30739
by tjamscad
Replied by tjamscad on topic g-code replacement filter?
No , John I have not seen it. Please send me to the link.
Please Log in or Create an account to join the conversation.
02 Mar 2013 05:00 #30742
by BigJohnT
The following user(s) said Thank You: jpka
Please Log in or Create an account to join the conversation.
02 Mar 2013 05:52 - 02 Mar 2013 06:06 #30745
by tjamscad
Replied by tjamscad on topic g-code replacement filter?
Thanks, Jon
Could this be made to run in the background while a machine is running a program? Ultimate goal would be for this to run while a program is being run.
Could this be made to run in the background while a machine is running a program? Ultimate goal would be for this to run while a program is being run.
Last edit: 02 Mar 2013 06:06 by tjamscad.
Please Log in or Create an account to join the conversation.
02 Mar 2013 07:44 #30749
by andypugh
Replied by andypugh on topic g-code replacement filter?
I think you will find that the filter runs so fast that there is no point. Effectively you feed Axis one program, and a filtered one gets run.Could this be made to run in the background while a machine is running a program? Ultimate goal would be for this to run while a program is being run.
Please Log in or Create an account to join the conversation.
03 Mar 2013 11:11 #30786
by tjamscad
Andy,
Just so I am clear. I load a program into axis or what ever GUI. The program that will run will be the filtered one? Or do I need to run the filter outside and then load the filtered program?
Replied by tjamscad on topic g-code replacement filter?
I think you will find that the filter runs so fast that there is no point. Effectively you feed Axis one program, and a filtered one gets run.Could this be made to run in the background while a machine is running a program? Ultimate goal would be for this to run while a program is being run.
Andy,
Just so I am clear. I load a program into axis or what ever GUI. The program that will run will be the filtered one? Or do I need to run the filter outside and then load the filtered program?
Please Log in or Create an account to join the conversation.
03 Mar 2013 16:30 #30788
by cmorley
Replied by cmorley on topic g-code replacement filter?
The Gcode will be automatically filtered and sent to the GUI.
Technically the filter runs and sends it's output to AXIS or Gscreen.
Chris M
Technically the filter runs and sends it's output to AXIS or Gscreen.
Chris M
Please Log in or Create an account to join the conversation.
03 Mar 2013 20:53 #30797
by andypugh
As an example, try running the sim/axis configuration in the sample configs then open an image file (jpg, png) instead of a G-code file. You will see that you end up with G-code in the program window, not image data.
Replied by andypugh on topic g-code replacement filter?
Yes.I load a program into axis or what ever GUI. The program that will run will be the filtered one?
As an example, try running the sim/axis configuration in the sample configs then open an image file (jpg, png) instead of a G-code file. You will see that you end up with G-code in the program window, not image data.
Please Log in or Create an account to join the conversation.
04 Mar 2013 22:25 #30843
by tjamscad
Replied by tjamscad on topic g-code replacement filter?
Great, so how do i tell LinuxCNC to use this filter program? Will it just know?
Please Log in or Create an account to join the conversation.
Time to create page: 0.097 seconds