Echelon i.LON SmartServer 2.0 User Manual
Page 390

i.LON SmartServer 2.0 Programmer’s Reference
21-38
'---create ON event----
Dim
onEvent_Sun
As
New
iLON_SmartServer.UFPTscheduler_CfgEvent()
onEvent_Sun.UCPTindex = 0
onEvent_Sun.UCPTindexSpecified =
True
onEvent_Sun.UCPTtime =
New
DateTime(2009, 6, 8, 12, 0, 0)
onEvent_Sun.UCPTvalue =
New
iLON_SmartServer.E_LonString(0) {}
onEvent_Sun.UCPTvalue(0) =
New
iLON_SmartServer.E_LonString()
onEvent_Sun.UCPTvalue(0).Value =
"ON"
onEvent_Sun.UCPTvalue(0).LonFormat =
"UCPTvalueDef"
dayBasedSchedule_Sun.[Event](0) = onEvent_Sun
'---create OFF event---
Dim
offEvent_Sun
As
New
iLON_SmartServer.UFPTscheduler_CfgEvent()
offEvent_Sun.UCPTindex = 1
offEvent_Sun.UCPTindexSpecified =
True
offEvent_Sun.UCPTtime =
New
DateTime(2009, 6, 8, 18, 0, 0)
offEvent_Sun.UCPTvalue =
New
iLON_SmartServer.E_LonString(0) {}
offEvent_Sun.UCPTvalue(0) =
New
iLON_SmartServer.E_LonString()
offEvent_Sun.UCPTvalue(0).Value =
"OFF"
offEvent_Sun.UCPTvalue(0).LonFormat =
"UCPTvalueDef"
dayBasedSchedule_Sun.[Event](1) = offEvent_Sun
'set Sunday as only day in this daily schedule
Dim
sun
As
New
iLON_SmartServer.UFPTscheduler_CfgDayBasedWeekdays()
sun.UCPTsunday = 1
sun.UCPTsaturday = 0
sun.UCPTmonday = 0
sun.UCPTtuesday = 0
sun.UCPTwednesday = 0
sun.UCPTthursday = 0
sun.UCPTfriday = 0
dayBasedSchedule_Sun.Weekdays = sun
'store daily schedules we created in a DayBased[]
myScheduler.DayBased =
New
iLON_SmartServer.UFPTscheduler_CfgDayBased(2) {}
myScheduler.DayBased(0) =
New
iLON_SmartServer.UFPTscheduler_CfgDayBased()
myScheduler.DayBased(0) = dayBasedSchedule_weekdays
myScheduler.DayBased(1) =
New
iLON_SmartServer.UFPTscheduler_CfgDayBased()
myScheduler.DayBased(1) = dayBasedSchedule_Sat
myScheduler.DayBased(2) =
New
iLON_SmartServer.UFPTscheduler_CfgDayBased()
myScheduler.DayBased(2) = dayBasedSchedule_Sun
'create a date-based schedule (an exception) for Holidays
'*** NOTE: You must use Calendar application to spcify the dates in which this alterntate
'schedule
is
applicable***
Dim
holidays
As
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(2) {}
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