31.14.1.6 System Variables Indicating Execution Results - SHL/SHLP

Program Example

SHL

Determines whether the most significant bit is ON or OFF.

  1. When the variable of the positive transition instruction turns ON, the SHL instruction is run. When the SHL instruction is executed, the result of 1 bit shifted to the left is stored in D1.

  2. When 1 bit is shifted to the left, you can check whether the most significant bit before data shifting is ON or OFF from the state of #L_CalcCarry.

    • When using a normally open instruction, the SHL instruction is always executed as long as the normally open bit is ON.

Program Example

SHLP

SHLP and SHL instructions have different ways of detecting when to execute. In SHLP instructions, even when using a normally open instruction, only the upward transition is detected and the SHLP instruction is executed. Even if the bit of the normally open instruction remains ON, the SHLP instruction is executed only for one scan.