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 > Parametric Programing


Parametric Programing (custom macro b, fadal macro, okuma user task)


This forum is sponsored by:

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Ban this user!
Old 06-18-2005, 08:19 PM
 
Join Date: Jun 2005
Location: USA
Posts: 53
PROTOTRAKFAN is on a distinguished road
Help Making Sub Routines

Could someone please give me an example of using an M98 or, M99 coupled with a "P" and "L". Just a short example would do - like profiling a rectangle and using a subroutine to step the cutter down -ie. "rough depths". Another example I am looking for is to use a subroutine to drill a series of holes. My control supports the RS 274 format. Any help would be appriciated.....
Patrick
Tweet this Post!Share on Facebook
Reply With Quote

  #2   Ban this user!
Old 06-18-2005, 08:38 PM
Karl_T's Avatar  
Join Date: Mar 2004
Location: Dassel,MN,USA
Posts: 1,308
Karl_T is on a distinguished road

Below are some examples:

(Call a simple subroutine and repeat the subroutine 3 times.)
N1 G0 X0 Y0 Z0
N2 M98 P1234 L3
N3 M30
O1234
N4 G1 Z-.5 F25
N5 G0 Z.1
N6 M99

(Use a subroutine to loop the entire program 100 times.)
N1 M98 P1234 L100
N2 M30
O1234
N4 G0 X0 Y0 Z0
N5 G1 Z-.5 F25
N6 G0 Z.1
N7 M99

(Nested subroutines)
N1 G0 X0 Y0 Z0
N2 M98 P1234 L1
N3 M30
O1234
N4 G0 X1 Y1 Z1
N5 M98 P5678 L1
N6 M99
O5678
N7 G1 Z-.5 F25
N8 G0 Z.1
N9 M99

Karl
Tweet this Post!Share on Facebook
Reply With Quote

  #3   Ban this user!
Old 06-18-2005, 09:40 PM
 
Join Date: Jun 2005
Location: USA
Posts: 53
PROTOTRAKFAN is on a distinguished road

Karl,
Thank you for the quick response and the clear-cut reply. Now if I may ask one more question? Can I switch into G91 programing from G90 programing in order to get the "stepping" effect. If so how would the code look. By the way I made a mistake my manual lists M79 (Send SWI '0' (ascii 79) commands ,value in "P" WORD) . Also it lists M98 as Subroutine call to block (PWORD), repeat (LWORD). Thank you for any help....
Patrick

Last edited by PROTOTRAKFAN; 06-18-2005 at 11:17 PM.
Tweet this Post!Share on Facebook
Reply With Quote

  #4   Ban this user!
Old 06-18-2005, 11:14 PM
 
Join Date: Mar 2005
Location: canada
Posts: 57
gibbsman is on a distinguished road

The example given did not specify a work coordinate system eg. G54, 55 etc. therefore the code would look the same for G91 (incremental).The only thing that changes between G90 and G91 programs are the X,Y and Z values.
Tweet this Post!Share on Facebook
Reply With Quote

  #5   Ban this user!
Old 06-19-2005, 12:09 AM
Karl_T's Avatar  
Join Date: Mar 2004
Location: Dassel,MN,USA
Posts: 1,308
Karl_T is on a distinguished road

Here's a program to cut holes in a piece of 6" wide stock to hold R8 tooling. Makes use of switching from G90 to G91 and back.


:Cut holes in 6" channel for R8 holders

(*BLEC'*',CMST';',CNDL3,CNDR4,ZRSP0,PDOF0.05,FDOV0*)

%count = 0 *;counter for looping

; Circle - Coordinate Start Point Type
G90 G40 F2.0 *; ABSOLUTE,NO CUTTER COMP, FEED RATE
T01 *; TOOL 1

%LOOP: *;loop to here
%count = %count + 1



G73 Y 1.0 Z-0.50 Q 0.060 F 2.0 *; DRILL HOLE AT 0,1
G00 Z -0.5 *; BACK TO BOTTOM OF HOLE
G01 G91 G42 T 01 X0.0 Y0.485 *; INCREMENTAL,CUTTER COMP RIGHT,TOP OF CIRCLE
G02 X0.0 Y 0.0 I 0.0 J -0.485 F 4.0 *;CIRCLE, change radius line up also for new size
G90 G40 G00 Z0.0 *;ABSOLUTE,,NO CC,RAPID UP

