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! > MetalWorking Machines > Haas Mills


Haas Mills Discuss Haas machinery here!


This forum is sponsored by:

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Ban this user!
Old 11-26-2007, 04:25 PM
Shotout's Avatar  
Join Date: Jun 2006
Location: USA
Age: 38
Posts: 443
Shotout is on a distinguished road
Can you use the graph feature to display sub program moves?

I wrote a program that has a couple of sub program calls in it. I loaded the programs, set up offsets & went to the graph function to run the program. It runs through the first moves but when it comes to the subs it just skips over them like they aren't there. Basically I'm just trying to learn how to write sub programs and this part we make is ideal. Code monkey's long hand version not elegant to paraphrase.

I ran the program in air for a few minutes and everything is ok up to the point I ran it, after the first call first repeat, but without graphing it I have to watch it cut for a long time to proof it and I'm worried about the g91 X-1.875 move and the call in that sub for another sub with repeats. I've got the sub programs loaded into the controller @ o9001 and o9002. The code is below if that helps.

%
O0050 (CTRC HAMMER OP01)
(T01 - D1.5IN SINGLE PT CCW ROT)
(MAT-S7 TOOL STEEL ANNEALED)
N0010 G20 G40 G49 G90
N0020 M6 T01
N0030 G43 H01
N0040 G0 G54 X-3.125 Y-3.25
N0050 S670 M04
N0060 Z.25 M08
N0070 M98 P9001 K15
N0080 M98 P9002 K11
N0090 M09
N0100 M05
N0110 G91 G28 Z0.0
N0120 M30
%

%
O9001 (CTRC HAMMER SUB1)
N0140 G91 G1 Y.05 F10.0
N0150 Z-2.75 F2.7
N0160 Y-.05 F10.0
N0170 G0 Z2.75
N0180 G1 Y.05 F10.
N0190 M99
%

%
O9002 (CTRC HAMMER SUB2)
N0210 G91 X-1.875 Y-.75
N0220 M98 P9001 K15
N0230 M99
%
__________________
Suppose you were an idiot and suppose you were a member of Congress. But I repeat myself.
Mark Twain
Reply With Quote

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

You can run the program in single step, even in graphics mode. Press F4 to see the code at the bottom of the graphics window. You should be able to see what line is executing, so that you can check your program jumps.

I'm not sure about calling repeats with a "K" address? Shouldn't that be "L"?

If I am intending to switch to incremental mode, I always make a point of writing G91 on a line by itself. When I switch back, I write G90 on a line by itself, before the M99. If you intend to begin your subprogram in incremental, it is usually best to start with a G91 and end with a G90 before it jumps back to the main program, providing that the main program is all absolute. You can then call G91 in the next subprogram and end that one with a G90.
__________________
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   Ban this user!
Old 11-26-2007, 06:26 PM
 
Join Date: Jul 2005
Location: Canada
Posts: 11,565
Geof will become famous soon enough

Change your subprogram number to something different than 9nnnn.

Haas uses 9nnnn for some of the options such as engraving and there are settings which turn off the Graphics display for 9nnnn programs. You can go into the Settings and turn them on if you really want to keep the 9nnnn numbering.

EDIT: Noticed Hu's comment about K and L...he is correct, L is the one for multiple sub calls.
__________________
An open mind is a virtue...so long as all the common sense has not leaked out.
Reply With Quote

  #4   Ban this user!
Old 11-26-2007, 08:53 PM
Shotout's Avatar  
Join Date: Jun 2006
Location: USA
Age: 38
Posts: 443
Shotout is on a distinguished road

Hu,
I was using the F4 and F1 which is how I saw it seeming to skip over. I'll change that K with an L tomoorow and check that. I should have checked that in the fine manual. Might have been the lathe in school that used the K address. I'll remember that about the absolute and incremental. Harder to make a mistake that way.

Geof,
Why would you not want to use the 9nnn numbers? I could use another series like the 7nnn but aren't the 9nnn the only ones that can be locked? I had planned to log the sub-programs and load them on both machines but wanted to be able to lock those programs from editing in the future.
__________________
Suppose you were an idiot and suppose you were a member of Congress. But I repeat myself.
Mark Twain
Reply With Quote

  #5   Ban this user!
