Programming your Project

You write the program code in a separate IEC 61131-3 editor (IEC 61131-3 editor). You can open IEC 61131-3 editor out of Automation_Builder.

Supported programming languages:

  • ST (Structured Text)
  • IL (Instruction List)
  • FBD (Function Block Diagram)
  • LD (Ladder Diagram)
  • SFC (Sequential Function Chart)
  • CFC (Continuous Function Chart)
  1. To open IEC 61131-3 editor, double-click Application.

    ../_images/c5d65b1022ff7b480a33139001e174a9

    IEC 61131-3 editor opens in a new window.

    ../_images/8fb0bbfbb6bc1a840a33139000115228
  2. Change the Programming Language into FBD

    Default programming language is ST.

    Select PLC_PRG (PRG) and press DELETE.

    Note

    If you made a mistake during the process, you can always undo. From the Edit menu, select Undo.

  3. Right-click POUs and select Add Object.

    ../_images/87f7bcafa2080e750a33139000f458a0
  4. Under Language of the POU, select FBD. Click OK.

    A newly generated POU opens. The programming language of the POU is FBD.

    ../_images/6a72fc27a20e448f0a3313900047c428
  5. Click on the Save button.

  6. Create an AND operator

    Click on the dotted rectangle behind ???. From the toolbar, click on the Box icon.

    The dotted rectangle represents the cursor position in this network.

    ../_images/d0634946a24bebbd0a3313900011bc58
  7. Alternatively, right-click on the dotted rectangle and select Box.

    ../_images/c23adc07a26110d10a331390016ebddb
    ../_images/936d4392a641f7230a331390004ce418

    Note

    When inserting a new box, it always appears as an AND operator. You can change the type of the box at any time. Click on the AND text and type another name. Or click on the AND text and press F2. You will get an overview of all accepted operators, functions and Function Blocks.

  8. Click on ??? and press F2.

    The input assistant opens.

  9. Select Global Variables. Select the variable you want to assign.

    ../_images/44a39126a650ba9b0a33139000f5a619
  10. Alternatively, click on ??? and type DI04 for input 1 and DI05 for input 2.

  11. To assign an output: Click on the right side of the AND operator. Right-click on the dotted rectangle and select Assign.

    ../_images/9a4a698f232c50590a331390015bbd78

    You assigned an output.

    ../_images/4aff181f2330078b0a33139000c7eb4e
  12. Type DO00 for the output. Or press F2 for opening the input assistant.

  13. Add a new network

    Right-click on network 0001 and select Network (after).

    ../_images/02df597c2338cdae0a331390018588e0

    You added a new network after network 0001. The new network number is 0002.

    ../_images/be79f79ca67f3f0d0a33139001ec0369
  14. Insert a Negation

    Right-click on the dotted rectangle and select Assign.

  15. Type DO00 for input and DO01 for output.

  16. Click behind the input DO00.

    The dotted rectangle represents the cursor position. The cursor position is behind DO00.

    ../_images/dd6b4f05a685417b0a33139001de000c
  17. Right-click on the dotted rectangle and select Negate.

    You inserted a negation between DO00 and DO01.

    ../_images/a97cdde2a69459960a33139001b88022
  18. Insert a Comment

    Right-click on network 0001 and select Comment.

    The text Comment appears gray colored on first position in network 0001.

    ../_images/50c70b8ba6ab8d690a33139000ea3b6e
  19. Double-click on Comment and insert DI04 AND DI05 = DO00.

    ../_images/bfa439efa6ad69a30a33139001aa82c2
  20. Create a Task Configuration for your Program

    In the Resources register card, double-click Task configuration.

    In work space the Task configuration window opens.

    ../_images/f8a1bdfe27f15bec0a33139000713a53
  21. Right-click on Task configuration and select Append Task.

    ../_images/91c3175027f90bff0a33139000dba79c
  22. Under Properties ‣ Interval, enter 10.

    ../_images/2fc9451a2800715d0a331390005c1647
  23. Right-click on the watch icon and select Append Program Call.

    ../_images/456babae280c41070a33139000d4258f
  24. Click on to open the input assistant.

    ../_images/cafa5a79280ecb840a33139000adf991
  25. Double-click on PLC_PRG (PRG).

    ../_images/d51f02f22811744b0a3313900131ad64
    ../_images/31a68e9b2814c0e30a33139000b27d2f
  26. You finished the task configuration.

    You can close the Task configuration window.

  27. Compile your Project

    Click on the Save button.

  28. From the Project menu, click Build.

    ../_images/69b92b31a70688b20a33139000ef0697

    During compilation a message window opens. The message window shows the progress of the compilation process and any errors and warnings. Double-click on the error message to open the window that contains the error.

    ../_images/96e50d94a72d17a80a33139000b85661