Owning Palette: Timer
Installed With: RT Module
Reports the elapsed time, in milliseconds, since the first call or previous reset of the function block.
If reset mode is TRUE on a reset iteration, elapsed time (ms) returns the time elapsed prior to the reset. Otherwise, elapsed time (ms) returns zero on a reset iteration.
| 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 function block runs. If an error occurs, the function block does not execute. |
| reset mode | Specifies whether to report elapsed time (ms) on reset iterations. When reset mode is TRUE on a reset iteration, elapsed time (ms) returns the time that elapsed prior to the reset. When reset mode is FALSE on a reset iteration, elapsed time (ms) returns zero. |
| reset | Sets counter value to zero. |
| Parameter | Description |
|---|---|
| error out | Contains error information. If error in (no error) indicates that an error occurred before this function block ran, error out contains the same error information. Otherwise, it describes the error status that this function block produces. Right click the error out front panel indicator and select Explain Error from the shortcut menu for more information about the error. |
| elapsed time (ms) | Returns the amount of time, in milliseconds, that has elapsed since the initial call or previous reset of the function block. |
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.