beautypg.com

Sample program, 2 instructions, Example for input interrupts – Omron SYSMAC CP CP1E-N@@D@-@ User Manual

Page 341: Example for first scheduled interrupts, Example for high-speed counter interrupts

background image

2-305

2 Instructions

CP1E CPU Unit Instructions Reference Manual(W483)

I

n

terru

pt C

ont

ro

l I

n

stru

ctio

ns

2

CLI

(2) N = 4: Setting the Time to the First Scheduled Interrupt Task

When N is 4, the content of C specifies the time interval to the first scheduled interrupt task.

(3) N = 10 or 15: Clearing High-speed Counter Interrupts

When N is 10 or 15, CLI(691) clears or retains the recorded high-speed counter interrupt (target
comparison) specified by N.

Sample program

Example for Input Interrupts

When W0.00 turns ON in the following example, CLI(691) clears all interrupts stored for input interrupt 2.

Example for First Scheduled Interrupts

When W0.01 turns ON in the following example, CLI(691) sets the time to the first schedule interrupt
10.5 ms (0069 hex = 105 decimal).

Example for High-speed Counter Interrupts

When W0.02 turns ON in the following example, CLI(691) clears all interrupts stored for high-speed
counter interrupt 0.

Execution of scheduled

interrupt task.

Time to first

scheduled interrupt

MSKS(690)

CLI

102

#0001

W0.00

N

S

CLI

4

D1100

W0.01

N

S

D1100

0

15

9

0

6

0

CLI

10

#0001

W0.02

N

S

This manual is related to the following products: