Echelon i.LON SmartServer 2.0 User Manual
Page 391

i.LON SmartServer 2.0 Programmer’s Reference
21-39
Dim
lockEvent_holiday
As
New
iLON_SmartServer.UFPTscheduler_CfgEvent()
lockEvent_holiday.UCPTindex = 0
lockEvent_holiday.UCPTindexSpecified =
True
lockEvent_holiday.UCPTtime =
New
DateTime(2009, 6, 8, 0, 0, 0)
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
Dim
onEvent_holiday
As
New
iLON_SmartServer.UFPTscheduler_CfgEvent()
onEvent_holiday.UCPTindex = 1
onEvent_holiday.UCPTindexSpecified =
True
onEvent_holiday.UCPTtime =
New
DateTime(2009, 6, 8, 12, 0, 0)
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(0) {}
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
Dim
offEvent_holiday
As
New
iLON_SmartServer.UFPTscheduler_CfgEvent()
offEvent_holiday.UCPTindex = 2
offEvent_holiday.UCPTindexSpecified =
True
offEvent_holiday.UCPTtime =
New
DateTime(2009, 6, 8, 18, 0, 0)
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(0) {}
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
'create Exception item
holidays.Exception =
New
iLON_SmartServer.UFPTscheduler_CfgDateBasedException(0) {}
holidays.Exception(0) =
New
iLON_SmartServer.UFPTscheduler_CfgDateBasedException()
holidays.Exception(0).UCPTexceptionName =
"Holidays"
holidays.Exception(0).UCPTindex = 0
holidays.Exception(0).UCPTindexSpecified =
True
'store date-based (exception) schedule we created in a DateBased[]
myScheduler.DateBased =
New
iLON_SmartServer.UFPTscheduler_CfgDateBased(0) {}
myScheduler.DateBased(0) =
New
iLON_SmartServer.UFPTscheduler_CfgDateBased()
myScheduler.DateBased(0) = holidays
'call Set function
Dim
itemCfgColl__2
As
New
iLON_SmartServer.Item_CfgColl()
itemCfgColl__2.Item =
New
iLON_SmartServer.Item_Cfg(0) {}
itemCfgColl__2.Item(0) = myScheduler
Dim
ItemColl_Set_Scheduler_Return
As
iLON_SmartServer.Item_Coll =
SmartServer._iLON.Set(itemCfgColl__2)
If
ItemColl_Set_Scheduler_Return.UCPTfaultCount > 0
Then
PrintGetError(ItemColl_Set_Scheduler_Return)
Else