![]() | |
| Home Page | Mark Forums Read | Today's Posts | My Replies | Classifieds | Reviews | Photo Gallery | Web Links | Share Files | Advertise With Us | Ad List |
| |||||||
| Parametric Programing (custom macro b, fadal macro, okuma user task) |
| This forum is sponsored by: |
![]() |
| | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
| |||
| |||
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 % |
|
#2
| |||
| |||
| 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. |
|
#3
| |||
| |||
| 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 % |
|
#4
| |||
| |||
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. |
|
#5
| |||
| |||
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. |
| Sponsored Links |
|
#6
| |||
| |||
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 |
|
#7
| |||
| |||
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. |
|
#9
| |||
| |||
| 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 % |
|
#10
| |||
| |||
| 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 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. |
| Sponsored Links |
|
#12
| |||
| |||
| 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
__________________ Control the process, not the product! Machining is more science than art, master the science and the artistry will be evident. |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
| |
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 |