DOY (check year for real-time clock)

The DOY instruction turns on an output when the value of the real-time clock (RTC) is in the range of the Year Time setting.
Operation details:
  • If RTC is not present, the output is always off.
  • Configure the Time input parameters with valid ranges as specified in the DOYDATA Data Type. An invalid value faults the controller when TimeX. Enable is set to TRUE and an RTC is present and enabled.
Languages supported: Function block diagram, ladder diagram, structured text.
This instruction applies to the Micro810, L20E, L50E, and L70E controllers.
DOY
DOY
DOY parameters
Parameter
Parameter Type
Data Type
Description
EN
Input
BOOL
Instruction enable.
  • TRUE: Perform the operation.
  • FALSE: Do not perform the operation.
TimeA
Input
DOYDATA
Year Time Setting of Channel A.
Use the DOYDATA data type to configure TimeA.
TimeB
Input
DOYDATA
Year Time Setting of Channel B.
Use the DOYDATA data type to configure TimeB.
TimeC
Input
DOYDATA
Year Time Setting of Channel C.
Use the DOYDATA data type to configure TimeC.
TimeD
Input
DOYDATA
Year Time Setting of Channel D.
Use the DOYDATA data type to configure TimeD.
DOY
Output
BOOL
If TRUE, the value of the real-time clock is in the range of the Year Time setting of any one of the four channels.

DOYDATA Data Type

The following table describes the DOYDATA data type.
DOYDATA data type
Parameter
Data Type
Description
Enable
BOOL
  • TRUE: Enable
  • FALSE: Disable
YearlyCenturial
BOOL
Type of timer (0:Yearly timer; 1:Centurial timer).
YearOn
UINT
Year On value (must be in set [2000...2098]).
MonthOn
USINT
Month On value (must be in set [1...12]).
DayOn
USINT
Day On value (must be in set [1...31], determined by "MonthOn" value).
YearOff
UINT
Year Off value (must be in set [2000...2098]).
MonthOff
USINT
Month Off value (must be in set [1...12]).
DayOff
USINT
Day Off value (must be in set [1...31], determined by "MonthOff" value).

DOY examples

DOY function block diagram example
DOY function block diagram example
DOY ladder diagram example
DOY ladder diagram example
DOY structured text example
DOY structured text example
(* ST Equivalence: *) TESTOUTPUT := DOY(TIMEA1, TIMEB1, TIMEC1, TIMED1) ;
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.
Normal