Followers 0

# MOV command

## 4 posts in this topic

I'm currently debugging a Mitsubishi PLC program (FX-48MR) In this program there are some unknown variations of the MOV command. For example the following instruction: ------[MOV D5 K1M122] I figured out this means that if D5 = 1 -> M122 is true If D5 = 2 -> M123 is true If D5 = 3 -> M122 & M123 is true If D5 = 4 -> M124 is true If D5 = 5 -> M122 & M124 is true If D5 = 6 -> M123 & M124 is true If D5 = 7 -> M122 & M123 & M124 is true I also found the following instruction, which I don't understand: ------[MOV K255 K4M103] Does anybody know what the meaning is of K4 in front of M103? Greetings FM

##### Share on other sites
You should read the manual first.

##### Share on other sites
The MOV command can work in 4 bit nybbles. The K1 tells MOV to use only the first four bits (m122 to m125). K2 is 8 bits. K4 is 16 bits.

##### Share on other sites
sergei and larry are both correct. you need to get (and read) the manual and the KxMxxx is grouped representation for different number of bits. K4M102 means: K4 = 4 nibbles (one nibble is 4bit so this is 16 bit total) M102 = starting address of the group (M102-M118) Note that when DESTINATION (address writen to) is a group of bits in the datatype where bits are 16-bit associated (like Dxxx) all 16bit are affected If the quantifier is less then K4 For example instruction MOV K1X0 D10 will copy four input bits (X0-X3) into D10 register (D10.0-D10.3) as expected but the remaining 12 bits of the D10 register is altered as well (bits D10.4-D10.F are cleared). This is not the case if destination file is bit type.