A variable type `CALENDAR` can be used for to provide module wide calendar data. In the section date and time functions are various functions to update the calendar continuously.
CALENDAR can be used for to provide module wide calendar
data. In the section date and time functions are various functions to
update the calendar continuously.Version history
1.3.0
Changes
sun_rise,sun_setandsun_middayare now calculated in local time
show full history
1.2.0
Changes
work_weeksun_middaysun_heigth
1.1.0
Changes
- sun position data
1.0.0
Changes
- original version
Overview
| name | type | default | comment |
|---|---|---|---|
| UTC | DT | World time UTC | |
| LDT | DT | Local time | |
| LDATE | DATE | Local date | |
| LTOD | TOD | Local time of day | |
| YEAR | INT | Year of LDATE | |
| MONTH | INT | Month of LDATE | |
| DAY | INT | Day of LDATE | |
| WEEKDAY | INT | Weekday of LDATE | |
| OFFSET | INT | Time Zone Offset for Local time in minutes | |
| DST_EN | BOOL | Daylight savings time enable | |
| DST_ON | BOOL | True when daylight savings time os on | |
| NAME | STRING(5) | Name of time zone | |
| LANGUAGE | INT | Location number pls see location setup | |
| LONGITUDE | REAL | Longitude of current location | |
| LATITUDE | REAL | Latitude of current location | |
| SUN_RISE | TOD | Sun_rise for current location | |
| SUN_SET | TOD | Sun_set for current location | |
| SUN_MIDDAY | TOD | Worldtime when sun stands at south position | |
| SUN_HEIGTH | REAL | Suns heigth at midday, south position | |
| SUN_HOR | REAL | Sun angle horizontal 0 = north in degrees | |
| SUN_VER | REAL | Sun angle vertical above horizon in degrees | |
| NIGHT | BOOL | True between sun_set and sun_rise | |
| HOLIDAY | BOOL | True when holiday | |
| HOLY_NAME | STRING(30) | Name of holiday | |
| WORK_WEEK | INT | Current work week |
Details
UTC
DTWorld time UTC.
LDT
DTLocal time.
LDATE
DATELocal date.
LTOD
TODLocal time of day.
YEAR
INTYear of LDATE.
MONTH
INTMonth of LDATE.
DAY
INTDay of LDATE.
WEEKDAY
INTWeekday of LDATE.
OFFSET
INTTime Zone Offset for Local time in minutes.
DST_EN
BOOLDaylight savings time enable.
DST_ON
BOOLTrue when daylight savings time os on.
NAME
STRING(5)Name of time zone.
LANGUAGE
INTLocation number pls see location setup.
LONGITUDE
REALLongitude of current location.
LATITUDE
REALLatitude of current location.
SUN_RISE
TODSun_rise for current location.
SUN_SET
TODSun_set for current location.
SUN_MIDDAY
TODWorldtime when sun stands at south position.
SUN_HEIGTH
REALSuns heigth at midday, south position.
SUN_HOR
REALSun angle horizontal 0 = north in degrees.
SUN_VER
REALSun angle vertical above horizon in degrees.
NIGHT
BOOLTrue between sun_set and sun_rise.
HOLIDAY
BOOLTrue when holiday.
HOLY_NAME
STRING(30)Name of holiday.
WORK_WEEK
INTCurrent work week.
Source code
Declarations
(*Data type for module wide calendar data*)
TYPE index :
(*
* -----------------------------------------------------------------------------
* Name : index
* Version : 1.3.0
* Date : 2010-01-23
* Author : hm
*
* -----------------------------------------------------------------------------
* Data type for module wide calendar data
* -----------------------------------------------------------------------------
*)
STRUCT
UTC : DT; (*World time UTC*)
LDT : DT; (*Local time*)
LDATE : DATE; (*Local date*)
LTOD : TOD; (*Local time of day*)
YEAR : INT; (*Year of LDATE*)
MONTH : INT; (*Month of LDATE*)
DAY : INT; (*Day of LDATE*)
WEEKDAY : INT; (*Weekday of LDATE*)
OFFSET : INT; (*Time Zone Offset for Local time in minutes*)
DST_EN : BOOL; (*Daylight savings time enable*)
DST_ON : BOOL; (*True when daylight savings time os on*)
NAME : STRING(5); (*Name of time zone*)
LANGUAGE : INT; (*Location number pls see location setup*)
LONGITUDE : REAL; (*Longitude of current location*)
LATITUDE : REAL; (*Latitude of current location*)
SUN_RISE : TOD; (*Sun_rise for current location*)
SUN_SET : TOD; (*Sun_set for current location*)
SUN_MIDDAY : TOD; (*Worldtime when sun stands at south position*)
SUN_HEIGTH : REAL; (*Suns heigth at midday, south position*)
SUN_HOR : REAL; (*Sun angle horizontal 0 = north in degrees*)
SUN_VER : REAL; (*Sun angle vertical above horizon in degrees*)
NIGHT : BOOL; (*True between sun_set and sun_rise*)
HOLIDAY : BOOL; (*True when holiday*)
HOLY_NAME : STRING(30); (*Name of holiday*)
WORK_WEEK : INT; (*Current work week*)
END_STRUCT
END_TYPE