![]() | |
| 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
| ||||
| ||||
Have been messing around with my Doomsday Macro and have found something peculiar...if I try to pass too many arguments the values start getting mislaid. More specifically, I and J seem to be being ignored/lost and U value ends up where D should be. This seems to occur when I specify 10+ arguments. This has had me scratching my head and looking for a problem in the logic, though it did force me to tidy up the program..which is a good thing. Thought I had solved the problem by transferring the values to the common variables before doing any calculations - but apparently not. The only way I have found around it is to place the arguments in a specific order (specify I and/or J first) at the macro call. All other arguments go through okay in both cases, even when I specify the maximum 21... Wondered if anyone had come across this and knew a) why it happens and b) a way around it? I don't wan't to have to worry about keeping exactly the right format for every combination of arguments. (Fanuc 31i) DP |
|
#2
| |||
| |||
"Addresses do not need to be specified alphabetically. They conform to word address format. I, J, and K need to be specified alphabetically, however." Maybe the U and D switch has to to with the "word address format". Make a toll free call to Fanuc. I have to think they could tell you why. |
|
#3
| |||
| |||
| I always write local variables to common almost straight away in the sub call. The only thing i do 1st is clear all the common variables. I tend to always use #700-#800 and run a quick while loop to set these to #0 At least your be sure it's not picking up any old info |
|
#4
| ||||
| ||||
Will let you know my findings... DP |
|
#6
| ||||
| ||||
| Cheers for that - it does seem to explain that if the arguments are not ordered correctly then values start getting assigned to alternate variable nos. Putting I J K in correct order definitely solves all the confusion, and its nice to know there is a reason behind it. I wonder if anyone uses argument specification type II and if it has any advantages - and I wonder if I could use it to pass more than 21 arguments over - but to be honest, I think its probably best to leave it well alone for the time being! Thanks again DP |
|
#7
| |||
| |||
| There is no need to use argument specification II unless you want to pass values to more than 21 (up to 33) variables. Type I is better for common applications because you can choose meaningful letters, for example F for feed, S for spindle speed, A for angle, R for R-point level, and so on. Then you do not have to remember what is F, S, A... Type II has a very specific use, when you want to pass 3D coordinates of several points. So, it would be (I1 J1 K1) (I2 J2 K2) ..., indicating coordinates of first and second point, respectively. Obviously, type I would be too clumsy here. |
|
#8
| ||||
| ||||
| Right, reading your attachment again it looks like I1 J1 K1 refer to #4 #5 #6. I2 J2 K2 (the ones I had inadvertantly invoked, like an ancient evil) refer to #7 #8 #9. I3 J3 K3 to #10 #11 #12 and I4 J4 K4 to #13 #14 #15. It seems like to use the bonus variables #12-#16 I would have to specify three or more Is Js and Ks, which would have to be used in place of the meaningful letters and would render the argument specification incomprehensible to anyone other than the author of the macro. This still doesn't explain why U was ending up in #7. I J K and U V W may be interchangeable. Damn. The more I try to reason it the more confused I am getting. Basically the only way Argument Specification II could be used effectively in my application is if it didn't overwrite the variables specified by Argument Specification I... No, I'm definitely going to leave it alone. DP |
![]() |
| 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 |
| Need Help!- Losing home position after powered down overnight | MTWOLFEL | Mazak, Mitsubishi, Mazatrol | 5 | 09-03-2008 12:11 PM |
| Arguments for Subroutines (G65) | theragust | Milltronics | 5 | 10-17-2007 10:04 AM |
| losing work coordinates at power off | jlong58 | Fanuc | 13 | 07-27-2007 05:31 AM |
| Fanuc Servo Amp losing home | FanucIssues | Fanuc | 4 | 05-11-2007 09:07 PM |
| passing arguments to a sub program | kiprip | Mazak, Mitsubishi, Mazatrol | 1 | 07-13-2006 11:11 AM |