Adding M code to FANUC is as simple as that

For more details, please check EASYCNC YouTube video here.

 

Adding M code to FANUC is as simple as that

 

More and more machine tools, need to add M code, used to control peripheral fixtures or other actions, how to write the simplest ladder diagram, to achieve this function?

1 Download the original ladder diagram from the machine.

2 Open the machine ladder diagram on the computer and find the DECC function command.

 

As shown in the figure above, the DECB function quality number is SUB25, followed by F0010, which represents the decoding instruction, and the translation is M code.

3 Check several consecutive DECBs as shown below:

 

4 Add M code, according to the above picture according to the cat drawing tiger, insert a line of function instruction SUB25, for example, we want to add M60, M61, M62, M63 these 4 instructions, insert the following ladder diagram:

 

When M60 is executed, R604.0=1 (on);

When M61 is performed, R604.1=1 (conduction);

When M62 is performed, R604.2=1 (conduction);

When M63 is performed, R604.3=1 (on);

R604 is the starting address, we can also start with R700 (any value, but cannot be used in the program)

5 Finally, the M command end signal, very important, if you do not add this line of ladder diagram, after your M code execution is completed, the machine will not execute later, pause.

Search for G4.3 (FIN auxiliary code end signal) in the original ladder

 

G4.3 not only ends auxiliary code M, but also technical auxiliary code S, T. So this program uses a transition instruction R653.0 (MEND) to search for coil R653.0, as shown below:

 

We added R604.0 and X99.0 (a position detection switch, such as a door switch, when we execute M65, the door opens, touches the X99.0 detection switch, it is considered in place, and the M command ends).

When M64 is executed, R604.0=1 is immediately turned on, and R653.0 in the figure above is turned on, causing G4.3 to turn on and the M command to be completed.

When M65 is executed, R604.1=1 conducts immediately, we can let R604.1 trigger a Y signal, control the hydraulic valve, push the door to open, open and hit the X99.0 detection switch, X99.0=1, the R653.0 in the figure above is on, causing G4.3 to turn on, and the M command is completed.

6 Save, compile and upload the edited ladder diagram to the FANUC system.