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-22-2011, 12:42 PM
 
Join Date: Nov 2005
Location: usa
Posts: 227
camtd is on a distinguished road
M98 Looping

I was wondering if there is a way to add a statement to have the flexibilty of having the G91 C30. start at another location if wanted in the loop?

Ex. Start a C90 position instead of from the beginning. I have a example below.

I am trying to work around my Cam system and post not being able to post a G66 which is my machining info and a M98 which is my positon info.

%
O1000
N10 G54 X0 Y0 Z5.0
N20 (TOOL-2-.125-FINISH-ENDMILL)
N30 T2
N40 M6
N50 M8
N60 G90 G17 G0 X2.0878 Y.2118 C0. S3820 M3
N70 G43 Z5. H2
N80 M98 P5 L5
N90 M9
N100 G91 G28 Z0
N110 M30
N120

O5
N10 ( SUB NUMBER: 5 )
N20 ( OPERATION 6: CONTOUR )
N30 G91 C30.
N40 G90 G0 X2.0878 Y.2118
N50 Z1.228
N60 G1 Z1.063 F10.
N70 G41 X2.0035 Y.2656 D52
N80 X1.9439 Y.3037
N90 X1.9369 Y.3021 F20.
N100 X1.9298 Y.3004
N110 X1.9227 Y.2973
N120 X1.9086 Y.2875
N130 X1.9026 Y.2826
N140 X1.8985 Y.2755
N150 X1.8943 Y.2684
N160 X1.8921 Y.2613
N170 X1.8895 Y.2331
N180 X1.8899 Y.226
N190 X1.904 Y.0069
N200 X1.9042 Y-.0002
N210 X1.9039 Y-.0072
N220 X1.8899 Y-.2264
N230 X1.8895 Y-.2334
N240 X1.8921 Y-.2617
N250 X1.8945 Y-.2686
N260 X1.9028 Y-.2829
N270 X1.9086 Y-.2875
N280 X1.9227 Y-.2973
N290 X1.9298 Y-.3004
N300 X1.9369 Y-.3021
N310 X1.9439 Y-.3037
N320 X2.0036 Y-.2657
N330 G40 X2.0879 Y-.2119
N340 G0 Z5.
N350 M99
%
Reply With Quote

  #2   Ban this user!
Old 06-22-2011, 03:45 PM
 
Join Date: Feb 2008
Location: The Edge of Obscurity
Posts: 229
ProProcess is on a distinguished road

Instead of C30. you could say C#100 and set #100 to whatever you would like.
__________________
Control the process, not the product!
Machining is more science than art, master the science and the artistry will be evident.
Reply With Quote

  #3   Ban this user!
Old 06-23-2011, 02:29 PM
 
Join Date: Nov 2005
Location: usa
Posts: 227
camtd is on a distinguished road

This is what I came up with so far. I am reading and trying things as I go. I was wondering if there is a way to clearout the angle offset after it is used once? I am not sure of the format I would need.

Thank You

%
O0001 ( TEST )
N10 ( DATE - 23-06-11 TIME - 13:34 )
N20 G20
N30 G0 G17 G40 G80 G90 G94 G98
N40 G0 G28 G91 Z0.
N50 G0 G28 X0. Y0.
( ENDMILL-.750 )
N70 T3
N80 M6
N90 G0 G54 G90 X2.3232 Y.1768 C0. B0. S203 M3
N100 G43 H3 Z.25 M8
N110 Z.2
( F=ANGLE-OFFSET-TO-RESTART-WHERE-NEEDED-0.0-IS-DEFAULT )
N120 G65 P1001 L4 A15.0 F0.0
N200 M9
N210 M5
N220 G0 G28 G91 Z0.
N230 G0 G28 X0. Y0.
N240 G28
N250 M30
( SUBPROGRAM-MILL-4-HOLES )
O1001
N090 #102=#7
N100 #101=#1
N110 G91 C#101+#102
N115 G90
N120 G1 Z-1.5 F6.
N130 G3 X2.25 Y0. I.1768 J-.1768 F.81
N140 X2.5 Y-.25 I.25
N150 X2.75 Y0. J.25
N160 X2.5 Y.25 I-.25
N170 X2.3232 Y.1768 J-.25
N180 G1 Z-1.3 F100.
N190 G0 Z.25
M99
%
Reply With Quote

  #4   Ban this user!
Old 06-27-2011, 08:48 AM
 
Join Date: Feb 2008
Location: The Edge of Obscurity
Posts: 229
ProProcess is on a distinguished road

Originally Posted by camtd View Post
This is what I came up with so far. I am reading and trying things as I go. I was wondering if there is a way to clearout the angle offset after it is used once? I am not sure of the format I would need.

Thank You

