AutomationView Documentation

MID (Extract Substring)

Extracts L characters from string IN starting at 1-based character position P and writes the substring to the target STRING variable.


Description

MID slices length (L) characters from src (IN) starting at index pos (P, where 1 is the first character).

In modular equipment sequences, MID({cmd}, 1, {idx}) extracts one operation code at a time from a multi-step command string such as "ER" or "ODCU1DOUC2".


Syntax

Sequence Visual Editor

  1. Select an action on a step or transition and hold Alt (or right-click -> Edit Qualifier & Instruction).
  2. Select Strings -> MID and choose the P qualifier.
  3. Fill in the target STRING variable, source string (IN), character count (L), and 1-based start position (P).

Python

from automation_machine import ActionQualifier, ActionInstruction

step.add_action("{op}", "Extract current operation", qualifier=ActionQualifier.P, instruction=ActionInstruction.MID, src="{cmd}", length="1", pos="{idx}")

See Also