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! > CAM Software > General CAM Discussion


General CAM Discussion Discuss CAD/CAM software and Design software methods here!


This forum is sponsored by:

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 11-04-2007, 04:14 PM
Wanna be
 
Join Date: Mar 2004
Location: United States
Posts: 517
Hack is on a distinguished road
Please verify my code

I am taking a cnc programming class at our local community college and we are working with subroutinges this week. What we are programming is a simple grid of drilled holes (10 holes x 10 holes) in a staggered location.

I am using NC Plat to try to verify the program, but it does not show what I figured it would. I checked the program and do not find anything wrong so I am thinking it does not recignize some of the code.

Can someone check this over for me? Can anyone recommend a software that will properly display this program correctly?

This is for a HAAS Mill.

Thanks

Dan
Attached Files
File Type: txt EX14-1.txt‎ (531 Bytes, 100 views)
__________________
Check out what I am working on at www.routerbitz.com!
Reply With Quote

  #2  
Old 11-04-2007, 07:33 PM
HuFlungDung's Avatar
Moderator
 
Join Date: Mar 2003
Location: Canada
Posts: 4,825
HuFlungDung is on a distinguished road

I think your M98 call should refer to the program number of the subprogram, and I don't see that in your code. But, I never have run a subprogram on Haas, I've always used M97 local subroutines.

Apart from that, your code should run I believe. It could be the case that the way you have set up your code lacks enough gcodes for NCPlot to interpret it correctly when it returns from the sub. For example, although you switched back to absolute mode within the subprogram, NCPlot may or may not be able to interpret the axis moves in the main program correctly. You could add a G00 G90 in front of each move in the main to help NCPlot switch modes correctly.
__________________
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

  #3  
Old 11-05-2007, 04:33 PM
Wanna be
 
Join Date: Mar 2004
Location: United States
Posts: 517
Hack is on a distinguished road
Yes and no

Thank you for looking.

Yes you are correct that I did not correctly call out the name of the subroutine. Copy and paste error on my part. Unfortunately it did not fix the problem.

Any other ideas? I am posting the updated program.

%
O1413 (EX 14.1 BY DAN REEDY)

(PECK DRILL .25" DIAM HOLE 1/4" DEEP)

T01 M06
S1800 MO3
G00 G90 G54 X.5 Y.5
M08
G43 H01 Z.1
G83 Z-.25 Q.05 R.1 F8.0
M98 P1414 L4
X1.0 Y1.0
M98 P1414 L4
X.5 Y1.5
M98 P1414 L4
X1.0 Y2.0
M98 P1414 L4
X.5 Y2.5
M98 P1414 L4
X1.0 Y3.0
M98 P1414 L4
X.5 Y3.5
M98 P1414 L4
X1.0 Y4.0
M98 P1414 L4
X.5 Y4.5
M98 P1414 L4
X1.0 Y5.0
M98 P1414 L4
G80
G00 G91 G28 Z0 M05
G28 Y0 M09
G90
M30
%



%
O1414
(SUBPROGRAM 1 - CHANGE LOCATION OF .25" HOLES)
G91 X1.0
G90
M99
%
__________________
Check out what I am working on at www.routerbitz.com!
Reply With Quote

  #4  
Old 11-05-2007, 05:50 PM
MetLHead's Avatar
Gold Member
 
Join Date: Mar 2003
Location: USA
Posts: 740
MetLHead is on a distinguished road

What happens when you try to run it in NCPlot? Does it give you an error, or does it just not plot correctly?

Scott
Reply With Quote

  #5  
Old 11-05-2007, 06:20 PM
Wanna be
 
Join Date: Mar 2004
Location: United States
Posts: 517
Hack is on a distinguished road
No error

It doesn't give me an error, just does not plot correctly. It will plot the first hole for every line. It plots the hole location in the main program but does not seem to go to the sub program at all.

Thank you

Dan
__________________
Check out what I am working on at www.routerbitz.com!
Reply With Quote

Sponsored Links
  #6   Ban this user!
Old 11-05-2007, 06:29 PM
 
Join Date: Jul 2005
Location: Canada
Posts: 11,565
Geof will become famous soon enough

Originally Posted by Hack View Post
....Can someone check this over for me? Can anyone recommend a software that will properly display this program correctly?

This is for a HAAS Mill.

Thanks

Dan
Okay, because you asked nicely . It runs perfectly well on my Haas Simulator.

Does your college not have Haas Simulators? They are dirt cheap at less than $1700 (I think) for one that simulates Mill or Lathe.

I have tried running programs with subroutines through NC Plot and never had success.

Being a bit picky I will point out you are working with a subprogram not a subroutine. As Hu points out the call is different M97 for a subroutine included with the running program and M98 for the external call. Possibly your instructor is not as precise as could be and does not make distinction between the two.

And here is a challenge for you. Your program has thirty or so lines and multiple repeating lines, the subprogram calls. I think you should be able to shorten it by writing a program using nested subroutines and reduce your line count. Maybe not an issue with a ten by ten array but if you wanted to do a hundred by a hundred the nesting helps.
__________________
An open mind is a virtue...so long as all the common sense has not leaked out.
Reply With Quote

  #7  
Old 11-05-2007, 06:41 PM
MetLHead's Avatar
Gold Member
 
Join Date: Mar 2003
Location: USA
Posts: 740
MetLHead is on a distinguished road

This is what I get when I run it in NCPlot. Just make sure you don't have it set to ignore M98 subprograms (see screenshot). This is under the menu "Setup". There is also a setting on the machine configuration, under the G/M Code page that sets how the M98 command is recognized. Make sure it is set to the first option, "M98 P1 L1".

Thanks,
Scott
Attached Thumbnails
Click image for larger version

Name:	screen.jpg‎
Views:	80
Size:	117.8 KB
ID:	46388  
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 On
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Edit/Modify MC Post, Then Verify??? Dugg Mastercam 8 12-30-2006 07:16 AM
HELP! Rotating an STL file generated in verify AMCTony Mastercam 7 07-24-2006 08:25 AM
Please verify my Driver Wires electron Stepper Motors and Drives 1 02-22-2006 09:54 PM
4 axis verify utility? DAB_Design General CNC (Mill and Lathe) Control Software (NC) 6 04-27-2005 12:38 AM
Gcode verify autocad plugin balsaman General CAM Discussion 1 10-31-2003 11:22 AM




All times are GMT -5. The time now is 02:21 AM.





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