%
O0001 ( TEST )
N10 ( DATE - 23-06-11 TIME - 13:34 )
N20 G20
N30 G0 G17 G40 G80 G90 G94 G98
N40 G0 G28 G91 Z0.
N50 G0 G28 X0. Y0.
( ENDMILL-.750 )
N70 T3
N80 M6
N90 G0 G54 G90 X2.3232 Y.1768 C0. B0. S203 M3
N100 G43 H3 Z.25 M8
N110 Z.2
( F=ANGLE-OFFSET-TO-RESTART-WHERE-NEEDED-0.0-IS-DEFAULT )
N120 G65 P1001 L4 A15.0 F0.0
N200 M9
N210 M5
N220 G0 G28 G91 Z0.
N230 G0 G28 X0. Y0.
N240 G28
N250 M30
( SUBPROGRAM-MILL-4-HOLES )
O1001
N090 #102=#7
N100 #101=#1
N110 G91 C#101+#102
N115 G90
N120 G1 Z-1.5 F6.
N130 G3 X2.25 Y0. I.1768 J-.1768 F.81
N140 X2.5 Y-.25 I.25
N150 X2.75 Y0. J.25
N160 X2.5 Y.25 I-.25
N170 X2.3232 Y.1768 J-.25
N180 G1 Z-1.3 F100.
N190 G0 Z.25

#7=0(SET OFFSET TO 0 FOR SUBSEQUENT ITERATIONS)

M99
%
See the red text above, this would set it to 0 at the end of the first loop.
To clear a variable i.e make it's value empty you would set it to #0.
HTH
Good luck
__________________
Control the process, not the product!
Machining is more science than art, master the science and the artistry will be evident.
Reply With Quote

  #5   Ban this user!
Old 06-27-2011, 08:59 AM
 
Join Date: Dec 2004
Location: U.K.
Posts: 143
TURNER is on a distinguished road

Originally Posted by camtd View Post
This is what I came up with so far. I am reading and trying things as I go. I was wondering if there is a way to clearout the angle offset after it is used once? I am not sure of the format I would need.

Thank You

%
O0001 ( TEST )
N10 ( DATE - 23-06-11 TIME - 13:34 )
N20 G20
N30 G0 G17 G40 G80 G90 G94 G98
N40 G0 G28 G91 Z0.
N50 G0 G28 X0. Y0.
( ENDMILL-.750 )
N70 T3
N80 M6
N90 G0 G54 G90 X2.3232 Y.1768 C0. B0. S203 M3
N100 G43 H3 Z.25 M8
N110 Z.2
( F=ANGLE-OFFSET-TO-RESTART-WHERE-NEEDED-0.0-IS-DEFAULT )
N120 G65 P1001 L4 A15.0 F0.0
N200 M9
N210 M5
N220 G0 G28 G91 Z0.
N230 G0 G28 X0. Y0.
N240 G28
N250 M30
( SUBPROGRAM-MILL-4-HOLES )
O1001
N090 #102=#7
N100 #101=#1
N110 G91 C#101+#102
N115 G90
N120 G1 Z-1.5 F6.
N130 G3 X2.25 Y0. I.1768 J-.1768 F.81
N140 X2.5 Y-.25 I.25
N150 X2.75 Y0. J.25
N160 X2.5 Y.25 I-.25
N170 X2.3232 Y.1768 J-.25
N180 G1 Z-1.3 F100.
N190 G0 Z.25
M99
%
Hi Camtd,
Or you could still use M98 (i think like this )

%
O0001 ( TEST )
N10 ( DATE - 23-06-11 TIME - 13:34 )
N20 G20
N30 G0 G17 G40 G80 G90 G94 G98
N40 G0 G28 G91 Z0.
N50 G0 G28 X0. Y0.
( ENDMILL-.750 )
N70 T3
N80 M6
N90 G0 G54 G90 X2.3232 Y.1768 C0. B0. S203 M3
N100 G43 H3 Z.25 M8
N110 Z.2

#500=0( START ANGLE-OFFSET-TO-RESTART-WHERE-NEEDED-0.0-IS-EFAULT)
#501=20.0( PITCH)
#502=4( REPEATS )

N120 M98 P1001 L#502

N200 M9
N210 M5
N220 G0 G28 G91 Z0.
N230 G0 G28 X0. Y0.
N240 G28
N250 M30



( SUBPROGRAM-MILL-4-HOLES )
O1001
N110 G91 C#501
N115 G90
N120 G1 Z-1.5 F6.
N130 G3 X2.25 Y0. I.1768 J-.1768 F.81
N140 X2.5 Y-.25 I.25
N150 X2.75 Y0. J.25
N160 X2.5 Y.25 I-.25
N170 X2.3232 Y.1768 J-.25
N180 G1 Z-1.3 F100.
N190 G0 Z.25
M99
%

Just edit the values in green.
Good luck,
Keith.
Reply With Quote

Sponsored Links
  #6   Ban this user!
Old 06-30-2011, 12:06 PM
 
Join Date: Nov 2005
Location: usa
Posts: 227
camtd is on a distinguished road
Both options are great

I did not expect to learn so much.

I seems when I read the books my eyes get a glaze over them and I just get more confused.

How would a statement look if I wanted to say
If #500 in not equal to #501/360 then print a error on the screen "starting angle not dividable by 360 degrees"

Thank You
Reply With Quote

  #7   Ban this user!
