![Omron CJ1M-CPU21 Operation Manual Download Page 219](http://html1.mh-extra.com/html/omron/cj1m-cpu21/cj1m-cpu21_operation-manual_742493219.webp)
190
Built-in Outputs
Section 7-1
7-1
Built-in Outputs
7-1-1
Using Interrupts to Read Input Pulses (Length Measurement)
Specifications and Operation
This example program reads the number of encoder pulses input with high-
speed counter 1 and also reads sensor inputs 1 and 2 as interrupt inputs at
terminals IN1 (2960.01) and IN3 (2960.03). The workpiece length is mea-
sured by the number of pulses counted between the ON input at sensor input
1 and the ON input at sensor input 2.
The interrupt task triggered by built-in input 1 (IN1) clears the PV of high-
speed counter 1. The interrupt task triggered by built-in input 3 (IN3) reads the
PV of high-speed counter 1 and stores the result in D00010.
Instructions Used
MSKS(690)
Enables the I/O interrupts.
INI(880)
Changes the high-speed counter PV. (Clears it to 0.)
PRV(881)
Reads the high-speed counter PV.
Preparation
PLC Setup Settings
High-speed Counter Input and Interrupt Input Settings
High-speed Counter 1
Clears the PV.
Reads the PV.
Interrupt input 1
(2960.01)
Interrupt input 3
(2960.03)
PLC Setup setting details
Address
Data
Use high-speed counter 1 (100 kHz).
Linear mode, Software reset, and Increment pulse input
053
2013 hex
Use built-in inputs IN1 and IN3 as interrupt inputs.
060
1010 hex
Disable origin search function for pulse output 0.
256
0000 hex
Disable origin search function for pulse output 1.
274
0000 hex
Summary of Contents for CJ1M-CPU21
Page 1: ...Cat No W395 E1 03 CJ series Built in I O CJ1M CPU21 22 23 CJ1M CPU Units...
Page 2: ...CJ series Built in I O CJ1M CPU21 22 23 CPU Units Operation Manual Revised August 2004...
Page 3: ...iv...
Page 19: ...xx...
Page 79: ...50 Wiring Examples Section 3 3...
Page 217: ...188 Origin Search and Origin Return Functions Section 6 3...
Page 220: ...191 Built in Outputs Section 7 1...
Page 247: ...218 Built in Outputs Section 7 1...
Page 251: ...222 Combinations of Pulse Control Instructions Appendix A...
Page 255: ...226 Using Pulse Instructions in other CPU Units Appendix B...
Page 263: ...234 Index...
Page 265: ...236 Revision History...