Inst ToolsInst ToolsInst Tools
  • Courses
  • Automation
    • PLC
    • Control System
    • Safety System
    • Communication
    • Fire & Gas System
  • Instrumentation
    • Design
    • Pressure
    • Temperature
    • Flow
    • Level
    • Vibration
    • Analyzer
    • Control Valve
    • Switch
    • Calibration
    • Erection & Commissioning
  • Interview
    • Instrumentation
    • Electrical
    • Electronics
    • Practical
  • Q&A
    • Instrumentation
    • Control System
    • Electrical
    • Electronics
    • Analog Electronics
    • Digital Electronics
    • Power Electronics
    • Microprocessor
  • Request
Search
  • Books
  • Software
  • Projects
  • Process
  • Tools
  • Basics
  • Formula
  • Power Plant
  • Root Cause Analysis
  • Electrical Basics
  • Animation
  • Standards
  • 4-20 mA Course
  • Siemens PLC Course
Reading: Example of Using a Counter in Omron PLC
Share
Font ResizerAa
Inst ToolsInst Tools
Font ResizerAa
  • Courses
  • Design
  • PLC
  • Interview
  • Control System
Search
  • Courses
  • Automation
    • PLC
    • Control System
    • Safety System
    • Communication
    • Fire & Gas System
  • Instrumentation
    • Design
    • Pressure
    • Temperature
    • Flow
    • Level
    • Vibration
    • Analyzer
    • Control Valve
    • Switch
    • Calibration
    • Erection & Commissioning
  • Interview
    • Instrumentation
    • Electrical
    • Electronics
    • Practical
  • Q&A
    • Instrumentation
    • Control System
    • Electrical
    • Electronics
    • Analog Electronics
    • Digital Electronics
    • Power Electronics
    • Microprocessor
  • Request
Follow US
All rights reserved. Reproduction in whole or in part without written permission is prohibited.
Inst Tools > Blog > PLC Tutorials > Example of Using a Counter in Omron PLC

Example of Using a Counter in Omron PLC

Example of Using a Counter in Omron PLC with CX-Programmer to count input events using CNT, CNTX, CNTR, and CNTRX instructions.

Last updated: July 7, 2025 4:56 pm
Editorial Staff
PLC Tutorials
No Comments
Share
8 Min Read
SHARE

This article will discuss the use of various COUNTER instructions in the Omron PLC. Counter instructions are functions used to count the number of specific signals or events (such as input pulses, sensor condition changes, or machine operations) and produce an output when the count reaches a predetermined value. In the CX-Programmer software, there are four types of Counter Instructions (CNT, CNTX, CNTR, and CNTRX). Each instruction will activate a specific output (e.g., a lamp) when the counter data reaches the predefined set value parameter.

Contents
Program ObjectiveCNT InstructionCNTX(546) InstructionCNTR(012) InstructionCNTRX(548) InstructionPLC Simulation VideoExample of Using a CounterIO MappingOmron PLC (CX-Programmer)

Program Objective

PLC Counters Simulation

Here we discussed different counters in the Omron PLC.

CNT Instruction

The CNT instruction is a Decrement counter instruction with a maximum counter SV (Set Value) of “9999”.

This instruction counts counter data in BCD (Binary Coded Decimal) format, so the SV parameter must begin with the syntax “#”.

The CNT instruction has two input parameters: one to decrement the PV (Present Value) of the counter, and one to reset the PV.

In this instruction, the counter SV is set to “#5”, and it will activate Lamp 1 after receiving a trigger five times.

CNTX(546) Instruction

The CNTX instruction is a Decrement counter instruction with a maximum SV of “65535” in decimal format and “#FFFF” in hexadecimal format.

The SV parameter must begin with the syntax “&” if written in decimal, and with “#” if written in hexadecimal. The CNTX instruction has two input parameters: one to decrement the PV and one to reset it.

In this instruction, the counter SV is set to “&6”, and it will activate Lamp 2 after receiving a trigger six times.

CNTR(012) Instruction

