K4Y0 is 2 bytes y0-y17
K2Y0 is 1 bytes y0-y7
For example: [K85 K2Y000] Corresponds to k85 conversion binary 1010101 to the state of y0-y7.
In the Mitsubishi PLC program, it is often seen that K4M100, K7M500, K1X0, K2Y0, etc. are written.
KnM refers to consecutive 4n bits starting with M. For example, K4M100 is a continuous 4*4=16 addresses starting with M100, which means M100 to M115. These 16 bits are just the length of one word. If it is K7M500, it means 7*4=28 bits starting with M500, more than 16 bits, 32 bits of light rain, so double word instructions should be used when appearing in the program.
These are generally used to transfer instructions and compare instructions. The format used is generally as follows:
= K4M100 K0
The 16-bit contact comparison command, the M100-M115 has a total of 16 bits off, and the contact is turned on.
<> K4M100 K50
16-bit contact comparison command. When the value represented by the 16-bit word of M100-M115 is not equal to 50, the contact is turned on.
D= K7M500 K0
The 32-bit contact comparison command, the M500-M527 has a total of 28 bits off, and the contact is turned on.
MOV K0 K1Y0
16-bit transfer instruction, all of Y0-Y3 are reset.
MOV K2X0 D0
The 16-bit transfer instruction, X0-X3, a total of 8 bits representing the value is transferred to D0.
DMOV K6M50 D50
The 32-bit transfer command, the value represented by 24 bits of the M50-M523 is transferred to the D50.
CMP K1X0 K1Y0 M10
16-bit comparison instruction, the data composed of X0-X3 is compared with the data composed of Y0-Y3, the former is larger than the latter, M10=1, the former = the latter, M11=1, the former is the latter, M12= 1.
DCMP K5X0 K5M0 M100
32-bit comparison instruction, the data composed of X0-X23 is compared with the data composed of M0-M23, the former is larger than the latter, M100=1, the former = the latter, M101=1, the former is the latter, M102= 1.