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)
To open IEC 61131-3 editor, double-click Application.
- ⇒
IEC 61131-3 editor opens in a new window.
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.
Right-click POUs and select Add Object.
- ⇒
Under Language of the POU, select FBD. Click OK.
- ⇒
A newly generated POU opens. The programming language of the POU is FBD.
Click on the Save button.
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.
- ⇒
Alternatively, right-click on the dotted rectangle and select Box.
- ⇒
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.
Click on ??? and press F2.
- ⇒
The input assistant opens.
Select Global Variables. Select the variable you want to assign.
- ⇒
Alternatively, click on ??? and type DI04 for input 1 and DI05 for input 2.
To assign an output: Click on the right side of the AND operator. Right-click on the dotted rectangle and select Assign.
- ⇒
You assigned an output.
Type DO00 for the output. Or press F2 for opening the input assistant.
Add a new network
Right-click on network 0001 and select Network (after).
- ⇒
You added a new network after network 0001. The new network number is 0002.
Insert a Negation
Right-click on the dotted rectangle and select Assign.
Type DO00 for input and DO01 for output.
Click behind the input DO00.
- ⇒
The dotted rectangle represents the cursor position. The cursor position is behind DO00.
Right-click on the dotted rectangle and select Negate.
- ⇒
You inserted a negation between DO00 and DO01.
Insert a Comment
Right-click on network 0001 and select Comment.
- ⇒
The text Comment appears gray colored on first position in network 0001.
Double-click on Comment and insert DI04 AND DI05 = DO00.
- ⇒
Create a Task Configuration for your Program
In the Resources register card, double-click Task configuration.
- ⇒
In work space the Task configuration window opens.
Right-click on Task configuration and select Append Task.
- ⇒
Under
, enter 10.- ⇒
Right-click on the watch icon and select Append Program Call.
- ⇒
Click on … to open the input assistant.
- ⇒
Double-click on PLC_PRG (PRG).
- ⇒
You finished the task configuration.
You can close the Task configuration window.
Compile your Project
Click on the Save button.
From the Project menu, click Build.
- ⇒
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.