![]() | |
| 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
| |||
| |||
| Hello everyone, this is my 1st Post so Hello #1. I'm new to Macros and am programming a takisawa using an older Fanuc control.What series,Don't know? Anyways I'm using th "WHERE" DO1 and END1 in a facing routine in a very small part and it is looping, but it doesn't come out of the loop? I know I'm doing something very small that needs to be changed. All I've read is Shmitz's book on Macros and jumping in and started writing. I've got this far and know I'm having trouble.If someone can help please let me know and I can send the program. Thx gtrrpa |
|
#2
| ||||
| ||||
| Ello mate, and welcome to the boards. I'm sure someone will correct me if I'm wrong- folk know a lot here, but... Are you sure the "WHERE" command is right.. isn't it "WHILE" eg: WHILE [#00LT#101]DO1 ... ... END1 I'm not too sure about your particular settup and only have a couple of mins before I leave work.. will look at it more tomorrow, sorry I only have a couple of mins to spare, but I'm sure the conditional loop is "WHILE" not "WHERE"? Search on here or Google the Web for the rather excellent Macro Programming guide by Scott Martinez, but I dunno if this pertains to your particular settup. Also.. beware of global and local variables- some change with every call or exit from a subroutine (some stay the same). Will post more tomorrow, and welcome here again!
__________________ I love deadlines- I like the whooshing sound they make as they fly by. |
|
#5
| |||
| |||
| % :O6807(LG M.C. C/B.843) G28U0W0 #1=#26 #1=-.1 #3=#1+.002 T0303(FACE) G97 G99 M03S850 /M08 G0X.1 G0Z.02 G1F.01Z[#1+.015] WHILE[#1+.015GE[#1+.002]]DO 3 G1F.01W-.007 G1F.002X.84 G1G99F.002W.005 F.01X.1 END 3 G0Z4. M01 M30 % Dont forget, I'm in a counterbore with a .105 bore. Gong to finish c/bore at .843 dia. THX all for the help................. Last edited by gtrrpa; 06-04-2008 at 06:37 PM. Reason: spelling add on |
| Sponsored Links |
|
#7
| |||
| |||
Have all sorts of parts where the Z depth changes on the c/bore and want to have the operator only change value of #1, which will have a note stateing that this will be Z depth.of other parts. This is the reason to stay away .002 from bottom of c/bore to take 2 passes of .001 because the intersection of the bore and the wall of the face of the c/bore has to be very sharp. Any other Ideas? |
|
#10
| ||||
| ||||
| Right, I'm by no means an expert at Macro programming, but if I recall correctly when you call a subroutine the variables are reset. So in your line WHILE[#1+.015GE[#1+.002]]DO 3 #1 will start as zero and so the Greater than or Equal to statement will always be true and the loop will never end. To pass variables into a sub- routine I think you need to use the G65 command. Hang on.... might be a simpler solution...Try something for me please? instead of using variables #1 and #3 change these to #101 and #103- that should work since anything from #100 to #999 are Common Variables and, unlike Local Variables (#1 to #99), retain their values on entering and exiting to/ from a sub- routine. Variables #1 to #99 get reset on every subroutine call, so your conditional loop will (I think) always be true cos #1 will always start at zero. PS- don't mess about with #0, it cannot be set and is neither zero or anything, it's always empty (not zero, but empty) Also! don't mess with variables #1000 to #5999- unless you know what your up to LOL.
__________________ I love deadlines- I like the whooshing sound they make as they fly by. |
| Sponsored Links |
|
#11
| |||
| |||
| I suggest changing to the common variables like Imancarrot mentioned but you might want to change your while statement to this. WHILE[[#1+.015]GE[#1+.002]]DO 3
__________________ No matter how good you are, there is always someone better!!! |
|
#12
| ||||
| ||||
| Chris is right, that is neater. But, it still won't work cos of the passing of variables from the main program to the sub- routine. You need to change variable #1 and #3 to #101 and #103 (or whatever # as long as it aint #0 or anything between #1000 to #5999). Variables #100 to #999 will keep their values on a subroutine call. I beleive that's where your problem is- the conditional loop will never end 'cos the value in #1 is not getting passed from the main program to the sub- routine and so variable #1 is always zero on entering the sub- routine and hence your conditional WHILE is always TRUE. Every time you call or return a subroutine the (local) #variable will be reset to zero UNLESS you G65 the variables prior to the start of the program which allows keeping their values (system variables). Even nested loops will reset the variable at that level of sub- routine My second suggestion in my previous post will work (ie: change the variables to above #99)... I think! but again, I'm not an expert. I would definately use Chris's format for the equation- it's neater and simpler and intuitively right. Yours would probably work ok, but best to cover all the bases. Please let us know if this works? If it does, you owe me a beer, lol: my mates down the pub at lunchtime were accusing me of being a workaholic as I scribbled over my notes with a pint of Stella ![]() I'll try and find a link to Scott Martinez's excellent explanation of Macro Programming. It's incredibly good.
__________________ I love deadlines- I like the whooshing sound they make as they fly by. |
![]() |
| 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 |
| Newbie here, can anybody explain what "swing", etc. means? | squale | Mini Lathe | 4 | 11-09-2007 12:59 PM |
| tracking down MDI "hang" with loops & macros | howling60 | CamSoft Products | 7 | 03-02-2006 03:28 PM |
| How about a seperate "Linear motion" forum | rashid11 | Suggestions for the CNCzone.com site. | 3 | 06-03-2005 07:01 PM |