Omron FQM1-MMP21, FQM1-CM001 7-4-5Application Example, Interval Timer Interrupts, Section

Models: FQM1-MMP21 FQM1-MMA21 FQM1-CM001

1 414
Download 414 pages 44.52 Kb
Page 170
Image 170
7-4-5 Application Example

Interval Timer Interrupts

Section 7-4

Interval timer

Ladder Program

STIM

INTERVAL TIMER

Start timer. One-shot mode Scheduled interrupt mode

Read elapsed time.

Manual backgroundManual background Generate interrupt.

Execute interrupt task.

END

7-4-5 Application Example

In this example, the interval timer is used to generate an interrupt every

2.4ms (0.6 ms 4). The default System Setup settings are used. (Inputs are not refreshed for interrupt processing.)

First Cycle Flag

 

(ON for 1 cycle)

MOV

 

 

#0004

 

D00010

 

MOV

 

#0006

 

D00011

0002.00

@STIM

 

 

#0003

 

D00010

 

#0023

0002.00

@STIM

 

 

#000A

 

0000

 

0000

 

END

Interval timer set values:

Sets 4 for the decrementing counter set value.

Sets 0.6 ms for the decrementing time interval.

The interval timer starts when CIO 0002.00 turns ON.

Task 23 hex = 35 BCD

The interval timer stops when CIO 0002.00 turns OFF.

Interrupt task 35

Interrupt task program

END

Every 2.4 ms the interval timer times out and the interrupt task is executed.

When the program is being executed, the interrupt task will be executed every 2.4 ms while CIO 0002.00 is ON, as shown in the following diagram.

CIO 0002.00

2.4 ms

2.4 ms

2.4 ms

Interrupt task

147

Page 170
Image 170
Omron FQM1-MMP21, FQM1-CM001, FQM1-MMA21 operation manual 7-4-5Application Example, Interval Timer Interrupts, Section