![]() | |
| Home Page | Mark Forums Read | Today's Posts | My Replies | Classifieds | Reviews | Photo Gallery | Web Links | Share Files | Advertise With Us | Ad List |
| |||||||
| Fanuc Discuss Fanuc controllers here! |
| This forum is sponsored by: |
![]() |
| | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
| ||||
| ||||
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 |
|
#3
| |||
| |||
| 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. |
|
#4
| |||
| |||
| 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. |
|
#5
| |||
| |||
| 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 |
| Sponsored Links |
|
#6
| ||||
| ||||
| 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). |
|
#7
| |||
| |||
. 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 |
|
#8
| ||||
| ||||
| 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 ?. |
|
#9
| |||
| |||
| 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 |
|
#10
| ||||
| ||||
| 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 ?. |
| Sponsored Links |
|
#11
| |||
| |||
| 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 |
![]() |
| 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 |
| 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 |