beautypg.com

Echelon i.LON SmartServer 2.0 User Manual

Page 366

background image

i.LON SmartServer 2.0 Programmer’s Reference

21-14

//create exception dates

myCalendar.Exception[0].Schedule =

new

iLON_SmartServer.

UFPTcalendar_CfgExceptionSchedule

[4];

myCalendar.Exception[0].Schedule[0] =

new

iLON_SmartServer.

UFPTcalendar_CfgExceptionSchedule

();

myCalendar.Exception[0].Schedule[1] =

new

iLON_SmartServer.

UFPTcalendar_CfgExceptionSchedule

();

myCalendar.Exception[0].Schedule[2] =

new

iLON_SmartServer.

UFPTcalendar_CfgExceptionSchedule

();

myCalendar.Exception[0].Schedule[3] =

new

iLON_SmartServer.

UFPTcalendar_CfgExceptionSchedule

();


//create 4th of July exception

//==========================

myCalendar.Exception[0].Schedule[0].UCPTschedMonth =

new

iLON_SmartServer.

E_LonString

();

myCalendar.Exception[0].Schedule[0].UCPTschedMonth.LonFormat =

"UCPTschedMonth"

;

myCalendar.Exception[0].Schedule[0].UCPTschedMonth.Value =

"MN_JUL"

;


myCalendar.Exception[0].Schedule[0].UCPTschedDay =

new

iLON_SmartServer.

E_LonString

();

myCalendar.Exception[0].Schedule[0].UCPTschedDay.LonFormat =

"UCPTschedDay"

;

myCalendar.Exception[0].Schedule[0].UCPTschedDay.Value =

"DM_DAY_4"

;


//set start date

myCalendar.Exception[0].Schedule[0].StartDate =

new

iLON_SmartServer.

UFPTcalendar_CfgESDate

();

myCalendar.Exception[0].Schedule[0].StartDate.UCPTdate =

new

DateTime

(2009, 6, 8);


//set end date

myCalendar.Exception[0].Schedule[0].EndDate =

new

iLON_SmartServer.

UFPTcalendar_CfgESDate

();

myCalendar.Exception[0].Schedule[0].EndDate.UCPTdate =

new

DateTime

(2020, 12, 31);


//create Labor Day exception

//==========================

myCalendar.Exception[0].Schedule[1].UCPTschedMonth =

new

iLON_SmartServer.

E_LonString

();

myCalendar.Exception[0].Schedule[1].UCPTschedMonth.LonFormat =

"UCPTschedMonth"

;

myCalendar.Exception[0].Schedule[1].UCPTschedMonth.Value =

"MN_SEP"

;


myCalendar.Exception[0].Schedule[1].UCPTschedDay =

new

iLON_SmartServer.

E_LonString

();

myCalendar.Exception[0].Schedule[1].UCPTschedDay.LonFormat =

"UCPTschedDay"

;

myCalendar.Exception[0].Schedule[1].UCPTschedDay.Value =

"DM_FIRST_MON"

;


//set start date

myCalendar.Exception[0].Schedule[1].StartDate =

new

iLON_SmartServer.

UFPTcalendar_CfgESDate

();

myCalendar.Exception[0].Schedule[1].StartDate.UCPTdate =

new

DateTime

(2009, 6, 8);


//set end date

myCalendar.Exception[0].Schedule[1].EndDate =

new

iLON_SmartServer.

UFPTcalendar_CfgESDate

();

myCalendar.Exception[0].Schedule[1].EndDate.UCPTdate =

new

DateTime

(2020, 12, 31);


//create Thanksgiving exception

//==========================

myCalendar.Exception[0].Schedule[2].UCPTschedMonth =

new

iLON_SmartServer.

E_LonString

();

myCalendar.Exception[0].Schedule[2].UCPTschedMonth.LonFormat =

"UCPTschedMonth"

;

myCalendar.Exception[0].Schedule[2].UCPTschedMonth.Value =

"MN_NOV"

;


myCalendar.Exception[0].Schedule[2].UCPTschedDay =

new

iLON_SmartServer.

E_LonString

();

myCalendar.Exception[0].Schedule[2].UCPTschedDay.LonFormat =

"UCPTschedDay"

;

myCalendar.Exception[0].Schedule[2].UCPTschedDay.Value =

"DM_FOURTH_THU"

;


//set start date

myCalendar.Exception[0].Schedule[2].StartDate =

new

iLON_SmartServer.

UFPTcalendar_CfgESDate

();

myCalendar.Exception[0].Schedule[2].StartDate.UCPTdate =

new

DateTime

(2009, 6, 8);


//set end date

myCalendar.Exception[0].Schedule[2].EndDate =

new

iLON_SmartServer.

UFPTcalendar_CfgESDate

();

myCalendar.Exception[0].Schedule[2].EndDate.UCPTdate =

new

DateTime

(2020, 12, 31);


//Create Christmas exception

//==========================

myCalendar.Exception[0].Schedule[3].UCPTschedMonth =

new

iLON_SmartServer.

E_LonString

();

myCalendar.Exception[0].Schedule[3].UCPTschedMonth.LonFormat =

"UCPTschedMonth"

;

myCalendar.Exception[0].Schedule[3].UCPTschedMonth.Value =

"MN_DEC"

;