DateTimeOperation Function Block
The Date And Time Operation function block can carry out a variety of operations with two dates and times. Three outputs that indicate the operation's outcome.
Figure 2: DateTimeOperation Function Block |
Figure 2: DateTimeOperation Property Sheet |
Input
Input Name |
Description |
Date1 |
The input should be in YYMMDD format, where YY- Year, MM- Month and DD- Day. Range: Day= 1-31 Month= 1-12 Year= 0-9999 Null= Ignore the Date |
Time1 |
The input Should be in the format hhmmss, where hh- hours, mm-minutes and ss-seconds. Range: Seconds= 0-59 Minutes= 0-59 Hours= 0-23 Null= ignore the Time |
Date2 (In&Par) |
The input should be in YYMMDD format, where YY- Year, MM- Month and DD- Day. Range: Day= 1-31 Month= 1-12 Year= 0-9999 Null= Ignore the Date |
Time2 (In&Par) |
The input Should be in the format hhmmss, where hh- hours, mm-minutes and ss-seconds. Range: Seconds= 0-59 Minutes= 0-59 Hours= 0-23 Null= ignore the Time |
Table 1: Input of DateTimeOperation Function
Output
Output Name |
Description |
Out1 |
The value depends on Format Out 1 Parameter. A floating value of 5 digits is output. |
Out2 |
The value depends on Format Out 2 Parameter. A floating value of 5 digits is output. |
Out3 |
The value depends on Format Out 3 Parameter. A floating value of 5 digits is output. |
Table 2: Output of DateTimeOperation Function
Parameter
Parameter Name |
Description |
Operations |
Either both Date and Time are used as operation, or if something is missing then either only date and or only time is considered. Enum: 1= Always 0, means Out1,Out2,Out3=0 2=Subtract Date 2Time 2-Date 1Time1. The result can be negative. |
Date 2 (In&Par) |
Default=Null=Ignore the Date. |
Time 2 (In&Par) |
Default=Null=Ignore the Time. |
Format Out 1 |
The output Out 1 is configured with different meaning and formatting. For integer values the decimals are truncated.(2.24324->2). For Floating values, the value is shown with 5 digits. Enum: 00: Always 0(Default) 01: Second as integer value 02: Minutes as integer value 04: Hours as integer value 08: Days as integer value 16: Month as integer value 32: Year as integer value 65: Seconds as floating value 66: Minutes as floating value 68: Hours as floating value 72: Days as floating value 80: Months as floating value 96: Year as floating value |
Format Out 2 |
The output Out 2 is configured with different meaning and formatting. Same as Enum as Format Out 1. Default=0=Always 0 |
Format Out 3 |
The output Out 3 is configured with different meaning and formatting. Same as Enum as Format Out 1. Default=0=Always 0 |
Out Save |
Master Sync Enabled : If you set it to "true" the last output will be set as output for one cycle after the controller restarts. The application can use it to return to the same state before the controller restart. Out1: To enable or disable the Out1 feature. Out2:To enable or disable the Out2 feature. Out3:To enable or disable the Out3 feature. |
Table 3: Parameters of DateTimeOperation Function
Example:
Refer to General Description for general information about IRM N4 Function Blocks.