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
DIVwith theN(non-stored) qualifier, the division runs every scan cycle while the step is active. This will quickly reduce the value toward zero. UseActionQualifier.P(pulse) if you only want to divide once.
Syntax
- step: the parent step object (from
self.add_step()) - variable_name: the numeric variable to modify
- qualifier: typically
ActionQualifier.Pto divide once on step activation - instruction: must be
ActionInstruction.DIV
Sequence Visual Editor

Python
from automation_machine import ActionQualifier, ActionInstruction
step.add_action("variable_name", "Description", qualifier=ActionQualifier.P, instruction=ActionInstruction.DIV)
See Also
- ADD (Addition): add to a variable
- SUB (Subtraction): subtract from a variable
- MUL (Multiplication): multiply a variable
- Action Qualifiers Overview
- Instructions Overview