Jump to content

Component: Timed Interval (Timing): Difference between revisions

From Flowcode Help
Created page with "{| style="width:50%" |- | width="20%" style="color:gray;" | Author | Matrix TSL |- | width="20%" style="color:gray;" | Version | 1.1 |- | width="20%" style="color:gray..."
 
No edit summary
Line 20: Line 20:


==Detailed description==
==Detailed description==




Line 28: Line 30:


==Examples==
==Examples==




Line 37: Line 41:




==Downloadable macro reference==
==Macro reference==


{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"

Revision as of 14:13, 20 January 2023

Author Matrix TSL
Version 1.1
Category Timing


Timed Interval component

Allows you to setup a specific timed interval via the use of a hardware timer peripheral. Useful for regular time accurate periodic polling and sampling.

Component Source Code

Please click here for the component source code: FC_Comp_Source_TimerIntervalComponent.fcfx

Detailed description

No detailed description exists yet for this component

Examples

No additional examples


Macro reference

StartTimerInterval
Starts the timer interval. 
- VOID Return


StopTimerInterval
Stops the timer interval. 
- VOID Return



Property reference

Properties
Interval Properties
Time Unit
Unit of time used for the time period. For example you might want every 4 milliseconds or every 3 hours. 
Time Period
Value of time used for the time period. For example you might want every 4 milliseconds or every 3 hours. 
Estimated Best Period
The closest we can get to the required time period based on prescaler and postscaler settings. Smaller scalers provide finer resolution but impose limits on the maximum delay. 
Max Time Measurement
The maximum time we can do based on the current timer and scaler settings. 
Callback Macro
User defined macro automatically called on a periodic basis. 
Timer 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. 
Prescaler
Scaler applied to the timer, Small scalers allow for finer resolution but will limit the max time and also put more load on the microcontroller. Recommended to use as large a setting as possible which still provides enough accuracy.  
PostScaler
Scaler applied to the timer, Small scalers allow for finer resolution but will limit the max time and also put more load on the microcontroller. Recommended to use as large a setting as possible which still provides enough accuracy.  
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.