STRING_TO_INT (String to Integer)
Parses a decimal string (STRING) and writes the resulting 16-bit integer to the target INT variable.
Description
STRING_TO_INT converts the numeric characters in src (IN) into an INT value. Combine it with MID to parse numeric parameters embedded inside command or barcode strings (for example, extracting slot number "2" from "ODCU1DOUC2").
Syntax
- variable_name: Target
INTvariable - qualifier: Typically
ActionQualifier.P(Pulse) - instruction:
ActionInstruction.STRING_TO_INT - src (
IN): SourceSTRINGvariable or literal
Sequence Visual Editor
- Select an action on a step or transition and hold Alt (or right-click -> Edit Qualifier & Instruction).
- Select Conversions -> STRING_TO_INT and choose the P qualifier.
- Fill in the target
INTvariable and the sourceSTRINGoperand (IN).
Python
from automation_machine import ActionQualifier, ActionInstruction
step.add_action("target_slot", "Parse slot index from string", qualifier=ActionQualifier.P, instruction=ActionInstruction.STRING_TO_INT, src="slot_char")