beautypg.com

Special i/o functions – Toshiba 6F3B0253 User Manual

Page 269

background image

6F3B0253

Basic Hardware and Function

267

8. Special I/O Functions

Sample program

(H0803)

In this example, 2051 (H0803) is set in SW16. As a result, the quadrature bi-pulse
counter is selected.
When R010 comes ON, the data 150000 is set into the comparison value 1 register
(SW19

SW18), and 200000 is set into the comparison value 2 register (SW21

SW20).

While R010 is ON, the soft-gate (S240), the interrupt enable flag 1 (S241) and the
interrupt enable flag 2 (S249) are set to ON to enable the counter operation.
The count value is stored in SW23

SW22.

When R010 is OFF and R011 comes ON, the count value is preset to the data of
D0101

D0100.