Old 06-30-2011, 12:44 PM
 
Join Date: Feb 2008
Location: The Edge of Obscurity
Posts: 229
ProProcess is on a distinguished road

Originally Posted by camtd View Post
I did not expect to learn so much.

I seems when I read the books my eyes get a glaze over them and I just get more confused.

How would a statement look if I wanted to say
If #500 in not equal to #501/360 then print a error on the screen "starting angle not dividable by 360 degrees"

Thank You
Explain a little more about what you want.
What do you not want #501 to be?
I am assuming that you do not want fractional angle such as #501=32.423
But you know what "they" say about assuming.
__________________
Control the process, not the product!
Machining is more science than art, master the science and the artistry will be evident.
Reply With Quote

  #8   Ban this user!
Old 06-30-2011, 02:44 PM
 
Join Date: Nov 2005
Location: usa
Posts: 227
camtd is on a distinguished road

I would like #501 to be 15 degrees
Reply With Quote

  #9   Ban this user!
Old 07-01-2011, 08:05 AM
 
Join Date: Nov 2005
Location: usa
Posts: 227
camtd is on a distinguished road

I added what I think is all but the one thing which is to make sure the distance is divisible by 15 in the correct way.

Thank You

%
O0001 ( TEST )
N10 ( DATE - 23-06-11 TIME - 13:34 )
N20 G20
N30 G0 G17 G40 G80 G90 G94 G98
N40 G0 G28 G91 Z0.
N50 G0 G28 X0. Y0.
( ENDMILL-.750 )
N70 T3
N80 M6
N90 G0 G54 G90 X2.3232 Y.1768 C0. B0. S203 M3
N100 G43 H3 Z.25 M8
N110 Z.2

#500=0( START ANGLE-OFFSET-TO-RESTART-WHERE-NEEDED-0.0-IS-DEFAULT)
N120 M98 P1001 L#502

N200 M9
N210 M5
N220 G0 G28 G91 Z0.
N230 G0 G28 X0. Y0.
N240 G28
N250 M30



( SUBPROGRAM-MILL-4-HOLES )
O1001

#501=20.0( PITCH)
#502=4( REPEATS )
#503=15/360 (NOT SURE WHAT LOGIC TO PUT HERE
IF[#500NE#503] GOTO N777
N777
M5
#3000= (MODIFED POSTION IS NOT CORRECT)


N110 G91 C#501
N115 G90
N120 G1 Z-1.5 F6.
N130 G3 X2.25 Y0. I.1768 J-.1768 F.81
N140 X2.5 Y-.25 I.25
N150 X2.75 Y0. J.25
N160 X2.5 Y.25 I-.25
N170 X2.3232 Y.1768 J-.25
N180 G1 Z-1.3 F100.
N190 G0 Z.25
M99
%
Reply With Quote

  #10   Ban this user!
Old 07-01-2011, 08:58 AM
 
Join Date: Feb 2008
Location: The Edge of Obscurity
Posts: 229
ProProcess is on a distinguished road

A few things,
You've moved this...

Code:
#501=20.0( PITCH)
#502=4( REPEATS )
#503=15/360      (NOT SURE WHAT LOGIC TO PUT HERE
into the sub program but it needs to be in the main program ahead of the M98 call.
Otherwise the number of repeats will not be read on your first time through the loop because #502 is not set untill you're in the sub program.
Too the logoic will be fired on every iteration of the loop, which is usually not necessary or desired.

Now onto the error trapping...
Do you want the offset angle to be limited to 15° or divisibile by 15°.
__________________
Control the process, not the product!
Machining is more science than art, master the science and the artistry will be evident.
Reply With Quote

Sponsored Links
  #11   Ban this user!
Old 07-01-2011, 09:01 AM
 
Join Date: Nov 2005
Location: usa
Posts: 227
camtd is on a distinguished road

I would like it divisible by 15.

Thanks
Reply With Quote

  #12   Ban this user!
Old 07-01-2011, 09:14 AM
 
Join Date: Feb 2008
Location: The Edge of Obscurity
Posts: 229
ProProcess is on a distinguished road

Originally Posted by camtd View Post
I would like it divisible by 15.

Thanks

Code:
#503=#500 MOD 15
IF[#500EQ0]GOTO777(I ASSUME 0 IS OK TO USE)
IF[#503EQ0]GOTO777(NO REMAINDER/DIVISIBLE BY 15)
#3000=1(#500 IS NOT 0 OR DIVISIBLE BY 15)
N77730
I did not test this on a machine but it should be good
__________________
Control the process, not the product!
Machining is more science than art, master the science and the artistry will be evident.
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
Parametric Looping problem gtrrpa Parametric Programing 12 11-15-2010 05:03 PM
Looping command? rigo430 Haas Lathes 1 04-11-2010 05:35 PM
LOOPING? with Camsoft?? nelZ CamSoft Products 15 10-15-2008 03:56 PM
Program Looping Bohemund CamSoft Products 7 05-26-2007 11:08 AM
Sub Looping murphyspost Daewoo/Doosan 8 12-27-2006 10:28 AM




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