Echelon i.LON SmartServer 2.0 User Manual
Page 393
![background image](/manuals/735732/393/background.png)
i.LON SmartServer 2.0 Programmer’s Reference
21-41
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"
myCalendar.Exception(0).Schedule(3).UCPTschedDay =
New
iLON_SmartServer.E_LonString()
myCalendar.Exception(0).Schedule(3).UCPTschedDay.LonFormat =
"UCPTschedDay"
myCalendar.Exception(0).Schedule(3).UCPTschedDay.Value =
"DM_DAY_25"
'set start date
myCalendar.Exception(0).Schedule(3).StartDate =
New
iLON_SmartServer.UFPTcalendar_CfgESDate()
myCalendar.Exception(0).Schedule(3).StartDate.UCPTdate =
New
DateTime(2009, 6, 8)
'set end date
myCalendar.Exception(0).Schedule(3).EndDate =
New
iLON_SmartServer.UFPTcalendar_CfgESDate()
myCalendar.Exception(0).Schedule(3).EndDate.UCPTdate =
New
DateTime(2020, 12, 31)
'call Set function
Dim
itemCfgColl_Calendar__4
As
New
iLON_SmartServer.Item_CfgColl()
itemCfgColl_Calendar__4.Item =
New
iLON_SmartServer.Item_Cfg(0) {}
itemCfgColl_Calendar__4.Item(0) = myCalendar
Dim
ItemColl_Set_Calendar_Return
As
iLON_SmartServer.Item_Coll =
SmartServer._iLON.Set(itemCfgColl_Calendar__4)
If
ItemColl_Set_Calendar_Return.UCPTfaultCount > 0
Then
PrintGetError(ItemColl_Set_Calendar_Return)
Else
Dim
newCalendar
As
iLON_SmartServer.Item = ItemColl_Set_Calendar_Return.Item(0)
Console.WriteLine(
"Calendar used for this Scheduler is "
& newCalendar.UCPTname)
End
If