Enter Structured Text logic

Use the Structured Text Editor to add Structured Text logic to a routine.
Prerequisites
To enter Structured Text logic
  1. Click in the editor to place your cursor on a line in the routine.
  2. In the Structured Text Editor
    Toolbox
    , select the Statement icons to insert commonly used logical statements:
    • If_then If icon
    • Case_of Case icon
    • For_do For icon
    • While_do While icon
    • Repeat_until Repeat icon
    TIP: If
    Toolbox
    is not visible, on the pane
    bar, select Toolbox Icon
    Toolbox
    .
    In the
    Toolbox
    Search
    box, type an instruction mnemonic, such as OSFI, to display a specific instruction. Double-click the instruction to insert it.
    Select an instruction type, such as Bit, to display all the instructions of that type.
    TIP: You can also add to a routine by right-clicking and selecting
    Add Element
    from the context menu.
  3. On a line in the Structured Text Editor, type the first characters of a statement, condition, or instruction. Intellisense displays elements that include those characters that you can insert at that location. To display the Intellisense list of all valid elements at the cursor location, press
    CTRL + Space
    .
    When you select a statement to insert, the Structured Text Editor inserts a complete construct. You fill in the tags and required elements for the construct. For more information on constructs, see Structured Text Components: Constructs.
    TIP: Look for the inlay hint that helps describe required parameters for a statement or instruction.
    COP instruction example
    COP instruction example
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.
Normal