Enter Ladder Logic

After creating a project, configuring the controller, the input and outputs, and defining tags and aliases, start creating the programming for the control system. Ladder Logic is one of the languages used to define operation based on the inputs and outputs from the controllers.
Entering Ladder Logic uses these items:
Item
Description
Routine
A routine is a sequence of logic that is executed as a block. The main routine is the routine that executes first when the program runs. Subroutines are blocks of logic that are execute in response to another routine and are contained within the main routine. Fault routines are routines that execute when a program fault occurs
Instructions
Composed of a mnemonic abbreviation and a data address that define the operation to be performed by the controller. Example: CMP is the mnemonic for performing a comparison between two values.
A program consists of a set of input and output instructions. Input instructions are evaluated by the controller as being True or False. The controller sets the output instructions to True or False in response.
Rungs
The composition elements of ladder logic. Ladder logic is comprised of a set of rungs. A rung is made up of several components, which are:
  • rung number
  • left and right power rails
  • rung wire
  • rung state indicator
  • rung comment (optional)
The area to the left of the power rail is called the rung selection region.
The last rung in a routine is called the End rung and is not editable.
Branches
A parallel logic path within a rung of a ladder program.
To enter Ladder Logic
  1. Right-click the Main Routine icon in the
    Controller Organizer
    , and select
    Open
    .
    The
    Logix Designer
    application opens the Ladder Editor Routine window. If the ladder routine is empty, the application automatically adds the first rung that is ready for instructions.
    L5K_PM008_42363_pg15
  2. Use the
    Instruction Toolbox
    to add a ladder diagram element.
    TIP: The
    Language Element
    toolbar is hidden by default. To display it, select
    View > Toolbars > Language element
    .
    • To add an instruction from the Instruction Toolbox, search for an instruction or expand an instruction category, and select the instruction to add. You can also drag instructions, except Sequence instructions, and drop them into the routine. Green dots indicate valid placement locations, or drop points.
      Instruction toolbox
  3. Modify the instruction as necessary.
    Use the Tag Browser to define the corresponding tag.
  4. Add additional rungs, branches, branch levels, or instructions as required by your routine.
  5. In the
    Standard
    toolbar select the
    Verify
    icon.
  6. Errors are listed in the
    Output
    window on the
    Errors
    tab at the bottom of the application.
    1. To go to the first error or warning, press the
      F4
      key.
    2. Correct the error according to the description in the
      Errors
      tab.
    3. Repeat until you have corrected all errors.
  7. Right-click and choose
    Accept Pending Rung Edit
    .
    TIP:
    This is only required if you are online with the controller. You do not need to do this when you are offline unless you have a pending rung edit you created while online.
    If you are online, the
    Accept Pending Rung Edit
    command transfers the rung to the controller, but does not execute it if in Run mode. Any errors in your rung are sent to the
    Output
    window.
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.