The CNTR is a counter instruction that can increment and decrement the PV with a maximum SV of “9999”. This instruction counts counter data in BCD (Binary Coded Decimal) format, so the SV must be written with the “#” syntax.

The CNTR instruction has three input parameters: one to decrement, one to increment, and one to reset the PV.

In this instruction, the SV is set to “#7”, and it will activate Lamp 3 after receiving a trigger more than seven times.

CNTRX(548) Instruction

The CNTRX is a counter instruction that can increment and decrement the PV with a maximum SV of “65535” in decimal or “#FFFF” in hexadecimal.

The SV parameter must begin with “&” if in decimal format, and with “#” if in hexadecimal format. The CNTRX instruction has three input parameters: one to decrement, one to increment, and one to reset the PV.

In this instruction, the SV is set to “&8”, and it will activate Lamp 4 after receiving a trigger more than eight times.

PLC Simulation Video

In the video below, we simulated the PLC program with an HMI screen and results displayed.

Counters in Omron PLC Example with Simulation

Example of Using a Counter

Example of Using a Counter

IO Mapping

S.No.CommentInput (I)Output(Q)COUNTER
1TRIG_CNT_BCD0.00  
2RES_CNT_BCD0.01  
3TRIG_CNT_BIN0.02  
4RES_CNT_BIN0.03  
5+CNTR_BCD0.04  
6-CNTR_BCD0.05  
7RES_CNTR0.06  
8+CNTRX_BIN1.00  
9-CNTRX_BIN1.01  
10RES_CNTRX1.02  
11OUT1 100.00 
12OUT2 100.01 
13OUT3 100.02 
14OUT4 100.03 
15COUNTER_BCD  C000
16COUNTER_BIN  C001
17COUNTER_BCD_REVERSIBLE  C002
18COUNTER_BIN_REVERSIBLE  C003

Omron PLC (CX-Programmer)

Omron PLC Counter Programming Example

RUNG 0 (COUNTER BCD)

In this Rung, if the TRIG_CNT_BCD (0.00) button is pressed, the value in the counter memory COUNTER_BCD (C000) will increase (+1). When the value in the counter memory COUNTER_BCD (C000) is Equal To “0” then the CNT Instruction will be ON.

And if the RES_CNT_BCD (0.01) button is pressed, the value in the counter memory COUNTER_BCD (C000) will be reset to “#5”.

RUNG 1 (OUT BCD)

In this Rung, the output OUT1 (100.00) will be ON if the NO contact of COUNTER_BCD (C000) is in the HIGH state.

RUNG 2 (COUNTER BIN)

In this Rung, if the TRIG_CNT_BIN (0.02) button is pressed, then the value in the counter memory COUNTER_BIN (C001) will increase (+1). When the value in the counter memory COUNTER_BIN (C001) is Equal To “0 then the CNTX(546) instruction will be ON.

And if the RES_CNT_BIN (0.03) button is pressed, then the value in the counter memory COUNTER_BIN (C001) will be reset to “&6”.

Basic Counter Example in Omron CX-Programmer

RUNG 3 (OUT BIN)

In this Rung, the output OUT2 (100.01) will be ON if the NO contact of COUNTER_BIN (C001) is in HIGH state.

RUNG 4 (COUNTER BCD REVERSIBLE)

In this Rung, if the +CNTR_BCD (0.04) button is pressed, then the value in the counter memory COUNTER_BCD_ REVERSIBLE (C002) will increase (+1). And if the -CNTR_BCD (0.05) button is pressed, then the value in the counter memory COUNTER_BCD_ REVERSIBLE (C002) will decrease (-1).

When the value in the counter memory COUNTER_BCD_ REVERSIBLE (C002) is Exceeds “#7” then the CNTR(012) instruction will be ON.

And if the RES_CNTR (0.06) button is pressed, then the value in the counter memory COUNTER_BCD_ REVERSIBLE (C002) will be reset to zero “0”.

RUNG 5 (OUT BCD REVERSIBLE)

In this Rung, the output OUT3 (100.02) will be ON if the NO contact of COUNTER_BCD (C002) is in the HIGH state.