Old 11-26-2007, 09:37 PM
 
Join Date: Jul 2005
Location: Canada
Posts: 11,565
Geof will become famous soon enough

Originally Posted by Shotout View Post
Geof,
Why would you not want to use the 9nnn numbers? I could use another series like the 7nnn but aren't the 9nnn the only ones that can be locked? I had planned to log the sub-programs and load them on both machines but wanted to be able to lock those programs from editing in the future.
Yes if you want to lock only group of programs you need to use the 9nnnn. I was just pointing out that if you use 9nnnn then you may not see them in graphics depending on what your settings are.

I also have an aversion to using the same number group as the canned programs just in case I screw up and overwrite something.
__________________
An open mind is a virtue...so long as all the common sense has not leaked out.
Reply With Quote

Sponsored Links
  #6   Ban this user!
Old 11-27-2007, 06:38 AM
Shotout's Avatar  
Join Date: Jun 2006
Location: USA
Age: 38
Posts: 443
Shotout is on a distinguished road

Originally Posted by Geof View Post
Yes if you want to lock only group of programs you need to use the 9nnnn. I was just pointing out that if you use 9nnnn then you may not see them in graphics depending on what your settings are.

I also have an aversion to using the same number group as the canned programs just in case I screw up and overwrite something.
I see your point. We have no macros etc on the machines so all the 9nnnn numbers are empty. I'll have to decide how important it is to lock the programs I guess and make a decision. Probably would be wise to defer to experiance is my thought for now, chances are pretty good that it won't be really necessary to lock those programs, just so long as I'm consistent which is my main concern.

Hu's and your pointer on the address value fixed the problem, looking at the machine position it was returning to Y-3.25 after returning to g54 Z.25 after the last repeat so it seems to be moving like I want.

Now I just need to rewrite with the seperate g90, g91 lines as suggested by Hu as that sounds like a good habit to have, add the stock allowance for surface grinding after heat treating and probably a g41 move changing my Y values to match. This should work until I can figure out a better way to machine the part with our equipment if there is one.

Thanks
Scott
__________________
Suppose you were an idiot and suppose you were a member of Congress. But I repeat myself.
Mark Twain
Reply With Quote

  #7  
Old 11-27-2007, 07:49 AM
HuFlungDung's Avatar
Moderator
 
Join Date: Mar 2003
Location: Canada
Posts: 4,825
HuFlungDung is on a distinguished road

Scott,
Are you familiar with the M97 local sub call? If your subroutines are unique to each main program, it is probably more convenient to just load the subs in after the main program's M30. That way, there is no worrying about having program numbers available, because the subroutines exist within one program.

The calling of a subroutine is basically the same except that you use an M97 in place of the M98. The P address called is simply a line number at the start of the sub. I do not otherwise use line numbers in my programs for anything except subroutine addresses, so this allows me to use a simple addresses like N100, N200 etc, without using an editor to discover what the literal line number might be, or worrying if the line number has changed after an edit. But you can use whatever you like.

The subroutines are not named with a Ooooo program number.
__________________
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

  #8   Ban this user!
Old 11-27-2007, 08:31 AM
Shotout's Avatar  
Join Date: Jun 2006
Location: USA
Age: 38
Posts: 443
Shotout is on a distinguished road

I have read about them in some of the reference books I have and have used them in my cad software for multiple pockets but never hand coded them. It would eliminate one concern such as deleting a sub program, or worse overwritting it with something inappropriate to this program. I have to stage the part, haven't wrote the portion from M00(xxx) on to allow moving it down on the fixture so it could end up being a nice little 3/4 printed page program. I think the long hand version is about 4pgs printed on legal paper.

The block no. idea is a really good one. I like line numbers normally since it allows me to restart long programs the next morning if I have a part on the machine at the end of the day, but since that wouldn't be the case in this instance, and it is a short program to boot it would work well for this.

