![]() | |
| 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
| |||
| |||
The following is my Custom Macro program of my Takeda Drilling Center Fanuc 10m: O9000(ATC CUSTOM MACRO) #3003=1 IF[#1012EQ1]GOTO8 IF[#1013EQ1]GOTO8 IF[#1014EQ1]GOTO8 #101=#4003 #102=#4002 IF[#500NE0]GOTO1 WHILE[#1015EQ1]DO1 #3000=1(TOOL CLAMP ALARM) END1 IF[#149NE0]GOTO1 #3000=2(T CODE ERROR/T0...T0) N1IF[#500NE#149]GOTO2 #3003=0 M99 N2G80G49G40 IF[#149LE36]GOTO3 #3000=3(T CODE OVER DATA) N3 IF[#1015NE0]GOTO4 T1 M90 M19 T2 N4G91G28Z0 T1 M19 IF[#500EQ0]GOTO5 G53G90G00X#[#500+500]Y0 G23 G53Z-95.45Y80.0 G53Y150.2 M91 #500=#149 #1=BCD[#149] #1132=#1132OR63 #1132=#1132AND#1 #1115=1 G91G28Z0M92 IF[#149GT0]GOTO6 G28Y0M93 T2 G22 G#101 G#102 G61 #3003=0 #1115=0 M99 N5G91G28Y0 N6G23 G53G90G00X#[#149+500]Y150.2 T1 M91 N7G53Y150.2 G53Z-80.0M92 G53Z-95.45 M93 M90 G53Y80.0 T2 #500=#149 #1=BCD[#149] #1132=#1132OR63 #1132=#1132AND#1 #1115=1 G91G28Z0Y0 G22 G#101 G#102 G61 N8#3003=0 #1115=0 M99 The tooling are placed along the x-axis. If I want to change the tool. The x-axis will move to the tool and clamp it into the spindle head. If I want to change the tool, I command "Txx"(xx = tool number such as T01 is tool no. 1). And the program will excecute automatically. My problem is I try to increase my memory by installing new ram into the motherboard. But I need to clear out all the memories including "Custom Macro Variable". In the program, I can run it all, Clamp and Unclamp tooling and etc, the functions except, "moving x-axis" IF[#500EQ0]GOTO5 G53G90G00X#[#500+500]Y0 The program don't know the value of #500 Variable. N6G23 G53G90G00X#[#149+500]Y150.2 The program don't know where to collect the value of #149 Variable. I think this is the tool number. I don't know this Macro Program is Macro B or not. What can I do to excecute the x-axis moving to the right position to get the tooling. Thanks guy for your help. Last edited by ixoxi999; 12-06-2010 at 11:29 AM. |
|
#2
| |||
| |||
| Set bit number 5 of parameter 0319 to 1. This will allow single step of every macro statement and therefore enable you to check the value of the Macro variables and the flow of the program in single block. Variable #500 is a Common variable that retains it's value when power off. Check the value of #500 before you try a tool change. I haven't checked the logic of the program thoroughly, but #500 may have had a value preset by the OEM, and if you cleared the memory and didn't record the value, then this may be part of your problem. #500 needs to have a value other than Zero to get past the first error trap. |
|
#6
| |||
| |||
| BCD[_] changes its argument to BCD representation, interprets it in binary and outputs that value. Let us say #149 contains 10 (in BCD[#149]). BCD representation of 10 is 0001 0000. The binary interpretation of 00010000 is 16. So, 16 is output. Thus, BCD[10] = 16. BCD and BIN functions are used in association with system variables for input/output interface signals. For more information, read the attachment. Sinha |
|
#7
| |||
| |||
|
So what was the solution to the problem?? It may help others with similar problems. With a quick glance at your code it appears that #500 is to be set to the current tool that is in the spindle. With this being cleared it got mugged up on you. Was that the solution? Stevo |
|
#8
| |||
| |||
| #500: the current tool in the spindle (1, 2, 3,...36) #501: The position of the tool 1 (A) #502: The position of the tool 2 (A+B); B:distance between two tool #503: The position of the tool 3 (A+2B) #504: The position of the tool 4 (A+3B) ... ... #536:The position of the tool 36 (A+35B) triphat-tp co., ltd; triphat.com@gmail.com O9000(ATC CUSTOM MACRO) #3003=1 IF[#1012EQ1]GOTO8 IF[#1013EQ1]GOTO8 IF[#1014EQ1]GOTO8 #101=#4003 #102=#4002 IF[#500NE0]GOTO1 WHILE[#1015EQ1]DO1 #3000=1(TOOL CLAMP ALARM) END1 IF[#149NE0]GOTO1 #3000=2(T CODE ERROR/T0...T0) N1IF[#500NE#149]GOTO2 #3003=0 M99 N2G80G49G40 IF[#149LE36]GOTO3 #3000=3(T CODE OVER DATA) N3 IF[#1015NE0]GOTO4 T1 M90 M19 T2 N4G91G28Z0 T1 M19 IF[#500EQ0]GOTO5 G53G90G00X#[#500+500]Y0 G23 G53Z-95.45Y80.0 G53Y150.2 M91 #500=#149 #1=BCD[#149] #1132=#1132OR63 #1132=#1132AND#1 #1115=1 G91G28Z0M92 IF[#149GT0]GOTO6 G28Y0M93 T2 G22 G#101 G#102 G61 #3003=0 #1115=0 M99 N5G91G28Y0 N6G23 G53G90G00X#[#149+500]Y150.2 T1 M91 N7G53Y150.2 G53Z-80.0M92 G53Z-95.45 M93 M90 G53Y80.0 T2 #500=#149 #1=BCD[#149] #1132=#1132OR63 #1132=#1132AND#1 #1115=1 G91G28Z0Y0 G22 G#101 G#102 G61 N8#3003=0 #1115=0 M99 The tooling are placed along the x-axis. If I want to change the tool. The x-axis will move to the tool and clamp it into the spindle head. If I want to change the tool, I command "Txx"(xx = tool number such as T01 is tool no. 1). And the program will excecute automatically. My problem is I try to increase my memory by installing new ram into the motherboard. But I need to clear out all the memories including "Custom Macro Variable". In the program, I can run it all, Clamp and Unclamp tooling and etc, the functions except, "moving x-axis" IF[#500EQ0]GOTO5 G53G90G00X#[#500+500]Y0 The program don't know the value of #500 Variable. N6G23 G53G90G00X#[#149+500]Y150.2 The program don't know where to collect the value of #149 Variable. I think this is the tool number. I don't know this Macro Program is Macro B or not. What can I do to excecute the x-axis moving to the right position to get the tooling. Thanks guy for your help.[/QUOTE] |
|
#9
| |||
| |||
| Your program states that #500 is suppose to be the current tool in the spindle so set #500 via MDI equal to the current tool in the spindle. #149 is probably being set via T() command thru a parameter setting which also calls program 9000. Make sure you have that parameter set. It is different depending on which model Fanuc control you are using. Since you did not tell us which control you are using we cannot tell you which parameter to set. You can also test this by programming a T() command and then checking parameter #149 and it should be set to your modal T(). FYI it is macroB that it is coded to. It will also help in the future to start a new thread related to your problem instead of posting in one that is over a year old and not related at all to your issue. Stevo |
|
#10
| ||||
| ||||
| AND post that new thread in the Macro forum ![]() Parametric Programing - CNCzone.com-The Largest Machinist Community on the net! |
| Sponsored Links |
![]() |
| 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 |
| Custom Macro B | rlgx4 | Parametric Programing | 7 | 08-02-2010 04:05 PM |
| "difference between Custom Macro A and Custom Macro B" | arulthambi | Parametric Programing | 4 | 10-05-2009 03:34 PM |
| custom macro question | sinha_nsit | G-Code Programing | 28 | 04-18-2009 06:44 AM |
| Fanuc 18i custom macro B | djmcdaris | Fanuc | 17 | 03-10-2009 01:58 AM |