Description
Use the instruction "Start pulse timer" to start an IEC Timer with a specified duration as pulse. The IEC Timer is started when the result of logic operation (RLO) changes from "0" to "1" (positive signal edge). The IEC Timer runs for the specified time duration regardless of the subsequent course of the RLO. The expiry of the IEC Timer is also not affected by the detection of a new rising edge. As long as the IEC Timer is running, the querying of the timer status for "1" returns the signal state "1". When the IEC Timer has expired, the timer status returns the signal state "0".
The current timer status is stored in the Q structure component of the IEC timer. You can query the timer status with the help of a binary logic operation.
The execution of the "Start pulse timer" instruction can be placed only at the end of the network. It requires a preceding logic operation.
|
Note The start and the query of the IEC Timer may be on different expiry levels as each query of the outputs Q or ET updates the IEC_TIMER structure. |
For S7-1200 CPU
The instruction "Start pulse timer" stores its data in a structure of the data type IEC_TIMER or TP_TIME. You can declare the structure as follows:
-
Declaration of a data block of system data type IEC_TIMER (for example, "MyIEC_TIMER")
-
Declaration as a local tag of the type TP_TIME or IEC_TIMER in the "Static" section of a block (for example, #MyIEC_TIMER)
For S7-1500 CPU
The instruction "Start pulse timer" stores its data in a structure of the data type IEC_TIMER, IEC_LTIMER, TP_TIME or TP_LTIME. You can declare the structure as follows:
-
Declaration of a data block of system data type IEC_TIMER or IEC_LTIMER (for example, "MyIEC_TIMER")
-
Declaration as a local tag of the type TP_TIME, TP_LTIME, IEC_TIMER or IEC_LTIMER in the "Static" section of a block (for example, #MyIEC_TIMER)
Updating the actual values in the instance data
The instance data from "Start pulse timer" is updated according to the following rules:
-
IN input
The "Start pulse timer" instruction compares the current RLO with the RLO from the previous query, which is saved in the IN parameter in the instance data. If the instruction detects a change in the RLO from "0" to "1", there is a positive signal edge and the time measurement is started. After the "Start pulse timer" instruction has been processed, the value of the IN parameter is updated in the instance data and is used as edge memory bit for the next query.
Note that the edge evaluation is disrupted when the actual values of the IN parameter are written or initialized by other functions.
-
PT input
The value at the PT input is written to the PT parameter in the instance data when the edge changes at the IN input.
-
Q and ET outputs
The actual values of the Q and ET outputs are updated in the following cases:
-
When the instruction is called, if the ET or Q outputs are interconnected.
Or
-
At an access to Q or ET.
If the outputs are not interconnected and also not queried, the current time value at the Q and ET outputs is not updated. The outputs are not updated, even if the instruction is skipped in the program.
The internal parameters of the "Start pulse timer" instruction are used to calculate the time values for Q and ET. Note that the time measurement is disrupted when the actual values of the instruction are written or initialized by other functions.
-
|
|
Danger |
|
Danger when reinitializing the actual values Reinitializing the actual values of an IEC timer while the time measurement is running disrupts the function of the IEC timer. Changing the actual values can result in inconsistencies between the program and the actual process. This can cause serious damage to property and personal injury. The following functions can cause the actual values to be reinitialized:
Before you execute these functions, take the following precautions:
|
|
Parameters
The following table shows the parameters of the instruction "Start pulse timer":
|
Parameters |
Declaration |
Data type |
Memory area |
Description |
|
|---|---|---|---|---|---|
|
S7-1200 |
S7-1500 |
||||
|
VALUE |
Input |
TIME |
TIME, LTIME |
I, Q, M, D, L or constant |
Duration with which the IEC Timer runs. |
|
<IEC Timer> |
InOut |
IEC_TIMER, TP_TIME |
IEC_TIMER, IEC_LTIMER, TP_TIME, TP_LTIME |
D, L |
IEC Timer which is started. |
You can find additional information on valid data types under "See also".
Pulse timing diagram
The following figure shows the pulse timing diagram of the instruction:
Example
The following example shows how the instruction works:
The instruction "Start pulse timer" is executed when the signal state of the operand "Tag_Input" changes from "0" to "1". The timer "DB1".MyIEC_TIMER is started for the time stored in the operand "TagTime".
As long as the timer "DB1".MyIEC_TIMER is running, the timer status ("DB1".MyIEC_TIMER.Q) has signal state "1" and the operand "Tag_Output" is set. When the IEC Timer has expired, the signal state of the time status changes back to "0" and the "Tag_Output" operand is reset.