SUB_DT_TIME
Function Name |
SUB_DT_TIME |
---|---|
Description |
Subtracts a time input from a date time input to provide a date time output. |
Arguments |
Input 1 {DATE_AND_TIME} Input 2 {TIME} For more information on the data types for the inputs and outputs, see Data Type Hierarchy. |
Returns |
Output {DATE_AND_TIME} The Output is the result of Input 1 - Input 2 |
Example:
Function Block Diagram - SUB_DT_TIME:
A SUB_DT_TIME function has 2 inputs (in this case, a NOW function and a constant):
- Input 1 is connected to a NOW function
- Input 2 is set to T#45m.
The SUB_DT_TIME function returns a date time value that is the result of the current date and time - 45 minutes.
ST Program - SUB_DT_TIME:
The syntax for a SUB_DT_TIME function in an ST Program is:
- Output := SUB_DT_TIME (Input 1, Input 2)
Where Output, Input 1 and Input 2 are defined as variables earlier in the ST program. Input 1 is a date time value, Input 2 is a time value, and the Output is a date and time value.