A method of appending M code cases

For more details, please check EASYCNC YouTube video here.

 

A method of appending M code cases

 

Mitsubishi Heavy Industries machine tool uses FANUC 31i system, the decoding principle is as follows: FANUC system F7.0 signal is defined as "auxiliary function gating pulse signal", symbol is MF, when the M instruction is executed, F7.0 is turned on, SUB25 is the function instruction, abbreviated as DECB, the meaning is binary decoding, which can decode 1, 2, 4 bytes of binary code data. One of the specified eight-bit continuous data is the same as the code data, and the corresponding output data bits are 1. As shown in Figure 1, in the DECB decoding instruction A represents the data type: it can be set  to 1/2/4 corresponding to the 1-byte/2-byte/4-byte data types, respectively; B represents the data address to be decoded; C represents the starting digital address of 8 consecutive digits of decoding; D represents the output address of the decoding result

 

For example: when the program executes M50, F10=50 at this time, and the above decoding instruction, M48 corresponds to the decoding output R746.0; M49 corresponds to the decoding output R746.1; M50 corresponds to the decoding output R746.2, and so on 8 consecutive numbers; Because the current program executes M50, the R746.2 coil is outputSince a decoding function instruction can only decode 8 digits consecutively, it is necessary to write multiple decoding instructions for decoding moreHowever, the DECB decoding command has a simpler way to complete all the decoding outputs at onceWhen the data type of decoding is changed from the original 1/2/4 to XX1/XX2/XX4, the decoding instructions can be executed in batches, where the single digits still represent the byte length of the data, and XX represents the number of 8 consecutive decoded digits.  As shown in Figure 2, setting 50 is to determine that the continuous decoding is 50×8=400 numbers, and the starting number is set to 0 in the figure below, then M0~M399 can be decoded at one time. The corresponding decoding output result is R800.0~R849.7 XX can be set to the range of 02~99, set 00 or 01, the default continuous decoding of 8 digits is the same as the first writing. 

 

Let's take a look at the M code decoding instruction in the ladder diagram of the Mitsubishi gear hobbing machine, as shown in the figure

 

A represents decoding 2 bytes of length data, a decoding of 25×8=200 numbers, B represents the address that needs to be decoded, C represents the decoding from M0~M199D represents the output address of R125.0~149.7, for example, two-axis three-wire automatic line Mitsubishi gear hobbing machine in the process of intelligent production line transformation of its own M code, M80 is defined as the equipment call robot command, when the machine tool executes M80, R110.0 is turned on. If the address range of the M-code M00~M199 decoding output should be between R125.0~149.7 as shown in Figure 3, why is R110.0 turned on when M80 is executed?    This is because Mitsubishi machine tools have a special place when processing M code decoding, and another function instruction code is used in the ladder diagram below the DECB decoding instruction, SUB61 abbreviation OR meaning is logical or, the specified 2 kinds of data ORoperation, output. As shown in the image:

 

Mitsubishi Machine Tool converts the R address output after decoding the M code to other R address output through OR operation. As shown in the image 

 

In the figure, R9091.1 is the "always on" address in FANUC PMC, often 1 A represents the data B with the address specified operation length of 4 bytes, C represents all data between R133.0~R136.7 and all data between R158.0~R161.7 OR, D represents the output of the operation result to R108.0~R111.7, for example:R133=00001111 OR, then the output is R108=11111111 R158=11110000 R134=01010101 OR, then the output is R109=01010101 R159=01010101 In this case, when the machine executes M80, the output result is R135.0=1 through "DECB" decoding, and then R135.0=1 and R160.0 are ORed, and the output is R110.0=1 (regardless of R160.0=0 or =1) The address of other M code decoding output can be deduced from the above content. The above is a brief description of the principle of M code decoding of Mitsubishi Heavy Industries.