¶ How to create custom STRUCT and ENUM datatypes?
Define composite STRUCT records and ENUM state lists visually in the Machine Editor.
- Open
main.machine and select the Datatypes tab.
- Select STRUCT or ENUM in the left panel, enter a Type Name (for example
StationRecipe or MachineMode), and click Create Type.
- Add members to your type:
- STRUCT: Click + Add Field to define field names, types, initial values, and comments.
- ENUM: Click + Add Value to list the symbolic values (for example
IDLE, AUTO, MANUAL).
- Switch to the Variables tab in
main.machine.
- Click + Add Variable.
- Set the Type column to your custom
STRUCT or ENUM name, or declare an array such as ARRAY[10] OF StationRecipe.
¶ 3. Use Fields and Enum Values in Sequences
- Access struct fields with dot notation (
recipe.press_time_ms).
- Compare or assign enum values using
TypeName.VALUE (mode == MachineMode.AUTO).