Extracts L characters from string IN starting at 1-based character position P and writes the substring to the target STRING variable.
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".
STRING variable, source string (IN), character count (L), and 1-based start position (P).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}")
STRING variableActionQualifier.P (Pulse)ActionInstruction.MIDIN) — Source STRING variable or literalL) — Number of characters to extract (INT variable or literal)P) — 1-based starting character position (INT variable or literal)