The DELTA T Function Block is used to calculate the time difference between two events and set an alarm if the time exceeds a specified value.
The block will monitor the event stream from the local buffer of the SERX53 block. When the DELTA_T block detects an event that matches the C1_CARD, C1_POINT, C1_STATE and C1_0X_1X inputs, or the C2_CARD, C2_POINT, C2_STATE and C2_0X1X inputs, the trigger output will turn on, the Delta output will be set to zero and an internal timer will be started. Two command inputs are provided so that delta time measurements can be made on a piece of equipment that has inputs for both local and remote operation. When the block detects an event that matches the R_CARD, R_POINT, R_STATE and R_0X1X inputs, the trigger output will be turned off, the time difference between the command and response events will be calculated and placed in the Delta output and if the time exceeds the MAX_TIME input, the Alarm output will be turned on. If the block does not receive a response event, when the internal timer exceeds the MAX_TIME input, the Alarm output will be turned on and the Trigger output will remain on.
____________________
| |
| DELTA_T |
| |
BOOL ---| L_RDY Trigger |--- BOOL
LocalBuf ---| L_BUF Delta |--- TIME
INT ---| C1_CARD Alarm |--- BOOL
INT ---| C1_POINT History |--- TimeHistory
INT ---| C1_STATE |
BOOL ---| C1_0X_1X |
INT ---| C2_CARD |
INT ---| C2_POINT |
INT ---| C2_STATE |
BOOL ---| C2_0X_1X |
INT ---| R_CARD |
INT ---| R_POINT |
INT ---| R_STATE |
BOOL ---| R_0X_1X |
TIME ---| MAX_TIME |
| |
|____________________|
L_RDYy
The L_RDY input is set true for one scan cycle time when a new event is
available in the Local Buffer.
L_BUF
The L_BUF input expects a buffer of the LoclaBuf type, which is defined as
follows:
TYPE
LocalBuf: STRUCT
EventType: INT;
Card: INT;
Point: INT;
DateTime: UDINT;
Milliseconds: INT;
Quality: INT:
CurrentState: BOOL;
END_STRUCT;
C1_CARD
This is the card number that the block will look for to trigger the time
measurement. (1 - 16)
C1_POINT
This is the point number that the block will look for to trigger the time
measurement. (1- 32)
C1_STATE
This is the state that the block will look for to trigger the time
measurement.
C1_0X_1X
A zero on this input will force the block to look for an event type 16,
Output Change Event. A one on this input will force the block to look for an
event type 1, Input Change Event.
C2_CARD
This is the card number that the block will look for to trigger the time
measurement. (1 - 16)
C2_POINT
This is the point number that the block will look for to trigger the time
measurement. (1- 32)
C2_STATE
This is the state that the block will look for to trigger the time
measurement.
C2_0X1X
A zero on this input will force the block to look for an event type 16,
Output Change Event. A one on this input will force the block to look for an
event type 1, Input Change Event.
R_CARD
This is the card number that the block will look for to complete the time
measurement. (1 - 16)
R_POINT
This is the point number that the block will look for to complete the time
measurement. (1 – 32)
R_STATE
This is the state that the block will look for to complete the time measurement.
R_0X1X
A zero on this input will force the block to look for an event type 16,
Output Change Event. A one on this input will force the block to look for an
event type 1, Input Change Event.
MAX_TIME
The maximum time allowed between events before the alarm output is turned
on.
TRIGGER
The TRIGGER output is set true when the command event is detected.
DELTA
The time difference between the command event and the response event.
ALARM
The ALARM output is set true if the time difference between the command
event and the response event exceeds the MAX_TIME input.
HISTORY
A structure of the DeltaHistory type that contains the last 16 Delta Time
measurements and an average of the last 16 measurements.
TYPE
DeltaHistory: STRUCT
History: ARRAY [0..15] OF TIME;
Average: TIME;
END_STRUCT;