Component: Timer Free (Timing): Difference between revisions
Appearance
No edit summary |
m Text replacement - "style="background-color:#EAE1EA;"" to "class="mtx-class-propfolder"" |
||
| (13 intermediate revisions by 2 users not shown) | |||
| Line 17: | Line 17: | ||
==Component Source Code== | ==Component Source Code== | ||
Please click here | Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_TimerComponentFree.fcfx FC_Comp_Source_TimerComponentFree.fcfx] | ||
Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_TimerComponentFree.fcfx FC_Comp_Source_TimerComponentFree.fcfx] | |||
==Detailed description== | ==Detailed description== | ||
| Line 42: | Line 52: | ||
==Examples== | ==Examples== | ||
| Line 66: | Line 84: | ||
{{Fcfile|TimerExample.fcfx|Timer Example}} | {{Fcfile|TimerExample.fcfx|Timer Example}} | ||
==Macro reference== | ==Macro reference== | ||
{| class="wikitable | ===GetCountMicroSeconds=== | ||
{| class="mtx-class-macrotable wikitable" | |||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''GetCountMicroSeconds''' | ||
|- | |- | ||
| colspan="2" | Returns the count value as a number of whole | | colspan="2" | Returns the count value as a number of whole microseconds, rounded down to the nearest microsecond | ||
|- | |- | ||
|- | |- | ||
| Line 82: | Line 111: | ||
{| class="wikitable | ===GetCountMilliseconds=== | ||
{| class="mtx-class-macrotable wikitable" | |||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''GetCountMilliseconds''' | ||
|- | |- | ||
| colspan="2" | | | colspan="2" | Returns the count value as a number of whole milliseconds, rounded down to the nearest millisecond | ||
|- | |- | ||
|- | |- | ||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u32-icon.png]] - ULONG | |||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9- | |||
| width="90%" style="border-top: 2px solid #000;" | ''Return'' | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
|} | |} | ||
{| class="wikitable | ===GetCountReal=== | ||
{| class="mtx-class-macrotable wikitable" | |||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''GetCountReal''' | ||
|- | |- | ||
| colspan="2" | Returns the count value as a floating point | | colspan="2" | Returns the count value as a floating point value in seconds. | ||
|- | |- | ||
|- | |- | ||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-f32-icon.png]] - FLOAT | |||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9- | |||
| width="90%" style="border-top: 2px solid #000;" | ''Return'' | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
|} | |} | ||
{| class="wikitable | ===GetCountSeconds=== | ||
{| class="mtx-class-macrotable wikitable" | |||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''GetCountSeconds''' | ||
|- | |- | ||
| colspan="2" | Returns the count value as a number of whole | | colspan="2" | Returns the count value as a number of whole seconds, rounded down to the nearest second | ||
|- | |- | ||
|- | |- | ||
| Line 131: | Line 153: | ||
{| class="wikitable | ===GetCountString=== | ||
{| class="mtx-class-macrotable wikitable" | |||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''GetCountString''' | ||
|- | |- | ||
| colspan="2" | Returns the count value as a | | colspan="2" | Returns the count value as a floating point string in seconds. | ||
|- | |||
|- | |||
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | |||
| width="90%" | Precision | |||
|- | |- | ||
| colspan="2" | Number of decimal places to display in string | |||
|- | |- | ||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9- | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-string-icon.png]] - STRING | ||
| width="90%" style="border-top: 2px solid #000;" | ''Return'' | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
|} | |} | ||
{| class="wikitable | ===GetRawCount=== | ||
{| class="mtx-class-macrotable wikitable" | |||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''GetRawCount''' | ||
|- | |- | ||
| colspan="2" | | | colspan="2" | | ||
|- | |- | ||
|- | |- | ||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9- | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u32-icon.png]] - ULONG | ||
| width="90%" style="border-top: 2px solid #000;" | ''Return'' | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
|} | |} | ||
{| class="wikitable | ===ResetCounter=== | ||
{| class="mtx-class-macrotable wikitable" | |||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''ResetCounter''' | ||
|- | |- | ||
| colspan="2" | | | colspan="2" | | ||
| Line 170: | Line 200: | ||
{| class="wikitable" | ===StartCounter=== | ||
{| class="mtx-class-macrotable wikitable" | |||
|- | |||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | |||
| width="90%" class="mtx-class-macrohead" | '''StartCounter''' | |||
|- | |- | ||
| | | colspan="2" | Starts the timer counting. | ||
|- | |- | ||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-bool-icon.png]] - BOOL | |||
| width="90%" | ResetCounters | |||
|- | |- | ||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9- | | colspan="2" | Range: 0-1 where 0=Do Not Reset and 1=Reset | ||
|- | |||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | |||
| width="90%" style="border-top: 2px solid #000;" | ''Return'' | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
|} | |} | ||
{| class="wikitable | ===StopCounter=== | ||
{| class="mtx-class-macrotable wikitable" | |||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''StopCounter''' | ||
|- | |- | ||
| colspan="2" | | | colspan="2" | Stops the timer counting. | ||
|- | |- | ||
|- | |- | ||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9- | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | ||
| width="90%" style="border-top: 2px solid #000;" | ''Return'' | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
|} | |} | ||
==Property reference== | ==Property reference== | ||
{| class="wikitable | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-prop-icon.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''Properties''' | ||
|- | |- | ||
|- | |- | ||
| Line 236: | 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" | | width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]] | ||
| width="90%" | | 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.
Macro reference
GetCountMicroSeconds
| GetCountMicroSeconds | |
| Returns the count value as a number of whole microseconds, rounded down to the nearest microsecond | |
| Return | |
GetCountMilliseconds
| GetCountMilliseconds | |
| Returns the count value as a number of whole milliseconds, rounded down to the nearest millisecond | |
| Return | |
GetCountReal
| GetCountReal | |
| Returns the count value as a floating point value in seconds. | |
| Return | |
GetCountSeconds
| GetCountSeconds | |
| Returns the count value as a number of whole seconds, rounded down to the nearest second | |
| Return | |
GetCountString
| GetCountString | |
| Returns the count value as a floating point string in seconds. | |
| Precision | |
| Number of decimal places to display in string | |
| Return | |
GetRawCount
| GetRawCount | |
| Return | |
ResetCounter
| ResetCounter | |
| Return | |
StartCounter
| StartCounter | |
| Starts the timer counting. | |
| ResetCounters | |
| Range: 0-1 where 0=Do Not Reset and 1=Reset | |
| Return | |
StopCounter
| StopCounter | |
| Stops the timer counting. | |
| Return | |