TOW (check week for real-time clock)

The TOW instruction turns on an output if the value of the real-time clock (RTC) is in the range of the Time of Week setting.
Operation details:
  • If an RTC is not present, the output is always off.
  • Configure the Time input parameters with valid ranges as specified in the TOWDATA 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.
TOW
TOW
TOW parameters
Parameter
Parameter Type
Data Type
Description
EN
Input
BOOL
Instruction enable.
  • When EN = TRUE, perform the operation.
  • When EN = FALSE, do not perform the operation.
TimeA
Input
TOWDATA
Day Time Setting of Channel A.
Use the TOWDATA Data Type to define TimeA.
TimeB
Input
TOWDATA
Day Time Setting of Channel B.
Use the TOWDATA Data Type to define TimeB.
TimeC
Input
TOWDATA
Day Time Setting of Channel C.
Use the TOWDATA Data Type to define TimeC.
TimeD
Input
TOWDATA
Day Time Setting of Channel D.
Use the TOWDATA Data Type to define TimeD.
TOW
Output
BOOL
If TRUE, the value of the real-time clock is in the range of the Day Time setting of any one of four channels.

TOWDATA Data Type

The following table describes the TOWDATA data type:
TOWDATA data type
Parameter
Data Type
Description
Enable
BOOL
TRUE: Enable; FALSE: Disable.
DailyWeekly
BOOL
Type of Timer (0:daily timer; 1:weekly timer).
DayOn
USINT
Day of Week On value (must be in set [0...6]).
HourOn
USINT
Hour On value (must be in set [0...23]).
MinOn
USINT
Minute On value (must be in set [0...59]).
DayOff
USINT
Weekday Off value (must be in set [0...6]).
HourOff
USINT
Hour Off value (must be in set [0...23]).
MinOff
USINT
Minute Off value (must be in set [0...59]).

TOW examples

TOW function block diagram example
TOW function block diagram example
TOW ladder diagram example
TOW ladder diagram example
TOW structured text example
TOW structured text example
(* ST Equivalence: *) TESTOUTPUT := TOW(TIMEA, TIMEB, TIMEC, TIMED) ;
Results
Results
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.
Normal