Ladder Diagram (LD)

See also: IEC 61131 Language Editor Programming

See alsoEnhanced IEC 61131 Guide

 

Topic Menu

 

LD Editor Overview

The LD editor is a powerful graphical tool that enables the user to enter and manage Ladder Diagrams according to the IEC 61131-3 standard. The editor enables quick input using the keyboards, and supports advanced graphic features such as drag and drop. A Ladder Diagram is a list of rungs. Each rung represents a BooleanClosed Boolean- [Data Type BOOL] - A single bit, binary value, or register/variable. Boolean points have only two possible values, 'TRUE' or 'FALSE'. data flow from a power rail on the left to a power rail on the right. The left power rail represents the TRUE state. The data flow must be understood from the left to the right. Each symbol connected to the rung either changes the rung state or performs an operation.

The LD Toolbar

The vertical toolbar on the left side of the editor contains buttons for inserting items in the diagrams. Items are inserted at the current position in the diagram.

Shift+F4 Insert a contact before the selected item. See Managing Rungs in LD
F4 Insert a contact after the selected item. See Managing Rungs in LD
Ctrl+F4 Insert a contact in parallel with the selected items
Ctrl+Space Insert a horizontal line before the selected item so that it is pushed to the right.
Mouse Click Swap elements between NO, NC, Positive triggered or Negative triggered for Contacts and Coils. Additionally swap Set and Reset Elements for Coils. Space bar can also be used for this function.
Shift+F8 Insert a block before the selected item.
F8 Insert a block after the selected item.
Ctrl+F8 Insert a block in parallel with the selected items.
Shift+F9 Add a jump in parallel with the selected coil.
F9 Add a coil in parallel with the selected coil.
Ctrl+R Insert a new rung in the diagram. See Managing Rungs in LD
Ctrl+D Insert a comment between rungs. See Comments in LD Diagrams.
Mouse Click Align Coils to the right to uniformly display the networks.

Return to the TopLadder Diagram (LD)

Managing Rungs in LD

Ctrl+R: Press this button in the LD toolbar to insert a new rung.
Shift+F4: Insert a contact before the selected item. This icon also adds a rung when the Rung is blank.
F4: Insert a contact after the selected item.

A LD diagram is a sequential list of rungs. Each rung represents left to right Boolean power flow, that begins with a power rail, always drawn in the first column of the diagram, and finishes with a coil or a jump symbol. Each Rung is identified by a default numbered identifier (Rnnn) displayed on the left of the power rail. The rung identifier can be used as a target for instructions. Alternatively the user can enter a specific rung by double clicking in the rung head on the left margin.

The LD editor enables the user to manipulate whole rungs by selecting only their head in the left margin. The following example shows a selected rung:

When a rung is selected, use the right-click options to delete, copy or cut it.

Return to the Top: Ladder Diagram (LD)

Comments in LD Diagrams

Press this button in the LD toolbar to insert a new comment line.

The LD editor enables the user to insert comment texts in the diagram. A comments is a single line of text inserted between two rungs. The comment text is displayed on a double line in the diagram:

Comment texts have no meaning for the execution of the diagram. They are used to enhance the readability of the program, enabling the description of each rung. The comment text remains visible when the diagram is scrolled horizontally. To change the text of the comment, place the selection anywhere on the comment line and hit ENTER key, or simply double click on the comment line.

Return to the Top: Ladder Diagram (LD)

Viewing LD Diagrams

The diagram is entered in a logical grid. All objects are snapped to the grid. At any moment the user can use the commands of the "View" menu for zooming in or out the edited diagram. The user also can press the [+] and [-] keys of the numerical keypad for zooming the diagram in or out.

The user also can drag the separation lines in vertical and horizontal rulers to freely resize the cells of the grid:

The LD editor adjust the size of the font according to the zoom ratio so that the name of variables associated with contacts and coils are always visible. If cells have sufficient height, variable names are completed with other pieces of information about the variable:

  • its tag (association with the target registers)

  • its description text

Return to the Top: Ladder Diagram (LD)

Moving and Copying LD items

The LD editor fully supports drag and drop for moving or copying objects. To move objects, select them and simply drag them to the wished position, in the same rung or in another rung. To copy objects, the user may do the same, and just press the CONTROL key while dragging. It is also possible to drag pieces of diagrams from a program to another if both are open and visible on the screen. At any moment while dragging objects the user can press ESCAPE to cancel the operation. Alternatively, the user can use classical Copy/Cut/Paste commands from the Edit menu. Paste is performed at the current position. The user can manipulate whole Managing Rungs in LD by selecting only their head in the left margin (select only the cell where the rung number is displayed).

EN input and ENO output

The rung state in a LD diagram is always BooleanClosed Boolean- [Data Type BOOL] - A single bit, binary value, or register/variable. Boolean points have only two possible values, 'TRUE' or 'FALSE'.. Blocks are connected to the rung with their first input and output. This implies that special "EN" and "ENO" input and output are added to the block if its first input or output is not Boolean. The "EN" input is a condition. It means that the operation represented by the block is not performed if the rung state (EN) is FALSE. The "ENO" output always represents the sane status as the "EN" input: the rung state is not modified by a block having an ENO output.

Below is the example of the "XOR" block, having Boolean inputs and outputs, and requiring no EN or ENO pin:

(* First input is the rung. The rung is the output *)

Below is the example of the ">" (greater than) block, having non-Boolean inputs and a Boolean output. This block has an "EN" input in LD language:

(* The comparison is executed only if EN is TRUE *)

Finally, below is the example of an addition, having only numerical arguments. This block has both "EN" and "ENO" pins in LD language:

(* The addition is executed only if EN is TRUE *)

(* ENO is equal to EN *)

Return to the Top: Ladder Diagram (LD)