CNC REPAIR INFORMATION, FANUC | Fanuc 21-MB: Using an M-Code to Jump from Cutting Program to Sub-Program

Fanuc 21-MB: Using an M-Code to Jump from Cutting Program to Sub-Program

 

midaco

 Attention: Please read the Terms of Use for this site before proceeding.

This information was used in the interface between a Mori Seiki F-M2 vertical and a Midaco automatic pallet-changer. The control was a Fanuc 21-MB but this information could be used on a variety of Fanuc controls to perform many different functions. Fanuc option Custom Macro B is required.

The Midaco is a non-Mori pallet-changer. It is installed next to the VMC and automatically loads and unloads one of two available pallets to the machine.

Since the Midaco is not a Mori Seiki factory unit, there were no allowances for it in the Mori ladder. We needed to use M-codes in the program to “call up” the appropriate pallet for machining. This means that we needed to position the machine so that the pallets would be aligned with the correct station on the APC. After that, we needed to send a signal to the Midaco to begin the pallet change process. At the same time, the machine needed to stay at the change position and do nothing while it waited for the pallet change to complete.

The available M-codes on the machine were M21 and M22. These outputs would turn on relays that would in turn send a signal to the Midaco to request the appropriate pallet change action. This is what was done:

NC parameter 6071 was set to 21. This is the sub-program M-code call for program number 9001. So when the program executes M21, the control jumps to the sub-program O9001. In the O9001 pogram, the axes are positioned for the “A-pallet” pallet change, and the request for pallet-change is sent to the Midaco unit.

NC parameter 6072 was set to 22. This is the sub-program M-code call for program number 9002. So when the program executes M22, the control jumps to the sub-program O9002. In the O9002 pogram, the axes are positioned for the “B-pallet” pallet change, and the request for pallet-change is sent to the Midaco unit.

Note:NC parameter 3202.4 mustbe set to allow editing of 9000 series programs)

The sequence for pallet A is as follows:

M21 is read in the main part program (but the M21 output does not come on yet)

The M21 causes a program jump to the sub-program.

The the sub-program would look like this:

O9001

G91 G28 Z0.; (G91=incremental positioning, G28=zero-return,zero-return of the Z axis prior to the pallet change in rapid)
G90 G0 G53 X29.5632 Y-.1559; (G90=absolute positioning,rapid,cancel work offset for this line only-one shot)
M21; (actual M21 output to turn on relay and send signal to Midaco. The Midaco starts. Machine waits for M-code finish signal. No other machine functions can be executed nor can the sub-program continue to the next line until the M-code finishes. The Midaco completes the change cycle, then sends the finish signal back the the machine.)
M99; (return to main program)

The B pallet change would be the same except that the M-code to start the process would be M22 and the sub-program called would be O9002. Positioning in O9002 would be for loading/unloading of pallet B

Check out www.pinpointcnc.com for machine repair information, procedures and other products

Go to www.cncalarm.com for machine alarms and details

Go to www.toyookivalve.blogspot.com for information on Toyooki products

Go to Fanuc Control Central for all Fanuc related posts

back to the top 

back to home

Filed Under Fanuc Control | Leave a Comment

Tagged With , , , , , , , ,

Comments

Comments are closed.