LD Blocks

In a language container, connect blocks to Boolean lines. Blocks can be operators, functions, or function blocks. Boolean inputs and outputs are not always contained within blocks. Boolean inputs connecting blocks to rungs are always executed each cycle. Boolean outputs connecting blocks to rungs control the remaining rung power flow. When inserting blocks in a diagram, the EN and ENO parameters are added to some block interfaces. Also force the inclusion of the EN and ENO parameters for blocks with either one Boolean input, one Boolean output, or no Boolean input and output. Activate the Enable EN/ENO option from the Ladder Diagram options.
For functions and function blocks, set the value of return parameters using coils. The return parameter of a function has the same name as the function. The return parameters of a function block can have any name.
Insert blocks from the
LD Toolbox
. Set the type of a block using the
Block Selector
at any time following insertion. When setting the type of block, variables automatically display and are connected to the inputs and outputs of the block.
Replace input and output variables by double-clicking them to access the
Variable Selector
or single-clicking them to select from a drop-down combo-box containing the global and local variables. Also, single-click a variable, then type a literal value in the text box provided. When inserting literal values that being with a letter or an underscore, enclose the variable name in single quotes as follows: 'abc'.
  • Select a variable from the drop-down combo-box:
    ldr_bl1
  • Type a literal value in the text box:
    ldr_bl2
When selecting items like local variables, global variables, and defined words from the drop-down combo-box, type characters in the text box to focus on the possible items.
EN Input
For operators, functions, and function blocks where the first input is not a Boolean data type, another input called EN is automatically inserted at the first position since the first input is always connected to the rung. The block is executed only when the EN input is TRUE. The following example shows a comparison operator and its equivalent code expressed in ST:
ldr_b3
IF rung_state THEN q := (value1 > value 2); ELSE q := FALSE; END_IF; (* continue rung with o1 state *)
ENO Output
For operators, functions, and function blocks where the first output is not a Boolean data type, another output called ENO is automatically inserted at the first position since the first output is always connected to the rung. The ENO output always has the same state as the first input of the block. The following example shows the AVERAGE function block and its equivalent code expressed in ST:
ldr_b4
AVERAGE(rung_state, Signal, 100); OutSignal := AVERAGE.XOUT; eno := rung_state; (* continue rung with eno state *)
EN and ENO Parameters
In some cases, both EN and ENO parameters are required. The following example shows an arithmetic operator and its equivalent code expressed in ST.
ldr_b5
IF rung_state THEN result := (value1 + value2); END_IF; eno := rung_state; (* continue rung with eno state *)
While dragging blocks from either the toolbox or within a diagram, the language editor displays the possible drop points. Drop points display as plus signs in a black circle. For elements, the possible drop points display on the rung.
Drop points on a rung while dragging elements over the rung:
ldr_dpbk
Perform these tasks for blocks in the LD editor:
Task
Procedure
Access the Parameters view
  • In the
    Application View
    , right-click the required function or function block, then click
    Parameters
    .
Insert a block
  1. From the
    Toolbox
    , drag the block element into the language container and place it on the rung where a drop point is displayed.
    The
    Block Selector
    is displayed.
  2. In the
    Block Selector
    , locate the required block. You can sort the block list according to the columns by setting these in ascending or descending order.
  • To force the inclusion of the EN/ENO parameters, select
    Enable EN/ENO
    .
  1. Click
    OK
    .
    The selected block is displayed on the rung.
Insert a parallel block
  1. From the
    Toolbox
    , drag the branch element onto the existing block in the language container.
  2. Place a block element on the branch:
    1. From the
      Toolbox
      , drag the block element into the language container. The block appears on the branch.
    2. From the
      Block Selector
      , locate the block. Sort the block list by clicking the column heading to toggle between ascending and descending order.
  3. Click
    OK
    . The selected block appears on the branch.
Drag a block
  • To reposition a block within the diagram, select the block while holding down the left mouse button, then drag the block to the required location on a rung where a drop point is displayed.
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.
Normal