Creating application in ST

How to create a →POU (a →program, a →function block or a →function), an →interface or a →data type in →ST:

  1. Select a folder of the →project in which you want to create the ST-object.

  2. In menu File or from the context menu of the folder, select New and the command ST-Object.
    Alternative: Select the command ST Program , ST Function Block , ST Function or Data type so that the created ST-object already contains a predefined ST-syntax for the respective ST language element.

  3. In the dialog:

    1. Enter a name under File name.
      images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/information.svg If possible, do not enter invalid characters (e.g. umlauts, blanks, the character –, numbers at the start) because the file name is automatically used as POU-name and this POU-name must be a valid →IEC-identifier. But if you need such invalid characters in the file name, delete or replace the invalid characters in POU name before you click Finish.
      It is possible to change the POU-name at any time later.

    2. Only provided when selecting the commands ST Program , ST Function Block , ST Function or Data type and if necessary: Enter a →namespace under Namespace name . T he text must be an →IEC-identifier or a fully qualified name.
      A fully qualified name consists of a sequence of namespace identifiers separated by . (dots).
      It is also possible to enter/change a namespace later on within the editor. If the field already contains a namespace and you are not able to change the namespace, it is likely that you are creating the object within a namespace folder (in this case the namespace is determined by the namespace folder).

  4. Afterwards click Finish .
    Result: The project explorer displays the created ST-object (with icon images/download/thumbnails/409862706/IconST-version-1-modificationdate-1531214719389-api-v22.png ). The ST-editor is opened for this object.

  5. Start to enter the ST-code in the editor.
    Use the numerous features and actions provided by logi.CAD 3 to create the ST-code. For instance, the content assist and the highlighting of errors are supporting you in creating your application in ST correctly and quickly.

    logi.CAD 3 supports the declaration of several elements within an ST-object.
    The sub-level of the ST-object displays one icon per element to identify the declaration type of the element. Examples: images/download/thumbnails/409862636/Program-version-1-modificationdate-1531214393443-api-v2.png = program, images/download/thumbnails/409862631/Instance-version-1-modificationdate-1531214366502-api-v2.jpg = function block, images/download/thumbnails/409862626/Function-version-1-modificationdate-1531214341453-api-v2.png = function

  6. Save the ST-code.

    No check of invalid connections

    For some blocks, invalid connections are not checked by logi.CAD 3. Therefore, enter code in your application to detect invalid connections (e.g. IF-statements in the ST-code). Example: An invalid connection occurs during a calculation using an IEC-block. Giving you a specific example: Calculating -250.5 by means of the EXPT-block is an invalid connection.
    Invalid connections of blocks that are checked by logi.CAD 3 are listed in the description of the corresponding block.

    See "IEC-blocks for the application" for information what the consequences of an invalid connection might be.

    Moreover, observe the effects of the compiler settings on the a ccuracy and behavior of mathematical functions .

  7. Edit and save the ST-code as necessary.