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 > Fanuc


Fanuc Discuss Fanuc controllers here!


This forum is sponsored by:

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Ban this user!
Old 06-29-2009, 03:40 PM
ED209's Avatar  
Join Date: Jul 2003
Location: Alberta, Canada
Posts: 67
ED209 is on a distinguished road
Fanuc OM - M99 Clears Common Variables

I am trying to run/call a couple of sub programs from a While-Do loop and when it exists the sub with M99 it clears all the values in the common variables registry #100-#199. I know M99 will clear the local variables but I didn't think it clears the common variables. Is there a parameter that needs to be changed to prevent this ?.

i.e.

#100=0
WHILE[#100LT5]DO1

M98 P1111

M98 P2222
#100=#100+1
END1

Thanks
Reply With Quote

  #2   Ban this user!
Old 06-29-2009, 08:10 PM
dcoupar's Avatar  
Join Date: Mar 2003
Location: USA
Posts: 2,312
dcoupar is on a distinguished road

You might check parameter 0040 bit 6. It clears the common variables on reset. Maybe M99 is behaving as a reset.
Reply With Quote

  #3   Ban this user!
Old 07-02-2009, 03:13 AM
 
Join Date: Feb 2006
Location: india
Posts: 1,187
sinha_nsit is on a distinguished road

M99 does not clear common variables (otherwise these cannot be called common variables!). There is some other problem in your program. If the issue is not yet resolved, post the complete program.

Parameter 6001#6 = 1 would retain common variables even after system reset.
Reply With Quote

  #4   Ban this user!
Old 07-02-2009, 06:32 AM
 
Join Date: Jan 2005
Location: USA
Posts: 237
cogsman1 is on a distinguished road

Did you set the parameter #6037 to the number of variables you need to be common? If you did not then they will reset at the end of the program and will be available in the "nest level" of sub program in which they are set.
Reply With Quote

  #5   Ban this user!
Old 07-02-2009, 01:35 PM
 
Join Date: Jun 2008
Location: United States
Posts: 1,507
stevo1 is on a distinguished road

Originally Posted by sinha_nsit View Post
M99 does not clear common variables (otherwise these cannot be called common variables!). There is some other problem in your program. If the issue is not yet resolved, post the complete program.
Common variables can be cleared to null with the reset of the control. Most of the Fanucs have a parameter to set the local variables #1-#33 and common variables #100-#199 to the desired state. The only ones that I know cannot be adjusted are the permanent common variables #500-#999.

On the Oseries control the parameter is 10.6 to allow clearing of the common variables at reset. See attachement.

This of course does not explaine the resetting of these with the M99 code but I have seen stranger things.

What is the condition of 10.6?

Stevo
Attached Files
File Type: pdf 0614_001.pdf‎ (42.3 KB, 115 views)
Reply With Quote

Sponsored Links
  #6   Ban this user!
Old 07-08-2009, 04:21 PM
ED209's Avatar  
Join Date: Jul 2003
Location: Alberta, Canada
Posts: 67
ED209 is on a distinguished road

Thanks guys for the replies.

Parameter 0040 bit 6 is all zeros. (00000000).
Parameter 6001#6, there are no 6000 series parameters in this control.
stevo1 parameter 10.6 is that parameter 0010 bit 6 ?, if so it's zero (10000000).
Reply With Quote

  #7   Ban this user!
Old 07-09-2009, 06:47 AM
 
Join Date: Jun 2008
Location: United States
Posts: 1,507
stevo1 is on a distinguished road

Originally Posted by ED209 View Post
Thanks guys for the replies.

Parameter 0040 bit 6 is all zeros. (00000000).
Parameter 6001#6, there are no 6000 series parameters in this control.
stevo1 parameter 10.6 is that parameter 0010 bit 6 ?, if so it's zero (10000000).
I apologize I don't know where my head was at when I was posting . I meant 40.6 as Dcoupar had stated. I was helping someone else in another thread regarding workshift which uses parameter 10.6 and I just got them backwards.

Anyway yes I would try as Dcoupar had suggested change 40.6 to 1 and see if you have the same problem.

Yes when stating 10.6 or 40.6 this means parameter 10 bit 6. Bits run right to left (76543210).

Stevo
Reply With Quote

  #8   Ban this user!
Old 07-09-2009, 10:26 AM
ED209's Avatar  
Join Date: Jul 2003
Location: Alberta, Canada
Posts: 67
ED209 is on a distinguished road

Thanks guys I'll give that a try. I was looking in the parameter book & parameter 40.7 is for local variables #1 - #33, 1 "Does not place local variables in vacant state during reset". I was wondering if I should or should not change this one also ?.
Reply With Quote

  #9   Ban this user!
Old 07-09-2009, 10:55 AM
 
Join Date: Jun 2008
Location: United States
Posts: 1,507
stevo1 is on a distinguished road

It is really depends on your preference. I have my #1-#33 clear to null if reset is hit or program end. I like them this way because I write a lot of nested macros and it can be hard to keep track of what they are and this can cause a problem later in the program. These I usually use as counters and part dimensions etc.

If I need variables to keep say for special functions like auto offset or tool CL at head rotation I use #100-#199 as these will stay but I can use them across most of my smaller single program macros because I set the value in the program so it won't matter what they were set to.

Then you have the permanent variables #500-#999. These I use for probe data, tool tracking, any kind of special counts that I don’t want to lose at power down.

By having these setup this way you get all 3 scenarios of variable usage that can be applied as you write the macros.

Stevo
Reply With Quote

  #10   Ban this user!
Old 07-09-2009, 11:55 AM
ED209's Avatar  
Join Date: Jul 2003
Location: Alberta, Canada
Posts: 67
ED209 is on a distinguished road

Ok that makes total sense. I will follow the same as some of our other m/c controls are like that. Also when the program returns from the sub program (M99) it was like it is in a single block state. I found in the parameter book, 11.5 (SBKM) 1: Machine is stopped in single block skip by macro command. 0: Machine is not stopped in single block skip by macro command. (Usually set to "0"), currently set to all "0"s. Could this be what needs to be changed ?.
Reply With Quote

Sponsored Links
  #11   Ban this user!
Old 07-09-2009, 02:19 PM
 
Join Date: Jun 2008
Location: United States
Posts: 1,507
stevo1 is on a distinguished road

I don't use it but this is typically for proving out macro programs. Most of the time the macro programs do not single block. This is to allow single block in a macro call.

This is not your problem.

Have you tried 40.6 yet?

Stevo
Reply With Quote

  #12   Ban this user!
Old 07-09-2009, 02:24 PM
ED209's Avatar  
Join Date: Jul 2003
Location: Alberta, Canada
Posts: 67
ED209 is on a distinguished road

No not yet. Won't get a chance until tomorrow. I'll let you know then. Thanks.
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
Just IN- Common Line Cutting - We are the best. And, you don't have it. Optimation Product Announcements & Manufacturer News 1 09-05-2008 02:13 AM
Common Variables viorel26 G-Code Programing 3 10-02-2007 04:09 PM
Need help with IF ,THEN,AND GOTO USING COMMON VARIABLES. XRACERJB General CNC (Mill and Lathe) Control Software (NC) 2 08-31-2007 08:08 AM
Seicos MYII control (Fanuc type) variables pieface General Metal Working Machines 3 02-21-2006 12:50 PM
Common?to Most Surfers Bear Fadal 1 01-22-2006 02:13 AM




All times are GMT -5. The time now is 09:51 PM.





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