Difference between revisions of "Component: STM32 Timer (Timing)"

From Flowcode Help
Jump to navigationJump to search
Line 17: Line 17:
 
==Component Source Code==
 
==Component Source Code==
  
Please click here for the component source code: [https://www.flowcode.co.uk/wikicopy/componentsource/FC_Comp_Source_TimerComponentSTM32.fcfx FC_Comp_Source_TimerComponentSTM32.fcfx]
+
Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_TimerComponentSTM32.fcfx FC_Comp_Source_TimerComponentSTM32.fcfx]
  
 
==Detailed description==
 
==Detailed description==
 +
 +
  
  
Line 40: Line 42:
  
 
==Examples==
 
==Examples==
 +
 +
  
  
Line 62: Line 66:
  
 
==Macro reference==
 
==Macro reference==
 +
 +
{| 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-u32-icon.png]] - ULONG
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
 +
 +
 +
{| 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;" | '''StartCounter'''
 +
|-
 +
| colspan="2" | Starts the timer counting. 
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-bool-icon.png]] - BOOL
 +
| 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="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
 +
 +
 +
{| 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;" | '''GetCountString'''
 +
|-
 +
| 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-string-icon.png]] - STRING
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
 +
 +
 +
{| 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;" | '''GetCountMilliseconds'''
 +
|-
 +
| colspan="2" | Returns the count value as a number of milliseconds 
 +
|-
 +
|-
 +
| 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''
 +
|}
 +
 +
 +
{| 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;" | '''StopCounter'''
 +
|-
 +
| colspan="2" | Stops the timer counting. 
 +
|-
 +
|-
 +
| 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''
 +
|}
 +
 +
 +
{| 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;" | '''ResetCounter'''
 +
|-
 +
| colspan="2" |  
 +
|-
 +
|-
 +
| 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''
 +
|}
 +
 +
 +
{| 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;" | '''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''
 +
|}
 +
 +
 +
{| 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;" | '''GetRawCount'''
 +
|-
 +
| colspan="2" | Returns the number of milliseconds elapsed since the timer was started. 
 +
|-
 +
|-
 +
| 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''
 +
|}
 +
 +
 +
 +
 +
==Property reference==
 +
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''
 +
|-
 +
|-
 +
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
 +
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Simulation
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
 +
| width="90%" | Timer Delay (ms)
 +
|-
 +
| colspan="2" | 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. 
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
 +
| width="90%" | Decimal Points
 +
|-
 +
| colspan="2" |  
 +
|}==Macro reference==
  
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"

Revision as of 15:17, 20 January 2023

Author Matrix TSL
Version 1.1
Category Timing


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 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

Fc9-comp-macro.png GetCountSeconds
Returns the count value as a number of whole seconds, rounded down to the nearest second 
Fc9-u32-icon.png - ULONG Return


Fc9-comp-macro.png StartCounter
Starts the timer counting. 
Fc9-bool-icon.png - BOOL ResetCounters
Range: 0-1 where 0=Do Not Reset and 1=Reset 
Fc9-void-icon.png - VOID Return


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


Fc9-comp-macro.png GetCountMilliseconds
Returns the count value as a number of milliseconds 
Fc9-u32-icon.png - ULONG Return


Fc9-comp-macro.png StopCounter
Stops the timer counting. 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png ResetCounter
 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png GetCountReal
Returns the count value as a floating point value in seconds. 
Fc9-f32-icon.png - FLOAT Return


Fc9-comp-macro.png GetRawCount
Returns the number of milliseconds elapsed since the timer was started. 
Fc9-u32-icon.png - ULONG Return



Property reference

Fc9-prop-icon.png Properties
Fc9-conn-icon.png Simulation
Fc9-type-21-icon.png 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. 
Fc9-type-21-icon.png Decimal Points
 

==Macro reference==

Fc9-comp-macro.png GetCountSeconds
Returns the count value as a number of whole seconds, rounded down to the nearest second 
Fc9-u32-icon.png - ULONG Return


Fc9-comp-macro.png StartCounter
Starts the timer counting. 
Fc9-bool-icon.png - BOOL ResetCounters
Range: 0-1 where 0=Do Not Reset and 1=Reset 
Fc9-void-icon.png - VOID Return


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


Fc9-comp-macro.png GetCountMilliseconds
Returns the count value as a number of milliseconds 
Fc9-u32-icon.png - ULONG Return


Fc9-comp-macro.png StopCounter
Stops the timer counting. 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png ResetCounter
 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png GetCountReal
Returns the count value as a floating point value in seconds. 
Fc9-f32-icon.png - FLOAT Return


Fc9-comp-macro.png GetRawCount
Returns the number of milliseconds elapsed since the timer was started. 
Fc9-u32-icon.png - ULONG Return



Property reference

Fc9-prop-icon.png Properties
Fc9-conn-icon.png Simulation
Fc9-type-21-icon.png 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. 
Fc9-type-21-icon.png Decimal Points