Add a user-defined function block to a ladder program

Use the steps to add the user-defined function block Traffic_Controller_FB to the Traffic_Light_Control Program Organization Unit (POU).
To add a user-defined function block to a ladder program
  1. In
    Project Organizer
    , expand
    Programs
    , and then double-click
    Traffic_Light_Control
    to open the program.
  2. From
    Toolbox
    , locate and drag
    Traffic_Controller_FB
    to rung 0.
  3. Right-click the box beside
    Traffic_Controller_FB
    , and then select
    New variable
    .
  4. In
    New variable
    , enter the variable name
    Traffic_Controller_FB_1
    , and then select
    Create
    .
  5. In the
    Properties
    pane, turn on
    EN/ENO
    for
    Traffic_Controller_FB
    .
  6. Save the project by doing one of the following:
    • From the menu bar, select save button.
    • From the
      File
      menu, select
      Save
      .
    The first function block input that connects directly to the ladder rung is the function block enable (EN) bit. The remaining four function block inputs are "real-world" inputs that indicate whether a car is waiting at a red light in any of the four possible directions: North, South, East, or West. These inputs get mapped to four Boolean input variables that are local to the function block: N_CAR_SENSOR, S_CAR_SENSOR, E_CAR_SENSOR, and W_CAR_SENSOR. You must assign four L70E controller inputs to these function block inputs.
    To see the full names and data types of the variables that are associated with these inputs and outputs, hover over the instruction block to display a tooltip:
    UDFB tooltip
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.
Normal