What's new
What's new

Bar Pull Program - Need Help

jephw

Aluminum
Joined
Jul 23, 2020
Hello everyone.
First time using a bar puller and writing the program. I attached the puller program, as well as the start and end of the part being made. When it comes to the end of the bar puller program I get an error saying "subprogram nesting over" and it won't loop the program the specified value.
Anyone see what the issue is with my programs?

PART START
%
O7010 (805-8023 W/ BARPL)
(WED. 2/24/2022)


(LOCAL LOOPING)

M98 Q1 L2
M30


N1 (START MAIN PROGRAM)
G20

N2(PROFILE FINISHING1 3)
G0 G28 V0.
G0 G53 X-7. Z-37.
M69
G54
G99 G18 M46

PART END
G97 S484 M3
M98 P7950
M5
M9

G28 V0.
G0 G53 X-7.
G0 G53 Z-37.
M46

M54 (INCREMENT PART COUNTER)
M99
%

BAR PULL PROGRAM
%
O7950 (BAR PULLER PROGRAM)
(APR. 2/23/2022)
G20

N1(PROFILE FINISHING3 2)
G0 G28 V0.
G0 G53 X-7. Z-34.
M5
M9
M69
G54
G98 G18 M46
G54

T0303
G0 X0. Z-1.9
G01 Z-2.95 F20.
M11
G01 Z-0.866 F30.
M10.
G01 Z1.5 F30.

G28 V0.
G0 G53 X-7.
G0 G53 Z-34.
M99
M30

%
%
 
Still throwing the error.
The machine is a Mori Sieki NL3000 with a Mitsubishi MSX-850 controller.

Would this be the proper way to loop the program 3 times?

M98 P7950 L3
 
Douglas,
That was output by the post processor. I am unsure what this means tbh.
 
Douglas,
That was output by the post processor. I am unsure what this means tbh.
Hello jephw,

If parameter bit 6005.0 is set to "1", M98 with a "Q" address is to call a Local Subprogram, with the "Q" value specifying the sequence number of the start of the Local Subprogram. With a HAAS Control, M97 is used to call a Local Sub and M98 to call an external Subprogram. With a Fanuc Control, M98 P_ _ _ _ calls an External Sub, while M98 Q_ _ _ _ calls a Local Sub. In addition, if the Subprogram call is specified as follows:

M98 P1000 Q3

this will call the External Subprogram O1000, commencing execution within O1000 at sequence number N3.

Therefore, in your program, the code below commencing at N1 and finishing at M99 is a Local Subprogram that is listed in your Main Program after M30. When M98 Q1 is executed, control will branch past M30 to N1 and execute the Local Sub from that point. From within that Local Subprogram, External Subprogram O7950 is being called via the command line M98 P7950. Also, dependent on whether your control is set to FS15, or Standard FS16 mode via parameter, the way a repeat of a Subprogram is called differs. If set to Standard FS16 Mode, the repeat of an External Subprogram is specified as part of the "P" address. For example, M98 P021000 will run program O1000, two times. However, repeat of a Local Subprogram is specified with an "L" address. If the normal syntax of your control for Multi-repetitive Cycles, such as G71 and G76, is of the two block format, then your control is set to Standard FS16 mode.

As a test, register the code from N1 to M99 below under an available program number, say O1000 for example, and change the M98 Q1 L2 to M98 P021000. This will call what your currently listed Local Subprogram, as External Subprogram O1000 and repeat it once (two executions of the Subprogram).

M98 Q1 L2
M30


N1 (START MAIN PROGRAM)
G20

N2(PROFILE FINISHING1 3)
G0 G28 V0.
G0 G53 X-7. Z-37.
M69
G54
G99 G18 M46

PART END
G97 S484 M3
M98 P7950
M5
M9

G28 V0.
G0 G53 X-7.
G0 G53 Z-37.
M46

M54 (INCREMENT PART COUNTER)
M99

Regards,

Bill
 
Still throwing the error.
The machine is a Mori Sieki NL3000 with a Mitsubishi MSX-850 controller.

Would this be the proper way to loop the program 3 times?

M98 P7950 L3

