Remote-processing CAMBASIC Manuale Utente Pagina 192

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 208
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 191
Event Multitasking - 3
COUNT MULTITASKING
Introduction
CAM BASIC supports eight event counters. These ar e generated in software and are intended for low– speed counting.
Each counter may be assigned through software to any digital I/O line on any Control or expansion card. Once
configured, counting is done independently in the background. T he counters have the following features:
1. The count rate may range from 0 to 80 Hz.
2. The counters m ay be read at any time with the C OUN T function. T his function is
synchronized with the counter so that valid data is always read.
3. You can program the counter so that the program br anches to a subroutine w hen it reaches a
preset am ount using the ON COUN T statem ent.
4. You can also create a module n counter by having the c ounter automatically r eset when it
reaches a preset c ount, using the CONF IG CO UNT statement.
5. The counters are 16– bit and can accumulate up to 65,535 counts.
6. You can stop and zero the counters individually or in groups with the CLEAR COUNT
statement.
7. You can start the counting individually or in groups w ith the STA RT C OUN T statem ent.
8. You can suspend counter operation while maintaining the count with the STOP COUNT
statement.
9. You can restart the counters without resetting the count using the RESUME COUNT
statement.
How Counting is Done
A specified input line is sampled 200 times (100 times in 9 MHz systems) per second. As shown in Figure 1, when the
software detects that the input changes from a high logic state to a low logic state, the counter is incremented.
Count
input
Sample
Counter
Increment
Figure 1
Vedere la pagina 191
1 2 ... 187 188 189 190 191 192 193 194 195 196 197 ... 207 208

Commenti su questo manuale

Nessun commento