On the same vein how do you do a restart in a program like this skipping to say the fourth repeat on the second sub? Would you just edit the program x,y start and decrease the repeats, or is there a better way?

Originally Posted by HuFlungDung View Post
Scott,
Are you familiar with the M97 local sub call? If your subroutines are unique to each main program, it is probably more convenient to just load the subs in after the main program's M30. That way, there is no worrying about having program numbers available, because the subroutines exist within one program.

The calling of a subroutine is basically the same except that you use an M97 in place of the M98. The P address called is simply a line number at the start of the sub. I do not otherwise use line numbers in my programs for anything except subroutine addresses, so this allows me to use a simple addresses like N100, N200 etc, without using an editor to discover what the literal line number might be, or worrying if the line number has changed after an edit. But you can use whatever you like.

The subroutines are not named with a Ooooo program number.
__________________
Suppose you were an idiot and suppose you were a member of Congress. But I repeat myself.
Mark Twain
Reply With Quote

  #9  
Old 11-27-2007, 08:42 AM
HuFlungDung's Avatar
Moderator
 
Join Date: Mar 2003
Location: Canada
Posts: 4,825
HuFlungDung is on a distinguished road

I don't know of a surefire method to get to the middle of a repeat easily with minimal programming. If you think it will be a frequent occurance, then I suppose you should expand the number of fully written out calls to the sub within the main program, either eliminating the repeats altogether, or at least allowing you to get closer to where you want to be, with less air cutting time.
__________________
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

  #10   Ban this user!
Old 11-27-2007, 09:13 AM
Shotout's Avatar  
Join Date: Jun 2006
Location: USA
Age: 38
Posts: 443
Shotout is on a distinguished road

Originally Posted by HuFlungDung View Post
I don't know of a surefire method to get to the middle of a repeat easily with minimal programming. If you think it will be a frequent occurance, then I suppose you should expand the number of fully written out calls to the sub within the main program, either eliminating the repeats altogether, or at least allowing you to get closer to where you want to be, with less air cutting time.
I've made about 5 of these in the last year so I could just go on a case by case basis. Most of the hours in making this part and the two slotted bars that goes with it is actually blanking the material to the dimensions anyway.

Thanks Hu
__________________
Suppose you were an idiot and suppose you were a member of Congress. But I repeat myself.
Mark Twain
Reply With Quote

Sponsored Links
  #11   Ban this user!
Old 11-27-2007, 09:15 AM
 
Join Date: Jul 2005
Location: Canada
Posts: 11,565
Geof will become famous soon enough

Originally Posted by Shotout View Post
....On the same vein how do you do a restart in a program like this skipping to say the fourth repeat on the second sub? Would you just edit the program x,y start and decrease the repeats, or is there a better way?
Practically every program I write has subroutines because I put every tool in its own subroutine; most of my programs work on multiple parts and this way I can edit a program onto a different machine with a different number of vises.

The subroutine calls are all near the top of what I designate the main part of the program and all it does is set the work zero and then call the sub so the structure is like this for three work zeroes and three tools:

Name
(Part description)
Bunch of stuff
G54 M97 P1000
/G55 M97 P1000
/G56 M97 P1000
--------
G54 M97 P2000
/G55 M97 P2000
/G56 M97 P2000
---------
G54 M97 P3000
/G55 M97 P3000
/G56 M97 P3000
---------
Bunch of stuff
M30
---------
N1000
T1M06
Tool 1 operations
M99
----
N2000
T2M06
Tool 2 operations
M99
----
N2000
T3M06
Tool 3 operations
M99
----

Restart can be done anywhere, at any line within a subroutine or at the M97 command. If the restart is done in the subroutine the control uses the first subroutine call as the reference. In other words if I put in the restart on tool 2 right on the T2M06 line it would do the G54 location and continue from there. If I want to start in one of the other work zeroes the restart has to be done at the M97 line so a restart for tool 3 in G56 would start at G56 M97 P3000.

The block deletes are to shut out the second and third work zeroes during setup so all the wear settings can be adjusted before doing multiple parts.