Hello jephw,
I just read this Post of yours identifying the control as Mitsubishi. What I wrote in my previous Post is for a Fanuc control; with a Mitsubishi Control a Local Subprogram is called with a "H" address, not "Q". The following would call a Local Subprogram commencing at sequence number N101.

M98 H101

The syntax for a Subprogram call with a Mitsubishi Control is:

M98 P H L

Where:
P = External Subprogram number
H = Sequence Number within the External Subprogram to commence execution
L = Number of calls of the specified Subprogram

Therefore, to call a Local Program with the Mitsubishi Control, the "P" address is omitted and the "H" address is used to specify the sequence number that signifies the start of the Local Subprogram.

Regards,

Bill
 
Situations like this are why I have always believed one should learn how to program rather than just hope that the CAM software will make decent code.

I agree with you. I did start out with programming so I am somewhat familiar with how posts work, I just don't do it everyday. I am by no means an expert when it comes to g-coding.




Hello jephw,

If parameter bit 6005.0 is set to "1", M98 with a "Q" address is to call a Local Subprogram, with the "Q" value specifying the sequence number of the start of the Local Subprogram. With a HAAS Control, M97 is used to call a Local Sub and M98 to call an external Subprogram. With a Fanuc Control, M98 P_ _ _ _ calls an External Sub, while M98 Q_ _ _ _ calls a Local Sub. In addition, if the Subprogram call is specified as follows:

M98 P1000 Q3

this will call the External Subprogram O1000, commencing execution within O1000 at sequence number N3.

Therefore, in your program, the code below commencing at N1 and finishing at M99 is a Local Subprogram that is listed in your Main Program after M30. When M98 Q1 is executed, control will branch past M30 to N1 and execute the Local Sub from that point. From within that Local Subprogram, External Subprogram O7950 is being called via the command line M98 P7950. Also, dependent on whether your control is set to FS15, or Standard FS16 mode via parameter, the way a repeat of a Subprogram is called differs. If set to Standard FS16 Mode, the repeat of an External Subprogram is specified as part of the "P" address. For example, M98 P021000 will run program O1000, two times. However, repeat of a Local Subprogram is specified with an "L" address. If the normal syntax of your control for Multi-repetitive Cycles, such as G71 and G76, is of the two block format, then your control is set to Standard FS16 mode.

As a test, register the code from N1 to M99 below under an available program number, say O1000 for example, and change the M98 Q1 L2 to M98 P021000. This will call what your currently listed Local Subprogram, as External Subprogram O1000 and repeat it once (two executions of the Subprogram).

M98 Q1 L2
M30


N1 (START MAIN PROGRAM)
G20

N2(PROFILE FINISHING1 3)
G0 G28 V0.
G0 G53 X-7. Z-37.
M69
G54
G99 G18 M46

PART END
G97 S484 M3
M98 P7950
M5
M9

G28 V0.
G0 G53 X-7.
G0 G53 Z-37.
M46

M54 (INCREMENT PART COUNTER)
M99

Regards,

Bill


Bill, thanks for your reply. I decided to take a different approach and just use the parts counter on the machine instead of looping the program. It runs till the counter hits the max parts value I set and then it quits. It works great!
 
Bill, thanks for your reply. I decided to take a different approach and just use the parts counter on the machine instead of looping the program. It runs till the counter hits the max parts value I set and then it quits. It works great!

Hello jephw,
Bear in mind that the Post of mine that you replied to was about Local Subprograms for a Fanuc control, which I wrote before realizing that your control was a Mitsubishi and did so because the syntax of the Local Subprogram in your program was that of a Fanuc control. After realizing your control is a Mitsubishi, I explained the syntax of the Mitsubishi to you. Given that your program was result of a CAM output, it indicates that the Post Processor has at least one error, the output of Local Subprogram syntax.

Having a better understanding of manual programming, as suggested by Kevin, will allow you check the Post Processor for error. There there is at least one (output of Local Subprogram Syntax), there may be others. If you rely solely on your CAM software to create programs for your machine, I would be checking the Post Processor thoroughly.

Regards,

Bill
 








 
Back
Top