Mitsubishi FX PLC decoding instruction DECO use method

2022-06-16 0 By

DECO instruction: An instruction that converts a piece of data into a bit register set ON.Usually used in the streets, like the flashing neon lantern above.DECO instruction form: DECO S D N;S is the data source (the data to be decoded), D is the target operand (the result after decoding), and n is the number of bits in the binary format in the data source.There are usually two formats: data source data form: can be a bit register or data register 1, S data is a bit register: 1≤ N ≤8 Example: DECO X0 M0 K2;The two bits X0 and X1 can be combined into four states, and each state corresponds to M0,M1,M2 and M3 respectively. According to the different states of X0 and X1, the four bit registers M0-M3 are set separately.For example, X0=1,X1=1,X2=0, M3=1 after decoding;Remember, the last bit register must be set to 1;Diagram 2 in the manual, when the data in S is the data value, 1≤ N ≤4 for example: DEC0 D0 D2 K4;The lower four bits of 16-bit register D0, B3, B2, B1,b0, are combined. There are 16 combination modes, which correspond to the 16 bits of 16-bit register D2,b0,b1….B15.For example, if the lower four bits of D0 are 0, 0, 1, 0, then after decoding, D2 b2 will be set to 1, D2=2.Diagram 2 in the manual