![]() | |
| Home Page | Mark Forums Read | Today's Posts | My Replies | Classifieds | Reviews | Photo Gallery | Web Links | Share Files | Advertise With Us | Ad List |
| |||||||
| G-Code Programing Discuss G-code programing and problems here! |
| This forum is sponsored by: |
![]() |
| | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
| |||
| |||
Hello all. I am running engraving/carving codes of up to 500,000 lines. I need suggestions on how to modify the code(output by photovcarve) to cycle a pair of solenoids periodicly to give a blast of air, then coolant. I am not setup for flood cooling. The jobs take 3-12 hours to complete. I am hoping there is a simple software solution that will add a block of code every "X" number of lines. It would be even better if I could add this block every "X" number of times that the Z reaches 0.060" Any suggestions for how I might accomplish this would be greatly appreciated. I am by no means a programmer, but I am willing to try if pointed in the right direction. Thank you Frank |
|
#2
| |||
| |||
| This should be able to be done with a 'MSWord' macro or a program called GWK. Does the code you wish to add need a separate line or can it be added to the end of a existing line? Also are the lines numbered? Please post half a dozen lines of example code to examine. |
|
#3
| |||
| |||
| This is the first few lines of the g-code. I don't think it would cause a problem if it was tacked on to the end of the line. ie z0.060"relay on pause relay off(in proper syntax of course) ( PhotoVCarve ) ( Mach2/3 Postprocessor ) N20G00G21G17G90G40G49G80 N30G70 N40T3M06 N50G00G43Z0.0600H3 N60S16000M03 N70G94 N80X0.0000Y0.0000F60.0 N90G00X2.9965Y-2.0009Z0.0600 N100G01Z-0.0774F60.0 N110Z0.0600 N120G00X2.9945Y-1.9990 N130G01Z-0.0771F60.0 N140Z0.0600 N150G00X2.9960Y-1.9935 N160G01Z-0.0773F60.0 N170X2.9891Y-2.0004Z-0.0767 N180Z0.0600 N190G00X2.9871Y-1.9985 N200G01Z-0.0765F60.0 N210X2.9975Y-1.9881Z-0.0770 N220Z0.0600 N230G00X2.9955Y-1.9861 N240G01Z-0.0770F60.0 N250X2.9817Y-2.0000Z-0.0764 N260Z0.0600 |
|
#5
| |||
| |||
| I notice the code you supplied has no spaces at all in each line. Will the machine run ok with a space before a axis character. My thought is to run a Find and Replace 'Z' with ' Z' so the AWK macro will find the space if the code can be added onto the end of the line. Last edited by Kiwi; 01-12-2008 at 04:49 PM. Reason: Program name to AWK |
| Sponsored Links |
|
#6
| |||
| |||
| After playing with this for a while, I was able to set up a "brain" in mach 3 that effectively counts the number of times that the z reaches .060 then cycles the relays as needed. Thank you for the input. If my tests work out, I will share the info if wanted. Frank |
|
#8
| |||
| |||
| you can do that quite easy with mawk. Code: BEGIN{
FS="Z"
count=0
}
# print original record
{ print }
# check records that start with N and end with a Z field.
/^N/ && NF==2{
z=$2
# count lines with z>=0.06
if (z>=0.06){
count++
}
# add lines every 10 times
if (count>=10){
count=0
print "your line 1"
print "and a second line"
}
} |
|
#9
| |||
| |||
| Eauth... Thanks for your code. I got some code to do what I required. { if ((x=index($2,"Z0.0600")) > 0) { Appendix = "AirBlast"; } print( $1,$2, Appendix); Appendix = ""; } N20G00G21G17G90G40G49G80 N30G70 N40T3M06 N50G00G43 Z0.0600H3 AirBlast N60S16000M03 N70G94 N80X0.0000Y0.0000F60.0 N90G00X2.9965Y-2.0009 Z0.0600 AirBlast N100G01 Z-0.0774F60.0 N110 Z0.0600 AirBlast N120G00X2.9945Y-1.9990 N130G01 Z-0.0771F60.0 N140 Z0.0600 AirBlast N150G00X2.9960Y-1.9935 N160G01 Z-0.0773F60.0 N170X2.9891Y-2.0004 Z-0.0767 N180 Z0.0600 AirBlast N190G00X2.9871Y-1.9985 N200G01 Z-0.0765F60.0 N210X2.9975Y-1.9881 Z-0.0770 N220 Z0.0600 AirBlast N230G00X2.9955Y-1.9861 N240G01 Z-0.0770F60.0 N250X2.9817Y-2.0000 Z-0.0764 N260 Z0.0600 AirBlast |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| PVC Compressed Air lines | Five-10 | CNCzone Club House | 47 | 01-07-2011 07:51 AM |
| ReOrdering lines | rherman | BobCad-Cam | 0 | 12-21-2006 11:34 AM |
| PRoblem seeing dxf lines | Ed_R | SheetCam | 4 | 03-25-2006 03:32 PM |
| CAD HELP: 4 lines to 1 box/object how to? | FireFghtr | General CAM Discussion | 7 | 02-24-2006 03:03 PM |
| Can't see lines | Mr.Chips | TurboCAD/CAM | 4 | 04-03-2005 10:29 AM |