Inserting Code Elements in ST
The text editor provides several possibilities to insert ST code elements such as identifiers, keywords, variables, functions, function blocks, etc. into the code worksheet. It allows you to
- Insert elements via keyboard (Intellisense function).
- Insert pre-defined code templates.The most common ST code constructs (CASE...OF, IF...THEN, WHILE...DO, etc.) can be inserted as pre-defined code templates via context menu.
Insert code elements via keyboard (Intellisense function)
- Type the first (or more) letter(s) of the name to be inserted (case not taken into account). In the appearing selection box, the first item starting with the entered character is selected.To open the Intellisense selection box without having entered a character, press <Ctrl>+<Space>.
- Double-click the desired entry or select it using the arrow keys and press <Enter>.To insert the members of a code element, such as the members of a STRUCT variable, the input/output variables (formal parameters) of an FB instance or the specific part of an ANY_BIT variable, enter a dot following the element name. The appearing selection box lists all members of the corresponding element that may be inserted at the current position.
Insert code templates
- Set the cursor into an empty line in the code worksheet (insert a line break if required).
- Right-click at the code position and select 'Insert Template > Code template' from the context menu.
- Replace all placeholders by the "real" variables and instance names.