31.10.4.5 Confirming Execution Results - DIV/DIVP

Program Example

DIV

Divides one constant by another and stores the result in the float variable.

  1. When the positive transition instruction turns ON, the DIV instruction will be executed. When the DIV instruction is executed, the result value of 1.66666..., obtained from 25/15 = 1.66666..., is stored in the result data (float variable) in D1. When the value cannot be divided, it is rounded off to the nearest digit.
    When using a normally open instruction, as long as the variable for the instruction is ON, the DIV instruction is always executed.

DIVP

  1. When the normally open instruction turns ON, the DIVP instruction will be executed. When the DIVP instruction is executed, the result value of 1.66666..., obtained from 25/15 = 1.66666..., is stored in the result data (float variable) in D1. When the value cannot be divided, it is rounded off to the nearest digit.
    Even when using a normally open instruction, the DIVP instruction executes only when it detects the upward transition.
    Therefore, even when the instruction is always ON, the DIVP instruction is executed only for one scan.