![]() | |
| 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
| |||
| |||
Hi all- Having a problem getting a macro to "play nice" in single-block mode. What we are doing is "hijacking" the hard-coded (ladder) M6 command via a user-defined macro as follows: Param 9071 = 6 Macro: O9001 M6; POPEN; DPRNT[STUFF WE WANT TO SEND]; PCLOS; M99; OR Param 6080 = 6 Macro: O9020 M6 T#4120; POPEN; DPRNT[STUFF...] PCLOS; M99; Problem is, when the customer runs in single-block mode, the screen jumps into the macro, and when cycle start is pressed a sufficient number of times to step through the macro, the next step of the calling program is executed immediately! The problem is not seen on 15 control we installed on recently, and I have tried param 6000 b5 (SBM) which causes the DPRNT stuff to flow through, and param 3450 b4 (NPS) which causes the M99 to flow through. But once I'm out of the macro, the next block fires off. It seems to be more of a display problem than a behavior problem; if somehow the macro was "invisible" during single-block mode I think that would solve the problem. Any ideas? Thanks Marc |
|
#2
| |||
| |||
| If you store 6 in param 6080, then M6 would call macro O9020. This is what you are doing, but M6 T#4120 inside the macro will not do anything beacuse the current tool is already there in the spindle. For your problem, try inserting some extra EOBs and check if it helps. |
|
#3
| |||
| |||
| Sinha Thanks for your response! Re M6 T#4120- We are trying 2 types of macro- the p.6071=6 version calls O9001; in this configuration, the M6 (tool change)seems to already "know" the tool number from the calling program, so it executes ok. When we use p.6080=6, calling O9020 we have to tell it the tool no. hence the T#4120. Don't know exactly why, but if we don't do it it does not work. The overall point of the macro is to intercept the M6 tool change and send some info (the tool number) to our device, and allow the customer to continue using all his original, un-edited programs and have our device work transparently. It works great until the user runs in single block mode and wants to see the next main program block before he executes. We have discussed adding a null block (EOB alone) after each M6 call, but there is resistance to editing any main part programs. Hope that clarifies the problem Marc |
|
#4
| |||
| |||
| A program can be called by an M code (such as M6) as a subprogram or as a macro. If called as a macro, it is possible to pass paramaters inside the macro, and the called program would have its own set of local variables. But if called as a subprogram, it is like an M98 call. 9001 is called as a subprogram by M6. 9020 is called as a macro by M6 (with or without paramaters). It is not clear how the tool is changed. M6 T#4120 will not change to a new tool. |
|
#5
| |||
| |||
| Sinha- Thanks again for the response. I never fully understood the difference(s) between a macro call and a subprogram call when called by an M-function- we use whichever works best in the particular application. Your feedback is a help! As for the 9020 M6 T#4120- if I run it without the "T#4120" the tool change does not execute, if I include it, it does. I didn't confirm at the time if I was getting the correct tool, though. One (I) would assume that #4120 is the tool already in the spindle, so I don't understand it either. May need to pass the "T" parameter as something else if I go this route... In any event, the original problem still stands: when running in single-block mode, how can I have the operator see the block following the macro/subprogram call before execution? Thanks again for any help! Marc |
| Sponsored Links |
|
#6
| |||
| |||
| Am I correct that everything runs correctly, so it is not a matter of function? (normal or single block) If there is any function issues, you might want to look over the tool change macro I posted. The only issue is the displayed code when single block is active? ie. Main prog: Code: N10 N20 N30 N40 M6 N50 N60 ect. Main prog: Code: N10 N20 N30 N40 M6 M6 N10 M6 N20 M6 N30 M99 N50 N60 ect. |
|
#7
| |||
| |||
| dpuch- Thanks for the reply. No, its not really a function problem- the thing works as desired. The problem is that when the main program executes the macro- in single block mode, the contents of the macro replace the main program on the screen. (I don't care if the op. or anyone else sees it, it's not that big a secret) After the last block of the macro is executed, the macro remains on screen and the next press of cycle start begins execution of the following block in the main program. The problem is, the operator can't see that next block before it starts running. If that next block were a null block (EOB only) that might work, but the user doesn't want to do that. As for blocking 9000 progs, I have tried that (p3202 b4?) it will prevent editing, but does not fix this issue. Thanks for your input. Any more ideas? Marc |
|
#8
| |||
| |||
| Set 3232#0 (ND8) to 1, and 3232#1 (ND9) to 1. This will not display the subprogram/macro (8000 series and 9000 series, respectively) during its execution. I believe, it would continue displaying the main program (not tried it) which is what you want. |
|
#9
| |||
| |||
| Sinha- Thanks for the info! I spent a whole day trying to find exactly that sort of parameter in the 16i parameter manual and I didn't see it- did I just miss it or is it not documented? In any event , I will be back on-site next week and try it. It sounds like it would be a major part of my solution. Thanks again, I will let you know how I make out! Marc |
|
#10
| |||
| |||
| Sinha- That parameter setting does the job! Thank you very much! By the way, I couldn't find any reference to it in the parameter manual with the machine, and the parameter display shows no indication of ND9 or ND8. Is this an undocumented parameter? Thanks again! Marc |
| Sponsored Links |
|
#12
| |||
| |||
| Hi, by not displaying a macro-called program the single-block function is not disabled. #3003=0 or 1 enable or disable function, this is usefull to manupilate the behaviour of the program at any level. regards norbert |
![]() |
| 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 |
| Newbie- Macro problem with Haas VF-1 and HS-1 | colton_m | Haas Mills | 6 | 03-04-2010 11:02 PM |
| Need Help!- Alarm Code 126 - Macro problem | NickDP | Fanuc | 2 | 07-09-2009 08:20 AM |
| Short macro problem | scrapper400 | G-Code Programing | 11 | 12-05-2008 07:56 AM |
| Drill Macro problem | toolmanwaz | CamSoft Products | 5 | 04-01-2008 10:47 AM |
| VF0E Macro Problem | stang5197 | Haas Mills | 1 | 06-14-2007 05:34 PM |