- Help Center
- Automation/Electrical
- Programmable Controllers
-
Pneumatics
- Air Cylinders
- Air Dryers
- Auto Switches
- Boosters
- Electric Actuators
- Fieldbus System/Serial Transmission System
- Fittings
- Modular F.R.L.
- Pressure Switches
- Regulators
- Rotary Actuators
- Solenoid Valve
- Temperature Control Equipment
- Vacuum Equipment
- Photoelectric Sensors
- Process Valves
- Valve Clamps and Accessories
- Pumps
- Additional Articles in Pneumatics
- Safety Valves
- Tubing
-
Hydraulics
-
Automation/Electrical
- Contact Sensors / Liquid Leakage Sensors
- Level Switches
- Basic Switches
- Limit Switches
- Push Buttons / Indicator Lamps
- Thumbwheel Switches
- Safety Limit Switches
- Temperature Controllers
- Counters
- Programmable Relays
- Programmable Controllers
- Safety Sensors
- Safety Door Switches
- Solid-state Relays
- Timers
- Inverters
- Power Supplies
- Axial Fans
- Wiring Systems
- Rotary Encoders
- Pressure Sensors
- Displacement Sensors/Measurement Sensors
- Ultrasonic Sensors
- Emergency Stop Switches
- Power Controllers
- Signal Converters
- Machine Automation Controllers
- RFID Systems
- Measuring / Motor Protective Relays
- Vision Sensors / Machine Vision Systems
- Photomicro Sensors
- Digital Panel Indicators
- Programmable Terminals
- Servomotors / Servo Drivers
- Proximity Sensors
- General Purpose Relays
- Fieldbus Communications
-
Safety
-
Website Help Center
How do I write a program that uses index registers and increment instructions to do an incremental count?
The following introduces a method to count 32 pulse input bits within a loop program using FOR-NEXT instructions and an index register. (FOR-NEXT instructions can be used on CS1 and CJ1 Programmable Controllers (PLC).)
Key Points About This Program
Under basic operating principles, differentiated instructions and instructions with the @ option cannot be used within loop programs. Therefore the program in the following figure has been used.
Basic Structure of a Program to Generate Differentiated Bit
Program
Count input bits: CIO 0.00 to CIO 1.15 (32 bits): Processed with index register IR0
BCD, 4 digits, incremental counter: D100 to D131 (32 bits): Processed with index register IR1
Differentiated Bit Generated Flag: W0.00 to W1.15 (32 bits): Processed with index register IR2