PT: Load time duration (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
PT: Load time duration

Description

Use the "Load time duration" instruction to set the time duration of an IEC Timer. The instruction is executed in every cycle when the result of logic operation (RLO) at the input of the instruction has the signal state "1". The instruction writes the specified time duration to the structure of the specified IEC Timer.

You assign an IEC timer declared in the program to the "Load time duration" instruction.

Note

If the specified IEC Timer is running during the execution, the instruction overwrites the current time duration of the specified IEC Timer. As a result, the timer status of the IEC Timer can change.

Updating of the actual values

The instruction data is updated when the instruction is called and each time the assigned IEC Timer is accessed. The query for Q or ET (e. g. "MyTimer".Q or "MyTimer".ET) updates the IEC_TIMER structure.

Danger

Danger when reinitializing the actual values

Reinitializing the actual values of an IEC timer while the timer 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 "Load time duration":

Parameters

Declaration

Data type

Memory area

Description

S7-1200

S7-1500

PT

Input

TIME

TIME, LTIME

I, Q, M, D, L or constant

Time duration

<IEC Timer>

InOut

IEC_TIMER, TP_TIME, TON_TIME, TOF_TIME, TONR_TIME

IEC_TIMER, IEC_LTIMER, TP_TIME, TP_LTIME, TON_TIME, TON_LTIME, TOF_TIME, TOF_LTIME, TONR_TIME, TONR_LTIME

D, L

IEC Timer, the duration of which is set.

For additional information on valid data types, refer to "See also".

Example

The following example shows how the instruction works:

The "Generate on-delay" instruction executes when the signal state of the "Tag_Input_1" operand changes from "0" to "1". The IEC Timer stored in the instance data block "TON_DB" is started with the time duration that is specified by the operand "Tag_PT".

The "Load time duration" instruction is executed when the operand "Tag_Input_2" has the signal state "1". The instruction writes the time duration "Tag_PT_2" in the instance data block "TON_DB" and at the same time overwrites the value of the operand "Tag_PT" within the data block. As a result, the signal state of the timer status can change at the next query or upon access to "MyTimer".Q or "MyTimer".ET.

Note

The "Tag_Input_2" is executed as pulse flag in order that the time duration is loaded only throughout one program cycle.