Jump to content

Component: Timer Free (Timing): Difference between revisions

From Flowcode Help
m Text replacement - "width="10%" align="center" style="background-color:#D8C9D8;"" to "width="10%" align="center" class="mtx-class-macrohead""
m Text replacement - "style="background-color:#EAE1EA;"" to "class="mtx-class-propfolder""
 
(2 intermediate revisions by the same user not shown)
Line 101: Line 101:
|-
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetCountMicroSeconds'''
| width="90%" class="mtx-class-macrohead" | '''GetCountMicroSeconds'''
|-
|-
| colspan="2" | Returns the count value as a number of whole microseconds, rounded down to the nearest microsecond 
| colspan="2" | Returns the count value as a number of whole microseconds, rounded down to the nearest microsecond 
Line 115: Line 115:
|-
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetCountMilliseconds'''
| width="90%" class="mtx-class-macrohead" | '''GetCountMilliseconds'''
|-
|-
| colspan="2" | Returns the count value as a number of whole milliseconds, rounded down to the nearest millisecond 
| colspan="2" | Returns the count value as a number of whole milliseconds, rounded down to the nearest millisecond 
Line 129: Line 129:
|-
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetCountReal'''
| width="90%" class="mtx-class-macrohead" | '''GetCountReal'''
|-
|-
| colspan="2" | Returns the count value as a floating point value in seconds. 
| colspan="2" | Returns the count value as a floating point value in seconds. 
Line 143: Line 143:
|-
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetCountSeconds'''
| width="90%" class="mtx-class-macrohead" | '''GetCountSeconds'''
|-
|-
| colspan="2" | Returns the count value as a number of whole seconds, rounded down to the nearest second 
| colspan="2" | Returns the count value as a number of whole seconds, rounded down to the nearest second 
Line 157: Line 157:
|-
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetCountString'''
| width="90%" class="mtx-class-macrohead" | '''GetCountString'''
|-
|-
| colspan="2" | Returns the count value as a floating point string in seconds. 
| colspan="2" | Returns the count value as a floating point string in seconds. 
Line 176: Line 176:
|-
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetRawCount'''
| width="90%" class="mtx-class-macrohead" | '''GetRawCount'''
|-
|-
| colspan="2" |  
| colspan="2" |  
Line 190: Line 190:
|-
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ResetCounter'''
| width="90%" class="mtx-class-macrohead" | '''ResetCounter'''
|-
|-
| colspan="2" |  
| colspan="2" |  
Line 204: Line 204:
|-
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''StartCounter'''
| width="90%" class="mtx-class-macrohead" | '''StartCounter'''
|-
|-
| colspan="2" | Starts the timer counting. 
| colspan="2" | Starts the timer counting. 
Line 223: Line 223:
|-
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''StopCounter'''
| width="90%" class="mtx-class-macrohead" | '''StopCounter'''
|-
|-
| colspan="2" | Stops the timer counting. 
| colspan="2" | Stops the timer counting. 
Line 238: Line 238:
|-
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-prop-icon.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-prop-icon.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''  
| width="90%" class="mtx-class-macrohead" | '''Properties'''  
|-
|-
|-
|-
Line 271: Line 271:
| colspan="2" | Max time in seconds that we can measure before rolling over and starting again. 
| colspan="2" | Max time in seconds that we can measure before rolling over and starting again. 
|-
|-
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]]
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Simulation
| width="90%" class="mtx-class-propfolder" | Simulation
|-
|-
|-
|-

Latest revision as of 14:37, 13 July 2026

Author Matrix TSL
Version 1.1
Category Timing


Timer Free component

Allows you to measure the passage of time via the use of a hardware timer peripheral. Works like a stopwatch with macros to start, stop and reset the timer counter. Returns time as integer Seconds, Milliseconds, Microseconds and also Floating Point and String.

Component Source Code

Please click here to download the component source project: FC_Comp_Source_TimerComponentFree.fcfx

Please click here to view the component source code (Beta): FC_Comp_Source_TimerComponentFree.fcfx

Detailed description

No detailed description exists yet for this component

Examples

Here is a basic example showing the operation of the timer component used to time a section of code or the duration of a specific event.

Timer Example






Macro reference

GetCountMicroSeconds

GetCountMicroSeconds
Returns the count value as a number of whole microseconds, rounded down to the nearest microsecond 
- ULONG Return


GetCountMilliseconds

GetCountMilliseconds
Returns the count value as a number of whole milliseconds, rounded down to the nearest millisecond 
- ULONG Return


GetCountReal

GetCountReal
Returns the count value as a floating point value in seconds. 
- FLOAT Return


GetCountSeconds

GetCountSeconds
Returns the count value as a number of whole seconds, rounded down to the nearest second 
- ULONG Return


GetCountString

GetCountString
Returns the count value as a floating point string in seconds. 
- BYTE Precision
Number of decimal places to display in string 
- STRING Return


GetRawCount

GetRawCount
 
- ULONG Return


ResetCounter

ResetCounter
 
- VOID Return


StartCounter

StartCounter
Starts the timer counting. 
- BOOL ResetCounters
Range: 0-1 where 0=Do Not Reset and 1=Reset 
- VOID Return


StopCounter

StopCounter
Stops the timer counting. 
- VOID Return


Property reference

Properties
Timer
Timer Peripheral to use to monitor the passage of time. 
Bit Depth
Number of bits in the timer peripheral. 8-bit timers can count from 0-255 before overflowing. 16-bit timers can count from 0 to 65535 before overflowing. 
Instruction Rate
 
Rollover Frequency
 
Rollover Time
 
Max Time Measurement
Max time in seconds that we can measure before rolling over and starting again. 
Simulation
Timer Delay (ms)
Number of milliseconds between timer events which increment the simulated timer counter variable. 10ms will yield the highest resolution. Values less than this will likely just increase the error and making the timer run slow. Higher delays will yield greater accuracy. 
Decimal Points