AutomationView Documentation

DIV (Division)

Divides the target variable by a value each time the action executes.


Description

The DIV instruction performs a division operation on the target variable. When the action activates, it divides the current value of the variable by the specified divisor.

This is useful for scaling operations, averaging calculations, or reducing values by a fixed ratio.

Dividing by zero will cause an error. Always ensure the divisor is a non-zero value.

When using DIV with the N (non-stored) qualifier, the division runs every scan cycle while the step is active. This will quickly reduce the value toward zero. Use ActionQualifier.P (pulse) if you only want to divide once.


Syntax

Sequence Visual Editor

Sequence step with DIV instruction configured

Python

from automation_machine import ActionQualifier, ActionInstruction

step.add_action("variable_name", "Description", qualifier=ActionQualifier.P, instruction=ActionInstruction.DIV)

See Also