I find this system convenient because line numbers match the tool number and it is easy to jump down to any part of the program. For instance the spindle on command is always the second or third line in the sub. Additional subroutine calls within the main subroutines use P1100, P1200 etc.

You comment on a 3/4 page program. I have some that are about 600 lines just for the work zero designation and subroutine calls working with 11 tools at 32 different work zeroes with some work zeroes used at different angular positions on a rotating fixture. These were fun to write but one took a 45 minute part using three separate programs and fixtures down to just under 8 minutes and I have recouped the fifteen hours I spent combining the three existing programs many times over. Also recouped the ten days it took to build the fixture.
__________________
An open mind is a virtue...so long as all the common sense has not leaked out.
Reply With Quote

  #12   Ban this user!
Old 11-27-2007, 10:14 AM
Shotout's Avatar  
Join Date: Jun 2006
Location: USA
Age: 38
Posts: 443
Shotout is on a distinguished road

Originally Posted by Geof View Post
Practically every program I write has subroutines because I put every tool
Geof,
I see the benefit of using ea. as a sub so you can use run multiple parts at once plus any edit for one part is translated into the others by default, plus it keeps one tooling op going at once for ea. part so you don't waste a lot of time on tool changes. Could be pretty easy to edit some of my existing programs using multiple offsets to make them more effecient. It took things in a direction that hadn't occured to me yet. Working by myself in my situation leaves me feeling like I'm reinventing the wheel at times.

Your comment on increased effiecency on the mutlisetups hits home. One thing I'm always worried about it cumilative tolerance errors with multiple setups. As I learn more this format will become more practical for me. Right now I'm settled on a pretty simple setup and program much like Hu suggested, but your example puts me in mind of an example I read. 100,000,000 holes in a grid pattern. A simple program with 6 lines and two subs (one per tool) of 11 and 10 lines each. Long hand it would take approximately 19yrs uninterupted to write.

Hu,
I think this is going to work well as you suggested I changed them to all subroutines using the haas manual to check my formating. It graphs well and checks against my print. Just couldn't make myself take that g90 out of the saftey line or seperate that g91 g28 z0.0 just looks wrong and bothers me. did seperate the other g91s as you suggested though.

Thanks
scott
%
O5000 (CTRC CUTTER BAR CAVITIES)
(T01- D1.5IN SINGLE PT CUTTER CCW ROTATION)
(MATERIAL- S7 TOOL STEEL)
G20 G40 G49 G90
M6 T01 G43 H01
G0 G54 X-3.125 Y-3.25 M04 S670
G0 Z.25 M08
M97 P0100 L10
M97 P0200 L11
M09
M05
G91 G28 Z0.00
M00 (INDEX STOCK DOWN ON FIXTURE)
G90
G0 X-3.125 Y-3.25
M04 S670
G0 Z.25 M08
M97 P0100 L10
M97 P0200 L10
M09
M05
G91 G28 Z0.0
M30

N0100(CTRC CUTTER BAR SUB01)
G91
G1 Y0.076 F10.0
Z-2.75 F2.7
Y-.076 F10.0
G0 Z2.75
Y0.076
M99

N0200(CTRC CUTTER BAR SUB02)
G91
G0 X-1.875 Y-.76
M98 P7001 L10
M99
%
__________________
Suppose you were an idiot and suppose you were a member of Congress. But I repeat myself.
Mark Twain

Last edited by Shotout; 11-27-2007 at 10:15 AM. Reason: forgot to paste code
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
Help tring to cut hex using c x moves DryRun G-Code Programing 7 09-30-2007 05:15 AM
Graph problem afterburn25 Haas Mills 2 04-12-2007 08:38 AM
Rapid moves G00 dicksonhof Mach Software (ArtSoft software) 9 11-07-2006 09:21 AM
Z position moves up during run henryj1951 Gecko Drives 3 03-27-2006 05:16 PM
Traffic Ranking Graph cbcnc Forum Questions or Problems 3 06-20-2004 03:52 PM




All times are GMT -5. The time now is 06:46 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