beautypg.com

Echelon i.LON SmartServer 2.0 User Manual

Page 364

background image

i.LON SmartServer 2.0 Programmer’s Reference

21-12


myScheduler.DayBased[2] =

new

iLON_SmartServer.

UFPTscheduler_CfgDayBased

();

myScheduler.DayBased[2] = dayBasedSchedule_Sun;

//create a date-based schedule (an exception) for some American Holidays

//*** NOTE: You must use Calendar application to specify the dates in which this
//alterntate schedule is applicable***

iLON_SmartServer.

UFPTscheduler_CfgDateBased

holidays =

new

iLON_SmartServer.

UFPTscheduler_CfgDateBased

();

holidays.UCPTindex = 0;
holidays.UCPTindexSpecified =

true

;

holidays.UCPTpriority = 250;

//create events for Holiday schedule

holidays.Event =

new

iLON_SmartServer.

UFPTscheduler_CfgEvent

[3];

holidays.Event[0] =

new

iLON_SmartServer.

UFPTscheduler_CfgEvent

();

holidays.Event[1] =

new

iLON_SmartServer.

UFPTscheduler_CfgEvent

();

holidays.Event[2] =

new

iLON_SmartServer.

UFPTscheduler_CfgEvent

();


//create LOCK event at 00:00 for Holiday schedule

iLON_SmartServer.

UFPTscheduler_CfgEvent

lockEvent_holiday =

new

iLON_SmartServer.

UFPTscheduler_CfgEvent

();

lockEvent_holiday.UCPTindex = 0;
lockEvent_holiday.UCPTindexSpecified =

true

;

lockEvent_holiday.UCPTtime =

new

DateTime

(2009, 6, 8, 00, 00, 00);


lockEvent_holiday.UCPTeventType =

new

iLON_SmartServer.

E_LonString

();

lockEvent_holiday.UCPTeventType.Value =

"ET_LOCK"

;

lockEvent_holiday.UCPTeventType.LonFormat =

"UCPTeventType"

;


holidays.Event[0] = lockEvent_holiday;

//create ON event for Holiday schedule

iLON_SmartServer.

UFPTscheduler_CfgEvent

onEvent_holiday =

new

iLON_SmartServer.

UFPTscheduler_CfgEvent

();

onEvent_holiday.UCPTindex = 1;
onEvent_holiday.UCPTindexSpecified =

true

;

onEvent_holiday.UCPTtime =

new

DateTime

(2009, 6, 8, 12, 00, 00);


onEvent_holiday.UCPTeventType =

new

iLON_SmartServer.

E_LonString

();

onEvent_holiday.UCPTeventType.Value =

"ET_NUL"

;

onEvent_holiday.UCPTeventType.LonFormat =

"UCPTeventType"

;


onEvent_holiday.UCPTvalue =

new

iLON_SmartServer.

E_LonString

[1];

onEvent_holiday.UCPTvalue[0] =

new

iLON_SmartServer.

E_LonString

();

onEvent_holiday.UCPTvalue[0].Value =

"ON"

;

onEvent_holiday.UCPTvalue[0].LonFormat =

"UCPTvalueDef"

;


holidays.Event[1] = onEvent_holiday;

//create OFF event for Holiday schedule


iLON_SmartServer.

UFPTscheduler_CfgEvent

offEvent_holiday =

new

iLON_SmartServer.

UFPTscheduler_CfgEvent

();

offEvent_holiday.UCPTindex = 2;
offEvent_holiday.UCPTindexSpecified =

true

;

offEvent_holiday.UCPTtime =

new

DateTime

(2009, 6, 8, 18, 00, 00);


offEvent_holiday.UCPTeventType =

new

iLON_SmartServer.

E_LonString

();

offEvent_holiday.UCPTeventType.Value =

"ET_NUL"

;

offEvent_holiday.UCPTeventType.LonFormat =

"UCPTeventType"

;


offEvent_holiday.UCPTvalue =

new

iLON_SmartServer.

E_LonString

[1];

offEvent_holiday.UCPTvalue[0] =

new

iLON_SmartServer.

E_LonString

();

offEvent_holiday.UCPTvalue[0].Value =

"OFF"

;

offEvent_holiday.UCPTvalue[0].LonFormat =

"UCPTvalueDef"

;


holidays.Event[2] = offEvent_holiday;