G73 Y 3.0 Z-0.50 Q 0.060 F 2.0 *; DRILL HOLE AT 0,1
G00 Z -0.5 *; BACK TO BOTTOM OF HOLE
G01 G91 G42 T 01 X0.0 Y0.485 *; INCREMENTAL,CUTTER COMP RIGHT,TOP OF CIRCLE
G02 X0.0 Y 0.0 I 0.0 J -0.485 F 4.0 *;CIRCLE, change radius line up also for new size
G90 G40 G00 Z0.0 *;ABSOLUTE,,NO CC,RAPID UP

G73 Y 5.0 Z-0.50 Q 0.060 F 2.0 *; DRILL HOLE AT 0,1
G00 Z -0.5 *; BACK TO BOTTOM OF HOLE
G01 G91 G42 T 01 X0.0 Y0.485 *; INCREMENTAL,CUTTER COMP RIGHT,TOP OF CIRCLE
G02 X0.0 Y 0.0 I 0.0 J -0.485 F 4.0 *;CIRCLE, change radius line up also for new size
G90 G40 G00 Z0.0 *;ABSOLUTE,,NO CC,RAPID UP

G00 Y0.0 *;BACK TO HOME
G91 G00 X2.0 *;INCREMENTAL, MOVE 2.0 FOR NEXT ROW OF HOLES


IF (%COUNT LE 10) GOTO %LOOP *;LOOP 10 TIMES
Tweet this Post!Share on Facebook
Reply With Quote

Sponsored Links
  #6   Ban this user!
Old 06-19-2005, 12:39 AM
 
Join Date: Jun 2005
Location: USA
Posts: 53
PROTOTRAKFAN is on a distinguished road

Thank you Karl for the great example. A long time ago (8 years) I was starting to get into the groove of programing a Sharnoa machining center with parametric programing but, I quit that job for a better one and since then have forgotten alot. The Prototrak I use (DPM V5) is quite honestly a pleasure to use everyday. It can be programed with Gcodes in addition to conversational programing. When I have a very complex job I use OneCnc Expert and havnt had any problems. I would like to increase my skills in manual Gcode programing ,however, and that is why I am asking these questions. The machine doesnt have work offsets on the Gcode side- It does have 6 of them on the conversational side though. Anyway thanks again.....
Patrick
Tweet this Post!Share on Facebook
Reply With Quote

  #7   Ban this user!
Old 06-25-2005, 10:00 PM
 
Join Date: Jun 2005
Location: USA
Posts: 53
PROTOTRAKFAN is on a distinguished road
Is this okay?

I have been busy this week and my machine has been tied up so I havnt gotten a chance to try out a test subroutine. I have made one and hopefully have attached it correctly. Did I make the subroutine correctly? My objective is to edit cam programs so that I only have to program a profile or, a pocket level "once" then use subroutines to "step down" the depths. I have another question not related to subroutines. Can I program a helix to ramp a tool down in a pocket and then connect it to the pockets first G01 move so that the tool stays "down".....
Patrick
Tweet this Post!Share on Facebook
Reply With Quote

  #8   Ban this user!
Old 07-14-2008, 07:09 PM
 
Join Date: Jan 2008
Location: usa
Posts: 58
gravy is on a distinguished road
step down

#100=1. (Full Depth)
#101=.25 (Depth Increment)
#102=0

N1
#102=[#102+#101}
IF[#102GE#100]THEN[#102=#100]
G01 Z-#102 F1.

*****CUT POCKET OR PROFILE********

G0 Z.1
IF[#102NE#100]GOTO1


I think this would work in Macro B.

Last edited by gravy; 07-15-2008 at 05:14 PM.
Tweet this Post!Share on Facebook
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
Making money with CNC Johnuk CNCzone Club House 26 12-13-2009 11:46 AM
Mold making with Deskcam Jon D Carken Products (Deskam, DeskCNC etc) 2 02-08-2007 04:41 PM
What are people making with there cnc plasma tables? Apples CNC Plasma and Waterjet Machines 9 01-09-2007 08:57 PM
Pictorial Guide to Making PCB (DIY) abasir General Electronics Discussion 31 08-18-2005 12:14 AM
Anyone Know a know of a good book for mill, tool making? sendkeys General Metalwork Discussion 6 11-01-2004 10:56 PM




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