TOF: Start off-delay timer (S7-1200, S7-1500) - STEP 7

FBD (S7-1200, S7-1500)

ft:publication_title
FBD (S7-1200, S7-1500)
Product
STEP 7
Version
V20
Publication date
11/2024
Language
en-US
TOF: Start off-delay timer

Description

Use the "Start off-delay timer" instruction to start an IEC Timer with a specified duration as off-delay. The query of the timer status returns the signal state "1" if the result of logic operation (RLO) at the input of the instruction has the signal state "1". When the RLO changes from "1" to "0" (negative signal edge), the IEC Timer starts with the specified time duration. The timer status remains at signal state "1" as long as the IEC Timer is running. When the timer has run out and the RLO at the input of the instruction has the signal state "0", the timer status is set to the signal state "0". If the RLO changes to "1" before the end of the timer, the running IEC Timer is reset and the timer status remain at the signal state "1".

The "Start off-delay timer" instruction can be placed only at the end of the network. It requires a preceding logic operation.

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.

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 off-delay timer" stores its data in a structure of the data type IEC_TIMER or TOF_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 TOF_TIME or IEC_TIMER in the "Static" section of a block (for example, #MyIEC_TIMER)

For S7-1500 CPU

The "Start off-delay timer" instruction stores its data in a structure of the data type IEC_TIMER, IEC_LTIMER, TOF_TIME or TOF_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 TOF_TIME, TOF_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 off-delay timer" is updated according to the following rules:

  • IN input

    The "Start off-delay 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 "1" to "0", there is a negative signal edge and the time measurement is started. After the "Start off-delay 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 off-delay 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:

  • Loading the block with reinitialization

  • Loading snapshots as actual values

  • Controlling or forcing the actual values

  • The "WRIT_DBL" instruction

Before you execute these functions, take the following precautions:

  • Make sure that the plant is in a safe state before you overwrite the actual values.

  • Make sure that the IEC timer has expired before initializing its actual values.  

  • If you overwrite the actual values with a snapshot, make sure that the snapshot was taken at a time when the system was in a safe state.

  • Make sure that the program does not read or write the affected data during transmission.

Parameters

The following table shows the parameters of the instruction "Start off-delay 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, TOF_TIME

IEC_TIMER, IEC_LTIMER, TOF_TIME, TOF_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 "Start off-delay timer" instruction is executed when the signal state of the operand "Tag_Input" changes from "1" to "0". The #MyIEC_TIMER timer is started for the time stored in the operand "Tag_TIME".

As long as timer #MyIEC_TIMER is running, the query of the time status (#MyIEC_TIMER.Q) returns the signal state "1" and operand "Tag_Output" is set. If the timer has expired and the operand "Tag_Input" has the signal state "0", the query of the timer status returns the signal state "0". If the signal state of the operand "Tag_Input" changes to "1" before timer #MyIEC_TIMER expires, the timer is reset. When the signal state of the operand "Tag_Input" is "1", the query of the timer status returns the signal state "1".