DT_AS_WORD: Converting Date and Time as Word
This figure shows the pin diagram of the DT_AS_WORD function block:
The DT_AS_WORD function block extracts data from date and converts to equivalent words.
The DATE_AND_TIME input is converted to output in the form of WORD having year, month, date, hour, minute and second separately.
With the input DT#2008-08-15-11:05:30, outputs are:
oOutput year: 2008
oOutput month: 8
oOutput day: 15
oOutput hours: 11
oOutput minutes: 5
oOutput seconds: 30
This table describes the input pins of the DT_AS_WORD function block:
Input |
Data Type |
Description |
---|---|---|
i_dtDttm |
DT |
Date and time input Range: 1970-01-01-00:00:00... 2106-02-07-06:28:15 |
This table describes the output pins of the DT_AS_WORD function block:
Output |
Data Type |
Description |
---|---|---|
q_wYear |
WORD |
Year output Range: 1970...2106 |
q_wMnth |
WORD |
Month output Range: 1...12 |
q_wDay |
WORD |
Date output Range: 1...31 |
q_wHrs |
WORD |
Hours output Range: 1...23 |
q_wMin |
WORD |
Minutes output Range: 1...59 |
q_wSec |
WORD |
Seconds output Range: 1...59 |
Instantiation and Usage Example
This figure shows an instance of the DT_AS_WORD function block:
Operation of the function block is given in the below example:
oi_dtDttm: DT#2008-08-15-11:05:30
oq_wYear: 2008
oq_wMnth: 8
oq_wDay: 15
oq_wHrs: 11
oq_wMin: 5
oq_wSec: 30