Skip to main content

High-Speed Counter for PLC-S Special Program Example

Introduction

This section provides a comprehensive overview of high-speed counting capabilities within CICON. High-speed counting is a crucial feature for applications requiring the precise counting of rapid pulses, commonly used in industries such as packaging, robotics, and material handling.

High-speed counting can be achieved using various hardware options, depending on your system requirements. It can be implemented using the PLC-S mini modular or the Micro-S CPU types, both of which are suitable for smaller, space-constrained projects that still demand reliable high-speed pulse counting. Additionally, for systems requiring enhanced performance or flexibility, the CM3-SP02HSC or CM3-SP02HSD expansion module offers advanced capabilities, providing higher speed and a greater number of counting channels. The PLC-S Plus CPU, though not containing a high-speed counter functionality, can control high-speed counting through the embedded EtherCAT.

To create the high-speed counter special program, follow the steps below:

Registering the Special Program

  1. In the Project Window, right-click Program and left-click New Program.

  1. In the New Program window, left-click HSC for PLC-S.
    • Optionally, for organization, under Program Name, the name of the program and ID can be changed.
  2. Left-click OK.

Configuring the High-Speed Counter Program

  1. Under Start Address, select the data register section to use.
    • IMPORTANT: The high-speed counter program can reserve 52 WORDs, 26 for channel 1, 26 for channel 2, starting at the base data register.
  2. Under channel, select channel 1 or channel 2.
  3. For the high-speed counter to actively count, check Enable Count.
    • If this is unchecked, the high-speed counter won't count up or down.
  • Optionally, checking:
    • Enable Cmp. Output(Y) enables comparison output.
    • Latch Count enables non-volatile memory counting.
      • The current value enables be retained if the device is powered off.
    • Enable Ext. Preset enables an external preset value.
  1. Left-click Save to save the changes made to the high-speed counter program.
    • Optionally, if the PLC-S is currently in RUN mode, left-click Online Modify.

Scan Program

  1. Create a new scan program.
    • This example will always compare D100 ≤ D21.
      • D21 is the current value of the high-speed counter on channel 1.

  1. After downloading the program to the PLC, the value of D21 can be monitored. The coil, Y10.D is deenergized.

  1. Once the value of D21 was greater than or equal to the value of D100, 45,678, the coil Y10.D energizes.