Difference between revisions of "Component: STM32 Timer (Timing)"
From Flowcode Help
Jump to navigationJump to search(3 intermediate revisions by the same user not shown) | |||
Line 77: | Line 77: | ||
''<span style="color:red;">No additional examples</span>'' | ''<span style="color:red;">No additional examples</span>'' | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
Line 83: | Line 91: | ||
==Macro reference== | ==Macro reference== | ||
+ | ===GetCountMilliseconds=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
− | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetCountMilliseconds''' |
|- | |- | ||
− | | colspan="2" | Returns the count value as a number of | + | | colspan="2" | Returns the count value as a number of milliseconds |
|- | |- | ||
|- | |- | ||
Line 96: | Line 105: | ||
+ | ===GetCountReal=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
− | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetCountReal''' |
+ | |- | ||
+ | | 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="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
+ | |} | ||
+ | |||
+ | |||
+ | ===GetCountSeconds=== | ||
+ | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
+ | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
+ | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetCountSeconds''' | ||
|- | |- | ||
− | | | + | | colspan="2" | Returns the count value as a number of whole seconds, rounded down to the nearest second |
− | |||
|- | |- | ||
− | |||
|- | |- | ||
− | | 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'' | ||
|} | |} | ||
+ | ===GetCountString=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 132: | Line 152: | ||
+ | ===GetRawCount=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
− | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetRawCount''' |
|- | |- | ||
− | | colspan="2" | Returns the | + | | colspan="2" | Returns the number of milliseconds elapsed since the timer was started. |
|- | |- | ||
|- | |- | ||
Line 145: | Line 166: | ||
+ | ===ResetCounter=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
− | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ResetCounter''' |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | |
|- | |- | ||
|- | |- | ||
Line 158: | Line 180: | ||
+ | ===StartCounter=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
− | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''StartCounter''' |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | Starts the timer counting. |
|- | |- | ||
|- | |- | ||
− | | width="10%" align="center | + | | width="10%" align="center" | [[File:Fc9-bool-icon.png]] - BOOL |
− | | width="90% | + | | width="90%" | ResetCounters |
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
− | | | + | | 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="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'' | ||
|} | |} | ||
+ | ===StopCounter=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
− | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''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'' | ||
|} | |} | ||
− | |||
− | |||
Latest revision as of 13:13, 7 February 2023
Author | Matrix TSL |
Version | 1.1 |
Category | Timing |
Contents
STM32 Timer component
Allows you to measure the passage of time via the use of the STM hardware timer. Works like a stopwatch with macros to start, stop and reset the timer counter. Returns time as integer Seconds, Milliseconds and also Floating Point and String.
Component Source Code
Please click here to download the component source project: FC_Comp_Source_TimerComponentSTM32.fcfx
Please click here to view the component source code (Beta): FC_Comp_Source_TimerComponentSTM32.fcfx
Detailed description
No detailed description exists yet for this component
Examples
No additional examples
Macro reference
GetCountMilliseconds
GetCountMilliseconds | |
Returns the count value as a number of milliseconds | |
- 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 | |
Returns the number of milliseconds elapsed since the timer was started. | |
- 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 |