Creating POU in LD

How to create a →POU (a →program, a →function block or a →function) in →LD :

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

  2. In menu File or from the context menu of the folder, select New and one of the following commands:

    • LD Program

    • LD Function Block

    • LD Function

  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. 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:

    1. The project explorer displays the created LD-object (with icon images/download/thumbnails/460423505/IconLD-version-1-modificationdate-1615279875976-api-v22.png ). The sub-level of the LD-object displays the icon to identify the declaration type: 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

    2. The POU is opened in the →graphical editor.

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

  6. Save the ladder diagram.

    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 .

logi.CAD 3 supports the declaration of one POU within an LD-object. If you require several POUs in LD, you must create several LD-objects!