A dynamic sequence is a parameterized Sequence subclass that you instantiate once per device. It is plain, deterministic Python - no AI is involved. There are three steps.
In a .seq file, write your logic using {var} placeholders wherever a name should differ per instance - variable names, action names, conditions, timer durations, and preset values:
from automation_machine import Sequence, StepType, ActionInstruction
class Verin(Sequence):
def setup(self):
self.name = "Verin"
self.s0 = self.add_step(StepType.INITIAL, name="0")
self.s1 = self.add_step(name="1")
self.s1.add_action("{move_forward}")
self.s1.add_action("{T_Forward}", instruction=ActionInstruction.TON, duration=2000)
self.add_transition(self.s0, self.s1, "{forward_cmd}")
self.add_transition(self.s1, self.s2, "{T_Forward}.q")
self.add_transition(self.s2, self.s0, "/{forward_cmd}")
If a class needs configuration values (not just names), declare constructor parameters as class annotations and read them from self.params inside setup().
main.machineIn your main.machine file, register one instance per device with add_instance. Pass the class name as a string:
from automation_machine import Machine
class ProjectMachine(Machine):
def setup(self):
self.add_instance("Verin", "magasin_1")
self.add_instance("Verin", "magasin_2")
When AutomationView loads or exports the project, it replaces every {var} with instance_name_var for each instance - magasin_1 and magasin_2 each get their own independent set of variables. This expansion is deterministic: the same configuration always produces the same resolved instances.
Open the Machine Explorer view to inspect each resolved instance.