day_time
Function A function calculates a result according to the current value of its inputs. A function has no internal data and is not linked to declared instances. - Format the present date / time to a string.
Inputs
Input |
Data Type |
Range |
Unit |
Default |
Description |
---|---|---|---|---|---|
SEL |
DINT |
0, 2 |
N/A |
No default |
Format string. |
Outputs
Output |
Data Type |
Range |
Unit |
Description |
---|---|---|---|---|
Q |
STRING |
No range |
N/A |
String containing formatted date or time. |
Remarks
-
-
PCMM generation 1 controllers do not have real-time clock hardware.
PCMM2G does have re-time clock hardware.
Real-time clock may not be available on all controller hardware models.
See the controller hardware specifications for real-time clock availability.
Valid values of the SEL input are:
Value | Description |
---|---|
0 (default) |
Current date - format: YYYY/MM/DD. |
1 |
Current time - format: HH:MM:SS. |
2 |
Day of the week. |
FBD Language Example
FFLD Language Example
- In the FFLD "Free Form Ladder Diagram" Language, the operation is executed only if the input rung (EN) is TRUE.
- The output rung (ENO) keeps the same value as the input rung.
IL Language Example
Op1: LD "Ladder diagram" Ladder logic is a method of drawing electrical logic schematics. It is now a very popular graphical language for programming Programmable Logic Controllers (PLCs). It was originally invented to describe logic made from relays. The name is based on the observation that programs in this language resemble ladders, with two vertical "rails" and a series of horizontal "rungs" between them SEL
DAY_TIME
ST Q
ST Language Example
Q := DAY_TIME (SEL);
See Also