Topic: DMD0125

TICKms - Get Millisecond System Timer Value


This instruction can only be used in the Expression parameter of the Calculate Expression (MATH) instruction.

 

The Get Millisecond System Timer Value (TICKms) instruction stores the current value of the CPU's internal clock in a user-accessible memory location. This value is a 32-bit integer which should be stored in a DWord location. This value has no meaning except when used with a future call to TICKms().

 

 

Because the resolution of this value is in milliseconds, the primary use is measuring scan-to-scan events. One example is measuring the time between external I/O events.

 


Parameters:

This instruction has no parameters.

 


See Also:

 


Related Topics:

 


Event Timing Example:

  1. when the first event occurs save the current tick counter to an unused DWord register
     

  2. when the second event occurs subtract the value in the DWord register from step 1 from the current tick counter and store the result in a second unused DWord register.

 

In the example below D101 will contain the number of milliseconds between X7 turning ON and X7 turning back OFF.