Commands and functions
P.
182 of 349
Daily comparison
DayOfWeek
Easter Day
A daily comparison is defined as follows:
Definition
●
Function
day
(
dd
) with:
dd: Day (1..31)
Arguments
●
Argument of data type u08
Effect
●
The output is 1b01 when the day is reached or already passed. If the day is before the set
value, the output goes to 0b01. With the beginning of a new month, the output goes to
0b01 until the day meets the set value.
Data type result (Return)
●
Data type b01
Example: Day timer comparison
Every 6th in the month, the variable SprinklerOn is to be set to 1.
The implementation in the user program then reads:
if day(6) then SprinklerOn=1 endif
Definition
●
Function
dayofweek
() with:
Arguments
●
none
Effect
●
The output returns the current day of the week [0{Sunday}..6{Saturday}.
Data type result (Return)
●
Data type u08
Example: Day timer comparison
Request the current day of the week. In case it is Sunday, the variable SprinklerOn is to be set
to 1.
The implementation in the user program then reads:
if dayofweek()==SUNDAY then SprinklerOn=1 endif
Definition
●
Function
easterday
(
Offset
)
Arguments
●
Argument
Offset
Data type s16
Effect
●
Calculate the day of Easter Sunday. An offset for the calculation is indicated, e.g. Easter
40 days, Easter Sunday - 30 days.
Data type result (Return)
●
Data type u08
HandbuchEibPC_USA-30.odt, 2017-05-11
Enertex
®
Bayern GmbH - Erlachstraße 13 - 91301 Forchheim - [email protected]