Timer variables used in TP instructions are structure variables. The following table lists the internal structures.
Timer Variable
Timer Variable |
Variables Settings |
Description |
---|---|---|
VariableName.TI |
Bit Variable |
Turns ON when the timer begins. |
VariableName.Q |
Bit Variable |
Turns ON upon completion of the timer. |
VariableName.PT |
Integer Variable |
The value set on the timer |
VariableName.ET |
Integer Variable |
The current value on the timer |
Double-click the timer instruction to display the following dialog box. Enter the preset time in this dialog box.
Enter the setup value and units.
For time-based settings, double-click the timer instruction to display the setup dialog box.
Time base |
Description |
PT value/ET value |
---|---|---|
msec |
Specify the time in units of 1 millisecond. |
The PT value is specified and displayed in millisecond units. The ET value is displayed in millisecond units. Setting range = 0 to 214748364 x 1 millisecond |
10msec |
Specify the time in units of 10 milliseconds. |
The PT value is set and displayed in units of 10 milliseconds. The ET value is displayed in units of 10 milliseconds. Setting range = 0 to 21474836 x 10 milliseconds |
0.1sec |
Specify the time in units of 0.1s. |
The PT value is specified and displayed in units of 0.1s. The ET value is displayed in units of 0.1s. Setting range = 0 to 2147483 x 100 milliseconds |
sec |
Specify the time in units of 1s. |
The PT value is specified and displayed in units of 1s. The ET value is displayed in units of 1s. Setting range = 0 to 214748 x 1s |
Program Example
When the normally open instruction turns ON, the TP instruction is triggered. Because the TP instruction detects positive transitions, when the instruction is triggered, it starts the timer no matter what condition the timer was in.
The elapsed time .ET increases by the units specified as the time base.
The timer measurement bit .TI turns ON.
The timer output bit .Q turns ON and allows power to pass.
When the elapsed time .ET reaches the preset time, the TP instruction turns OFF. The timer output bit .Q turns off after the preset time has elapsed, regardless of the power flow to the left of the TP instruction.
When PT =< ET, it is immediately reset to 0.
When the elapsed time .ET equals the preset time .PT, the timer bit .TI is turned off.
When the TP instruction is off, the timer output bit .Q is off.
When the variable of the normally open instruction turns OFF, if the elapsed time .ET has reached the preset time .PT, the elapsed time .ET resets to 0.
The timer output bit .Q turns OFF.
Otherwise, the timer continues measurement and the timer output bit .Q remains ON.