Timer and Counter PLC Programming. for Allen Bradley Micro800 with CCW

Timers and Counters in Connected Components Workbench

Introduction

  • Topic: Timers and counters in Connected Components Workbench (CCW)

  • Focus: Micro 850 PLC, but principles applicable to all Micro 800 PLCs.

  • Clarification needed on differences between Rockwell software: RSLogix 500, Studio 5000, and CCW regarding counters.

  • Plan: Create a user-defined function block for a counter, understand data structures.

Review of Previous Topics

  • Recap of questions from previous live stream on timers and counters.

  • Differences highlighted between RSLogix environments and CCW, especially in handling counters.

Importance of Understanding Timers and Counters

  • Timers and counters are critical for automation in PLC programming.

  • Essential for controlling processes based on time and count conditions.

Tools and Resources

  • Recommended Books:

    • Connected Components Workbench – Hands-On Learning Part 1 & 2 by the PLC Professor.

    • Connected Components Workbench for PanelView 800 and PowerFlex 525.

  • Availability of additional visuals and lab exercises in the books.

Project Setup in CCW

Starting a New Project
  • Project name: "My Counter and Timer"

  • Select Micro 850, model 2080-L50-24QBB.

  • Configure PLC properties for an IP address (default 192.168.1.10 with subnet mask 255.255.255.0).

    • Important to remember: change from default DHCP to static IP for proper connection.

Adding a Program
  • Navigate to programs, add a ladder diagram, and rename to "Prue 1".

    • Define input/output (I/O) structure:

    • Inputs (e.g., Green button = Digital Input 4, Yellow button = Digital Input 5).

    • Outputs (Green light = Output 0, Yellow light = Output 1).

Timers in CCW

Timer Instruction - T N
  • Used for timing functions in PLCs.

    • Syntax: Create a timer preset called "timer_presets".

  • Utilizes accumulated time (ET), preset time (PT), done (DN), etc.

    • Timer variables tracked (actual timing operations):

    • Q: Done bit - True when done.

    • R: Reset - Returns to zero.

    • ET: Elapsed time count.

Timer Configuration Details
  • Users encouraged to examine timer tracking for effective automation configuration.

  • Discussion on proper timer naming for user variables.

Creating a Visual Timer in Ladder Logic
  • Implementing rungs to control lights based on timer status.

    • Direct contacts based on timer status and elapsed time for visual feedback.

  • Discussed using built-in instructions like greater than (GRT) for controlling outputs based on timing conditions.

Key Timers Overview

  • TON (Timer On Delay):

    • Times when the input is true.

  • TOF (Timer Off Delay):

    • Times when the input is false.

  • RTO (Retentive Timer On):

    • Retains accumulated time across cycles.

Counters in CCW

Counter Instruction - CTU and CTD
  • Differences from Studio 5000/RSLogix:

    • CTU: Counts up.

    • CTD: Counts down.

    • CUD: Combination of count up and down.

  • Special considerations for preset values in counters (particularly with micro 800 controllers).

Implementing Counter Rungs
  • Discussion on integrating both counting families.

  • Use of continuous contacts to monitor pressing button inputs for incrementing counts.

    • Clear indication needed on counters achieving preset states leading to output actions.

Major Points of Difference
  • Significant distinction on how counting functions differ across platforms, affecting control logic.

    • Cumulative counts should not exceed preset values (live feedback on exceeding capacities needed).

User-Defined Function Blocks

Creating a Custom Counter
  • Instructions on designing user-defined function blocks to encapsulate custom counter logic for easy reuse across systems.

  • Connections and operations within the function need to be configured correctly (inputs for enable bits, outputs for accumulated values).

Adding Reset and Done Conditions
  • Built-in reset functionality to clear accumulated values when needed.

  • Include outputs for done, overflow, and underflow bits directly tied to performance of the counter logic.

Important Notes on Functionality
  • Configuration of function blocks needs careful attention to ensure correct operation across PLC cycles.

  • Presented examples must include debugging and testing strategies to confirm proper timer/counter performance (printed results can be key).

Final Thoughts

  • Importance of clearly understanding differences and functionality of timers and counters in CCW leads to more successful program development in real-world applications.

  • Anticipate future lessons on analog wiring and application to enhance foundational knowledge within the field.

    • Upcoming sessions promise to clarify analog signal wiring concepts (i.e. 4-20 mA).

  • Encouragement for audience engagement and questions to foster better learning opportunities and comprehension.

Closing
  • Announcement of upcoming topics related to successful project management and analog signal handling in automation environments.