![]() | |
| 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
| |||
| |||
| Hi, i have a peculiar requirement on one of my Fanuc machines. The machine supports Program restart, if by any chance there is an interruption, but i have to go to the line number (N & Number) where the program had stopped before interruption. This works if the programs has less than N9999 but most of my programs are much larger and hence the line number repeats and this is a problem. I wanted to know if anyone out here knows any software or has a VBA piece of code which can add line numbers only at an increment of 100 lines or 1000 lines. this will solve my problem as even if i end up repeating a few lines it will not be as bad as running the whole program again or getting down to editing the program which is again a risk. i did try using excel macro but excel does not support lines more than 69,000 and i have programs which have many more lines than these. I do know this is possible by taking a text file (NC program) and renumbering it by using excel as a front end tool through VBA macros but could not find a method to fulfill my requirement as i could not find codes to work on external files within excel. Any help will be greatly appreciated ![]() thanks a ton |
|
#2
| ||||
| ||||
| Have a look at NCPlot. If memory serves me right the free version of NCPlot can add line numbers to a GCode file. http://www.ncplot.com Cheers Peter
__________________ The ingenuity of idiots is unlimited. http://www.youtube.com/user/cncnutz |
|
#3
| |||
| |||
|
|
#4
| |||
| |||
| What I have done in the past is only number the line where there is a tool change. You can MDI the proper tool into the spindle then do a search for the N number for that tool. Sence we only had a 20 tool changer it was easy to just have 20 N numbers. The N number matched the tool number so it's easier to search for your proper starting point. Every one has their own method......that was mine.
__________________ We all live in Tents! Some live in content others live in discontent. |
|
#5
| |||
| |||
| I agree with Boots. I don’t know of any software that can add an N() every 100 lines. What Fanuc control do you have? I do as Boots said. I don’t like all the N() addresses at every line so my machines are set to not enter them. Once my code is complete I put a N() at each operation/tool change. Depending on your control you can start at various codes and not just the N(). Example some controls will allow you to start at an M6 for the tool change or on a comment in () parenthesis. IIRC even on a M1 or M0. Stevo |
| Sponsored Links |
|
#6
| ||||
| ||||
| If it were a really long program, using only 1 tool, I suppose you could break it up into sub program calls every 9999 lines. Hopefully, there is a place on the screen where you can see what the subprogram number was when you had to stop execution.
__________________ First you get good, then you get fast. Then grouchiness sets in. (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management) |
|
#11
| ||||
| ||||
Qbasic came with the older versions of windows but still runs in XP. try this. INPUT "Input Filename "; Infile$ INPUT "Output Filename "; Outfile$ IF Outfile$ = "" THEN Outfile$ = "Numbered.txt" IF Infile$ <> "" THEN OPEN Infile$ FOR INPUT AS #1 OPEN Outfile$ FOR OUTPUT AS #2 N& = 0: I = 0 WHILE NOT EOF(1) LINE INPUT #1, BLOCK$ I = I + 1 IF I = 100 THEN N& = N& + 1 N$ = "N" + MID$(STR$(N&), 2, LEN(STR$(N&))) PRINT #2, N$ + BLOCK$ I = 0 ELSE PRINT #2, BLOCK$ END IF WEND CLOSE PRINT "Finished renumbering " + Outfile$ END IF PRINT "Program Exit" |
|
#12
| |||
| |||
|
Yes. He appears to be using a CAM software with very fine resolution. This increases file size, as well as effective feedrate. A larger step distance may be considered. If nothing works, the toolpath part of the program would need to be broken into several subprograms, to be called sequentially, as already suggested. The main program would be hardly a 50-line program. |
![]() |
| 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 |
| fadal cnc 88 program limitation at line 734? | Runner4404spd | Fadal | 12 | 03-04-2009 08:21 AM |
| Line numbering for mach3? | fatal-exception | ArtCam Pro | 5 | 07-11-2008 10:18 AM |
| Incremental circle milling sub program | Diggs | G-Code Programing | 25 | 01-07-2008 06:03 PM |
| Enable line 1 , gcode? | Konstantin | Mach Software (ArtSoft software) | 6 | 07-29-2006 01:09 PM |
| line numbering | xairflyer | G-Code Programing | 4 | 05-10-2005 02:22 PM |