Owning Palette: Timer Function Blocks
Requires: RT Module
A timer that counts up to preset time (ms) while enable is TRUE. When enable is FALSE, this function block retains the accumulated time (ms) value. When accumulated time (ms) reaches preset time (ms), done returns TRUE until reset, but accumulated time (ms) continues to increment while enable is TRUE until reset.
| Dialog Box Options |
| Block Diagram Inputs |
| Block Diagram Outputs |
| Parameter | Description |
|---|---|
| Inputs | Contains the following configuration options:
|
| Outputs | Contains the following configuration options:
|
| Parameter | Description |
|---|---|
| error in (no error) | Describes error conditions that occur before this node runs. |
| reset | Sets the value of accumulated time (ms) to zero. |
| preset time | Specifies the amount of time for the function block to use in calculations. |
| enable | Determines whether to measure the cumulative time elapsed time between iterations. |
| Parameter | Description |
|---|---|
| error out | Contains error information. This output provides standard error out functionality. |
| done | Indicates whether the latest count has finished. |
| accumulated time | Returns the accumulated time elapsed while enabled since the first call or last reset. |
The timing of this function block depends on the rate of the Timed Loop or While Loop in which you place the function block. For example, if you need the function block to update with millisecond resolution, you can place the function block in a Timed Loop configured to execute every millisecond.
The following timing diagram illustrates the behavior of this function block.