Command I/O Counter
 
Description The 31 I/O counters use pre-define variables which can be reset and tested for value.
The counter uses an unsigned 32bit register (U32) with names CNTKxx where xx=00 to 30.
They require the I/O to be set as an interrupt but do not require an associated INT() command.
Counter increment depends on the rising or falling edge of the interrupt.
The command RESET(CNTK00) resets to zero the I/O counter on K00.
The maximum counter speed is 0-10kHz+ and is dependent on other interrupt and entity usage.
 
Syntax/Parameters CNTK00-CNTK30
 
Example IF(CNTK00>300?Func300);   //if greater than 300 run function called Func300
TEXT(K00Text,CNTK00);;     //update counter value on page and refresh screen
 
Command RunTime Counter
 
Description The RUNTIME counter uses pre-define variables which can be set and tested for values
The command Reset(RUNTIME) sets all vales to zero and starts the timer.
This runtime counter is independent of the real time clock and runs continually so no setup is required.
 
Syntax/Parameters CNTMILLI - Increments every millisecond 0-999
CNTSECS -
Increments every second 0-59
CNTMINS -
Increments every minute 0-59
CNTHOURS -
Increments every hour 0-23
CNTDAYS -
Increments every 24 hours
CNTRUN -
Increments every millisecond since system reset. 86,400,000 = 1 day - v47.12.
 
Options

RunTime Counter Interrupts
Wrap-around interrupt for the RunTime counter have been added.
       INT(name,CNTMILLI,function);  // function called every 1000ms
       INT(name,CNTSECS,function);   // function called every 60s
       INT(name,CNTMINS,function);   // function called every 60mins
       INT(name,CNTHOURS,function);  // function called every 24hours
       INT(name,CNTDAYS,function);   // function called every 2^32days
       For timer resolutions of less than a second, use TIMER0 to TIMER9.

 
Example IF(CNTMINS>30?FuncHalfHour);   //if greater than 30 minutes run function called FuncHalfHour
TEXT(MinsText,CNTMINS);;         //update counter value on page and refresh screen