Rockwell-automation 1771-DB BASIC MODULE Manual de usuario Pagina 157

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 394
  • Tabla de contenidos
  • SOLUCIÓN DE PROBLEMAS
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 156
Chapter
Statements
1
1
11 -5
Use the CLOCK1 statement to enable the free running clock resident on
the BASIC module. The special function operator TIME (page 9 -19)
increments once every 5 milliseconds after you execute CLOCK1.
CLOCK1 uses an internal timer to generate an interrupt once every
5 milliseconds. Because of this, the special function operator TIME has a
resolution of 5 milliseconds. The special function operator TIME counts
from 0 to 65535.995 seconds. After reaching a count of 65535.995
seconds TIME overflows back to a count of 0. The interrupts associated
with CLOCK1 cause the module programs to run at about 99.6% of normal
speed. This means that the interrupt handling for the free running clock
uses about 0.4% of the total CPU time.
Important: This does not include additional overhead for ONTIME user
interrupt handling execution.
Syntax
CLOCK1
Example
>10
TIME = 0
>
15 DBY(71) = 0 :REM RESET NONINTEGER PORTION OF TIME
>
20 CLOCK1
>
30 ONTIME 2,100
>
40 DO
>50
WHILE TIME < 10
>
60
END
>
100 PRINT “TIMER INTERRUPT AT – ”,TIME,“ SECONDS”
>
110 ONTIME TIME+2,100
>
120 RETI
READY
>RUN
TIMER INTERRUPT AT – 2.01 SECONDS
TIMER INTERRUPT AT – 4.015 SECONDS
TIMER INTERRUPT AT – 6.01 SECONDS
TIMER INTERRUPT AT – 8.01 SECONDS
TIMER INTERRUPT AT – 10.01 SECONDS
CLOCK1
Vista de pagina 156
1 2 ... 152 153 154 155 156 157 158 159 160 161 162 ... 393 394

Comentarios a estos manuales

Sin comentarios