Echelon i.LON SmartServer 2.0 User Manual
Page 388

i.LON SmartServer 2.0 Programmer’s Reference
21-36
dataPointRef1.UCPTname =
"Net/LON/iLON App/Digital Output 1/nviClaValue_1"
dataPointRef1.UCPTformatDescription =
"#0000000000000000[0].SNVT_switch"
dataPointRef1.SCPTdelayTime = 0
dataPointRef1.SCPTdelayTimeSpecified =
True
dataPointRef1.dpType =
"Output"
Dim
dataPointRef2
As
New
iLON_SmartServer.UFPTscheduler_DpRef()
dataPointRef2.UCPTname =
"Net/LON/iLON App/Digital Output 2/nviClaValue_2"
dataPointRef2.UCPTformatDescription =
"#0000000000000000[0].SNVT_switch"
dataPointRef2.SCPTdelayTime = 0
dataPointRef2.SCPTdelayTimeSpecified =
True
dataPointRef2.dpType =
"Output"
'store data points in DP reference array
myScheduler.DataPoint(0) = dataPointRef1
myScheduler.DataPoint(1) = dataPointRef2
'set range of dates in which Scheduler is effective
Dim
effectivePeriod
As
New
iLON_SmartServer.UFPTscheduler_CfgEffectivePeriod()
effectivePeriod.StartDate =
New
DateTime(2009, 6, 8)
effectivePeriod.EndDate =
New
DateTime(2020, 12, 31)
effectivePeriod.StartDateSpecified =
True
effectivePeriod.EndDateSpecified =
True
myScheduler.ScheduleEffectivePeriod = effectivePeriod
'create daily schedule for weekdays
Dim
dayBasedSchedule_weekdays
As
New
iLON_SmartServer.UFPTscheduler_CfgDayBased()
dayBasedSchedule_weekdays.UCPTindex = 0
dayBasedSchedule_weekdays.UCPTindexSpecified =
True
dayBasedSchedule_weekdays.UCPTdescription =
"Weekday"
dayBasedSchedule_weekdays.UCPTpriority = 255
'create events for weekday schedule
dayBasedSchedule_weekdays.[Event] =
New
iLON_SmartServer.UFPTscheduler_CfgEvent(1) {}
dayBasedSchedule_weekdays.[Event](0) =
New
iLON_SmartServer.UFPTscheduler_CfgEvent()
dayBasedSchedule_weekdays.[Event](1) =
New
iLON_SmartServer.UFPTscheduler_CfgEvent()
'---create ON event----
Dim
onEvent
As
New
iLON_SmartServer.UFPTscheduler_CfgEvent()
onEvent.UCPTindex = 0
onEvent.UCPTindexSpecified =
True
onEvent.UCPTtime =
New
DateTime(2009, 6, 8, 10, 0, 0)
onEvent.UCPTvalue =
New
iLON_SmartServer.E_LonString(0) {}
onEvent.UCPTvalue(0) =
New
iLON_SmartServer.E_LonString()
onEvent.UCPTvalue(0).Value =
"ON"
onEvent.UCPTvalue(0).LonFormat =
"UCPTvalueDef"
dayBasedSchedule_weekdays.[Event](0) = onEvent
'---create OFF event---
Dim
offEvent
As
New
iLON_SmartServer.UFPTscheduler_CfgEvent()
offEvent.UCPTindex = 1
offEvent.UCPTindexSpecified =
True
offEvent.UCPTtime =
New
DateTime(2009, 6, 8, 21, 0, 0)
offEvent.UCPTvalue =
New
iLON_SmartServer.E_LonString(0) {}
offEvent.UCPTvalue(0) =
New
iLON_SmartServer.E_LonString()
offEvent.UCPTvalue(0).Value =
"OFF"
offEvent.UCPTvalue(0).LonFormat =
"UCPTvalueDef"
dayBasedSchedule_weekdays.[Event](1) = offEvent
'set Monday--Friday as the days in this daily schedule
Dim
mon_to_fri
As
New
iLON_SmartServer.UFPTscheduler_CfgDayBasedWeekdays()
mon_to_fri.UCPTmonday = 1
mon_to_fri.UCPTtuesday = 1
mon_to_fri.UCPTwednesday = 1
mon_to_fri.UCPTthursday = 1
mon_to_fri.UCPTfriday = 1