CNCzone.com-The Largest Machinist Community on the net!



Home Page Mark Forums Read Today's Posts My Replies Classifieds Reviews Photo Gallery Web Links Share Files Advertise With Us Ad List
Go Back   CNCzone.com-The Largest Machinist Community on the net! > Machine Controllers Software and Solutions > G-Code Programing


G-Code Programing Discuss G-code programing and problems here!


This forum is sponsored by:

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Ban this user!
Old 06-11-2010, 02:53 AM
 
Join Date: May 2008
Location: India
Posts: 85
yaji63 is on a distinguished road
Exclamation Help needed for incremental line numbering of a Gcode program

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
Reply With Quote

  #2   Ban this user!
Old 06-11-2010, 03:05 AM
P.Passuello's Avatar  
Join Date: Dec 2005
Location: New Zealand
Posts: 142
P.Passuello is on a distinguished road

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
Reply With Quote

  #3   Ban this user!
Old 06-11-2010, 07:41 AM
 
Join Date: May 2008
Location: India
Posts: 85
yaji63 is on a distinguished road

Originally Posted by P.Passuello View Post
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
It is not about adding line numbers to every line but adding line number (N & numerical - Eg. N100 ) for every 100 lines or 1000 lines. This is not something which is available with most softwares.
Reply With Quote

  #4   Ban this user!
Old 06-11-2010, 08:20 AM
 
Join Date: Aug 2007
Location: USA
Posts: 339
Boots is on a distinguished road

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.
Reply With Quote

  #5   Ban this user!
Old 06-11-2010, 11:41 AM
 
Join Date: Jun 2008
Location: United States
Posts: 1,507
stevo1 is on a distinguished road

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
Reply With Quote

Sponsored Links
  #6  
Old 06-11-2010, 12:28 PM
HuFlungDung's Avatar
Moderator
 
Join Date: Mar 2003
Location: Canada
Posts: 4,825
HuFlungDung is on a distinguished road

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)
Reply With Quote

  #7   Ban this user!
Old 06-11-2010, 08:12 PM
 
Join Date: Jul 2003
Location: New Zealand
Posts: 1,039
Kiwi is on a distinguished road

You may want to look at writing a small program using mawk programing language.
Reply With Quote

  #8   Ban this user!
Old 06-12-2010, 03:55 AM
Don Diegoo
 
Join Date: Aug 2006
Location: Iran
Age: 48
Posts: 90
F.Sharifi is on a distinguished road

dear all
with CIMCO edit software you can oden file then with NC Function and insert Block Nr. ( Ctrl +T) all file inserted with incrimental block nr.

check it out
F.Sharifi
Reply With Quote

  #9   Ban this user!
Old 06-12-2010, 09:15 AM
dcoupar's Avatar  
Join Date: Mar 2003
Location: USA
Posts: 2,312
dcoupar is on a distinguished road

I believe you can restart at a sequence number (N) or a block number (B). Check your Fanuc operator's manual to see if your model supports this.
Reply With Quote

  #10   Ban this user!
Old 06-12-2010, 05:20 PM
 
Join Date: Jul 2003
Location: New Zealand
Posts: 1,039
Kiwi is on a distinguished road

Suggest you try saving the code with increment of 0.01 or 0.001
Reply With Quote

Sponsored Links
  #11   Ban this user!
Old 06-12-2010, 08:31 PM
Torsten's Avatar  
Join Date: Nov 2004
Location: U.S.A.
Posts: 260
Torsten is on a distinguished road
Smile

Originally Posted by yaji63 View Post
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
Maybe a quick Qbasic program would work for you.
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"
Reply With Quote

  #12   Ban this user!
Old 06-24-2010, 11:51 PM
 
Join Date: Feb 2006
Location: india
Posts: 1,187
sinha_nsit is on a distinguished road

Originally Posted by Kiwi View Post
Suggest you try saving the code with increment of 0.01 or 0.001
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.
Reply With Quote

Reply




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


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




All times are GMT -5. The time now is 02:09 PM.





Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
Content Relevant URLs by vBSEO
Template-Modifications by TMS

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361