Deadtime (DEDT)

This information applies to the
CompactLogix
5370,
ControlLogix
5570,
Compact GuardLogix
5370,
GuardLogix
5570,
Compact GuardLogix
5380,
CompactLogix
5380,
CompactLogix
5480,
ControlLogix
5580, and
GuardLogix
5580 controllers.
The Deadtime (DEDT) instruction performs a delay of a single input. You select the amount of deadtime delay.
Available Languages
Ladder Diagram
This instruction is not available in ladder diagram logic.
Function Block
DEDT_FB_avail_v31
Structured Text
DEDT(DEDT_tag,storage);
Operands
Structured Text
Operand
Type
Format
Description
DEDT tag
DEADTIME
structure
DEDT structure
storage
REAL
array
deadtime buffer
See
Structured Text Syntax
for more information on the syntax of expressions within structured text.
Function Block
Operand
Type
Format
Description
DEDT tag
DEADTIME
structure
DEDT structure
storage
REAL
array
deadtime buffer
DEADTIME Structure
Input Parameter
Data Type
Description
EnableIn
BOOL
Enable input. If false, the instruction does not execute and outputs are not updated.
Default is true.
In
REAL
The analog signal input to the instruction.
Valid = any float
Default = 0.0
InFault
BOOL
Bad health indicator for the input. If the input value is read from an analog input, then InFault is controlled by fault status on the analog input. If true, InFault indicates the input signal has an error, the instruction sets the appropriate bit in Status, the control algorithm is not executed, and Out is held.
Default is false.
false = good health
Deadtime
REAL
Deadtime input to the instruction. Enter the deadtime in seconds. If this value is invalid, the instruction assumes a value of zero and sets the appropriate bit in Status.
Valid = 0.0 to (StorageArray size * DeltaT)
Default = 0.0
Gain
REAL
Gain input to the instruction. The value of In is multiplied by this value. This allows simulation of a process gain.
Valid = any float
Default = 1.0
Bias
REAL
Bias input to the instruction. The value of In multiplied by the Gain is added to this value. This allows simulation of an ambient condition.
Valid = any float
Default = 0.0
TimingMode
DINT
Selects timing execution mode.
0 = Period mode
1 = oversample mode
2 = real time sampling mode
Valid = 0 to 2
Default = 0
For more information about timing modes, see Function Block Attributes.
OversampleDT
REAL
Execution time for oversample mode.
Valid = 0 to 4194.303 seconds
Default = 0
RTSTime
DINT
Module update period for real time sampling mode
Valid = 1 to 32,767ms
Default = 1
RTSTimeStamp
DINT
Module time stamp value for real time sampling mode.
Valid = 0 to 32,767ms
Default = 0
Output Parameter
Data Type
Description
EnableOut
BOOL
Indicates if instruction is enabled. Cleared to false if Out overflows.
Out
REAL
The calculated output of the deadtime algorithm.
DeltaT
REAL
Elapsed time between updates. This is the elapsed time in seconds used by the control algorithm to calculate the process output.
Status
DINT
Status of the function block.
InstructFault (Status.0)
BOOL
The instruction detected one of the following execution errors. This is not a minor or major controller error. Check the remaining status bits to determine what occurred.
InFaulted (Status.1)
BOOL
In health is bad.
DeadtimeInv (Status.2)
BOOL
Invalid Deadtime value.
TimingMode (Status.27)
BOOL
Invalid TimingMode value.
For more information about timing modes, see Function Block Attributes.
RTSMissed (Status.28)
BOOL
Only used in real time sampling mode. Set when
ABS(DeltaT - RTSTime) > 1 millisecond.
RTSTimeInv (Status.29)
BOOL
Invalid RTSTime value.
RTSTimeStampInv (Status.30)
BOOL
Invalid RTSTimeStamp value.
DeltaTInv (Status.31)
BOOL
Invalid DeltaT value.
Description
The DEDT instruction uses a data buffer to store delayed data, thereby allowing any length deadtime desired. The DEDT instruction is designed to execute in a task where the scan rate remains constant.
To use the DEDT instruction, create a storage array to store the deadtime buffer to hold the samples of (In x Gain) + Bias. The storage array should be large enough to hold the largest desired deadtime, using this formula:
StorageArray Size Needed = Maximum Deadtime (secs) / DeltaT (secs)
Servicing the Deadtime Buffer
During runtime, the instruction checks for a valid Deadtime. Deadtime must be between 0.0 and (StorageArray Size x DeltaT).
If the Deadtime is invalid, the instruction sets an appropriate Status bit and sets Out = (In x Gain) + Bias.
The deadtime buffer functions as a first-in, first-out buffer. Every time the deadtime algorithm executes, the oldest value in the deadtime buffer is moved into Out. The remaining values in the buffer shift downward and the value ((In x Gain) + Bias) is moved to the beginning of the deadtime buffer. A new value that is placed in the deadtime buffer appears in the Out after Deadtime seconds.
The number of array elements required to perform the programmed delay is calculated by dividing Deadtime by DeltaT. If Deadtime is not evenly divisible by DeltaT, then the number of array elements and the programmed delay are rounded to the nearest increment of DeltaT. For example, to find the number of array elements required to perform the programmed delay given Deadtime = 4.25s and DeltaT = 0.50s:
4.25s / 0.50s = 8.5
rounds up to 9 array elements required
The actual delay applied to the input in this example is:
number of array elements x DeltaT = programmed delay or
9 x 0.5s = 4.5s
Runtime changes to either Deadtime or DeltaT change the point in which values are moved out of the buffer. The number of elements required to perform the programmed delay can either increase or decrease. Prior to servicing the deadtime buffer, the following updates occur:
If the number of required elements needs to increase, the new buffer elements are populated with the oldest value in the current deadtime buffer.
If the number of required elements needs to decrease, the oldest elements of the current deadtime buffer are discarded.
Instruction Behavior on InFault Transition
When InFault is true (bad), the instruction suspends execution, holds the last output, and sets the appropriate bit in Status.
When InFault transitions from true to false, the instruction sets all values in the deadtime buffer equal to In x Gain + Bias.
Affects Math Status Flags
No
Major/Minor Faults
None specific to this instruction. See
Common Attributes
for operand-related faults.
Execution
Function Block
Condition/State
Action Taken
Prescan
EnableIn and EnableOut bits are cleared to false.
Tag.EnableIn is false
EnableIn and EnableOut bits are cleared to false.
Tag.EnableIn is true
EnableIn and EnableOut bits are set to true.
The instruction executes.
Instruction first run
N/A
Instruction first scan
N/A
The instruction does not execute, but does validate input parameters.
Postscan
EnableIn and EnableOut bits are cleared to false.
Structured Text
Condition/State
Action Taken
Prescan
See Prescan in the Function Block table.
Normal Execution
See Tag.EnableIn is true in the Function Block table.
Postscan
See Postscan in the Function Block table.
Example
In this example, the DEDT instruction simulates a deadtime delay in a simulated process. The output of the PIDE instruction is passed through a deadtime delay and a first-order lag to simulate the process. The array DEDT_01array is a REAL array with 100 elements to support a deadtime of up to 100 samples. For example, if this routine executes every 100 msec, the array would support a deadtime of up to 10 seconds.
Function Block
DEDT_FB_ex_v31
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.