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 05-12-2010, 09:13 AM
christinandavid's Avatar  
Join Date: Aug 2009
Location: New Zealand
Posts: 573
christinandavid is on a distinguished road
Have started losing Arguments at work as well as at home...

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
Reply With Quote

  #2   Ban this user!
Old 05-12-2010, 12:19 PM
 
Join Date: May 2007
Location: USA
Posts: 913
g-codeguy is on a distinguished road

Originally Posted by christinandavid View Post
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
I have no idea why U value is winding up in D. However you are on the right track with I and J. My 21i manual says:

"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.
Reply With Quote

  #3   Ban this user!
Old 05-12-2010, 01:09 PM
 
Join Date: Feb 2009
Location: Engerland
Posts: 22
jay4389 is on a distinguished road

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
Reply With Quote

  #4   Ban this user!
Old 05-12-2010, 08:12 PM
christinandavid's Avatar  
Join Date: Aug 2009
Location: New Zealand
Posts: 573
christinandavid is on a distinguished road
Oh, K...

Originally Posted by g-codeguy View Post
"Addresses do not need to be specified alphabetically. They conform to word address format. I, J, and K need to be specified alphabetically, however
Aaaahhh...I'll see what happens if I make sure K is specified after the I & J. That may hopefully eliminate all the conflicts/confusion, regardless of where I, J & K are positioned on the line. I can live with having to remember that rule, I think, and I'll set up the fixed form sentence that way too.

Will let you know my findings...

DP
Reply With Quote

  #5   Ban this user!
Old 05-15-2010, 07:37 AM
 
Join Date: Feb 2006
Location: india
Posts: 1,187
sinha_nsit is on a distinguished road
mixed argument specification

The problem is because of mixed argument specification. This is tricky and not at all explained in the manual. Read my notes for information.
Attached Files
File Type: pdf mixed argument specification.pdf‎ (27.9 KB, 63 views)
Reply With Quote

Sponsored Links
  #6   Ban this user!
Old 05-15-2010, 07:55 AM
christinandavid's Avatar  
Join Date: Aug 2009
Location: New Zealand
Posts: 573
christinandavid is on a distinguished road

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
Reply With Quote

  #7   Ban this user!
Old 05-15-2010, 08:14 AM
 
Join Date: Feb 2006
Location: india
Posts: 1,187
sinha_nsit is on a distinguished road

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.
Reply With Quote

  #8   Ban this user!
Old 05-15-2010, 07:26 PM
christinandavid's Avatar  
Join Date: Aug 2009
Location: New Zealand
Posts: 573
christinandavid is on a distinguished road

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
Reply With Quote

  #9   Ban this user!
Old 05-16-2010, 11:57 PM
 
Join Date: Feb 2006
Location: india
Posts: 1,187
sinha_nsit is on a distinguished road

It can be explained. Post your G65 block, along with the values that are passed on to the local variables.
Mixed argument specification tends to be confusing, but it follows a logic.
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
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




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