Question
How do I create a program to input 1.5-digit BCD data to CIO 0.00 to 0.05 BCD from a digital switch and move it to a specified DM Area word?
Answer
Assuming that CIO 0.06 to CIO 0.15 are allocated to other inputs, only the data in the 6 bits in from CIO 0.00 to CIO 0.05 should be extracted to create this program. If the extracted number of bits were integral multiples of 4 bits (1-digit BCD) the MOVE DIGITS instruction (MOVD) could have be used, but this time 6 bits have been extracted so the MOVD instruction cannot be used. Instead, the LOGICAL AND instruction (ANDW) will be used.
Programming
Operation
Note:For details on the LOGICAL AND operation (ANDW), refer to the Instructions Reference Manual for the relevant Programmable Controllers.