CNT, CNTX, CNTR, CNTRX Counters

RUNG 6 (COUNTER BIN REVERSIBLE)

In this Rung, if the +CNTR_BIN (1.00) button is pressed, then the value in the counter memory COUNTER_BIN_ REVERSIBLE (C003) will increase (+1). And if the -CNTR_BIN (1.01) button is pressed, then the value in the counter memory COUNTER_BIN_ REVERSIBLE (C003) will decrease (-1).

When the value in the counter memory COUNTER_BIN_REVERSIBLE (C003) is Exceeds “&8” then the CNTRX(548) instruction will be ON.

And if the RES_CNTRX (1.02) button is pressed, then the value in the counter memory COUNTER_BIN_ REVERSIBLE (C003) will be reset to zero “0”.

RUNG 7 (OUT BIN REVERSIBLE)

In this Rung, output OUT4 (100.03) will be ON if the NO contact of COUNTER_BIN (C003) is in HIGH state.

PLC Counter Program Download

Read Next:

  • Siemens Motor PLC Programming Example
  • Tank Farm Management PLC Programming
  • EasyBuilder Pro Online Simulation of PLC
  • Increment & Decrement Instructions
  • Learn Instrumentation & Control Systems

Don't Miss Our Updates
Be the first to get exclusive content straight to your email.
We promise not to spam you. You can unsubscribe at any time.
Invalid email address
You've successfully subscribed !

Continue Reading

How to Interchange ON Delay Timer and OFF Delay Timer in a PLC
Automation System for Hazardous Environments
#2 PLC Best Practices – Track Operating Modes
Create Ladder Diagram from Boolean Logic
Will PLCs become obsolete?
Extended Timer Logic in PLC
Share This Article
Facebook Whatsapp Whatsapp LinkedIn Copy Link
Share
Leave a Comment

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Stay Connected

128.3kFollowersLike
69.1kFollowersFollow
210kSubscribersSubscribe
38kFollowersFollow

Categories

Explore More

What is Complementary Split Range Control (CSRC)?
Instrumentation and Control Project Packages – Detail Engineering
#20 PLC Best Practices – Identify Critical Alerts
High-end Programmable Logic Controller – Schneider PLC
RSLogix5000 PLC Program Backup procedure
Ferrules and Cross Ferruling
The Concept of Shift Register in Omron PLC with Example
PLC Analog I/O Potential Problems – Troubleshooting & Issues

Keep Learning

Comparator used in Siemens S7-1200 PLC.

Siemens PLC Comparator Logic

SCADA Run

PLC Based Industrial Conveyor Ladder Logic

Master Control Reset (MCR) ladder logic

How to use Master Control Reset (MCR) Instruction in PLC

TP Timer in CodeSys

Timers in Codesys – Timer ON, Timer OFF, Pulse Timer

Fail Safe Switch Circuit

Basics of Fail-safe Circuits

SCADA Software and their Comparison

SCADA Software and their Comparison

Free Download SCADA Softwares

Free SCADA Software Download

SCADA Interview Questions

SCADA Interview Questions and Answers

Learn More

Working of Stepper Motor

Types of Stepper Motors

Difference between Current Transformer and Potential Transformer

Difference between Current Transformer and Potential Transformer

SFC Language in PLC Programming

SFC Language in PLC Programming

Power Systems Questions & Answers

Power Systems MCQ Series 13

NDIR GAS ANALYSER WORKING PRINCIPLE ANIMATION

NDIR Gas Analyser Working Principle

ControlLogix 5580 Controllers

Rockwell PLCs for Large Scale Applications

Logic Gates and Truth tables

Logic Gates and Truth tables

Marking Machine

PLC SCL Program for Marking Machine

Menu

  • About
  • Privacy Policy
  • Copyright

Quick Links

  • Learn PLC
  • Helping Hand
  • Part Time Job

YouTube Subscribe

Follow US
All rights reserved. Reproduction in whole or in part without written permission is prohibited.
Welcome Back!

Sign in to your account

Username or Email Address
Password

Lost your password?