31.14.4.6 System Variables Indicating Execution Results - SAR/SARP

Program Example

SAR

  1. When the variable of the positive transition instruction turns ON, the SAR instruction is run. When the SAR instruction is executed, the result of 1 bit shifted to the right is stored in D1. The most significant bit is not shifted but is also copied to D1. For every bit that shifts, the most significant bit is copied to the topmost empty bit.

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

SARP

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