akYtec Lesson 5: Industrial Counters and Production Tracking

In the industrial world, data is just as important as logic. Managers need to know how many parts were produced, how many cycles a machine has completed, and when it’s time for maintenance.

In this lesson, we will implement the CTU (Count Up) block to track a proximity sensor and display that live data on the HMI screen we built in Lesson 3.

🔢 Step 1: The CTU (Count Up) Block

The CTU block is the industry standard for tracking events. It has three primary pins:

  • CU (Count Up): Every time this signal goes from False to True, the count increases by 1.
  • R (Reset): When this signal is True, the count returns to 0.
  • PV (Preset Value): A limit you set (e.g., 100 parts).
  • Q (Output): Turns ON when the count reaches the Preset Value.
  • CV (Current Value): The actual number of counts recorded.

🛠️ Step 2: Wiring the Production Counter

  1. The Trigger: Drag Input I1 onto your canvas. This represents your physical proximity sensor on a conveyor belt.
  2. The Logic: Drag a CTU block from the Counters folder in the Library. Connect I1 to the CU pin.
  3. The Reset: Drag Input I2 onto the canvas. Connect it to the R (Reset) pin. This allows an operator to clear the count manually.
  4. The Limit: Click the CTU block. In the Properties pane, set the PV to 10. This tells the logic that our production “batch” is 10 units.

🖥️ Step 3: Displaying Data on the LCD

We want the operator to see the count without needing a laptop.

  1. Go to the Display tab.
  2. Drag an Integer Value element onto the screen.
  3. Go back to the Circuit Program tab. You will see a new input pin on your “Screen” block.

🧪 Step 4: Testing the Logic

  1. Enter Simulation Mode.
  2. Click I1 multiple times. You will see the count increase on the screen preview.
  3. Once the count reaches 10, the Q output of the CTU block will turn red. (You could wire this to a “Batch Complete” light on Output Q3).
  4. Click I2 to watch the count reset to zero instantly.

💡B2B Pro-Tip: Maintenance Alerts

Professional integrators use counters for Predictive Maintenance. By setting a counter to 10,000 cycles and wiring the output to a “SERVICE REQUIRED” message on the HMI, you ensure the machine is maintained before it breaks. This is a high-value feature you can sell to B2B clients.

🔧

LogicHobbyist Automation Lab

Industrial PLCs · Modbus · EtherCAT · Beckhoff · Sensors · HMIs

We publish in‑depth technical comparisons, real‑world configuration guides, and performance reviews. Our content helps engineers and procurement teams select the right automation components. No consulting, no service offers – just reliable technical data.