Commands and functions
P.
181 of 349
Data control
Date comparison
Monthly comparison
A date comparison is defined as follows:
Definition
●
Function
date
(
dd,mm,yyy
) with:
dd: Day (1..31)
mm: Month (1=January, 12=December)
yyy: Years Difference (0..255) from year 2000
Arguments
●
All of the data type u08
Effect
●
The output is 1b01, if the date is reached or already passed. If the date is before the set
value, the output goes to 0
Data type Result (Return)
●
Data type b01
Example: Date comparison timer
On 01 October 2009 the variable a is to be set to 1u08.
Implementation in the user program:
if date(10,1,09) then a=1 endif
A monthly comparison is defined as follows:
Definition
●
Function month(dd,mm) with:
dd: Day (1..31)
mm: Month (1=January, 12=December)
Arguments
●
2 arguments are of data type u08
Effect
●
The output is 1b01, if the date is reached or already passed. If the date is before the set
value, the output goes to 0b01. With the beginning of a new year (January 1) the output
goes to 0b01, until the month and day reach the set value.
Data type Result (Return)
●
Data type b01
Example: Monthly comparison timer
Every year on 01 December, the variable ChristmasLightingOn is to be set on 1.
Implementation in the user program:
if month(1,12) then ChristmasLightingOn=1 endif
Example: Definition of variable “summer“
A variable summer shall be defined, which is 1b01 (On) from 1.5. until 30.9. of each year.
Implementation in the user program:
Summer=month(01,05) and !month(30,09)
HandbuchEibPC_USA-30.odt, 2017-05-11
Enertex
®
Bayern GmbH - Erlachstraße 13 - 91301 Forchheim - [email protected]