Knowledge Base
Showing results for 
Search instead for 
Did you mean: 

Is there an available program for use with an I/A Series R2 station to calculate sunrise and sunset?


Customer wants UNC to calculate times to turn outdoor lights on and off.


I/A Series (Niagara) R2 (any version)


Customer request for Scheduling functions based on SunRise and / or SunSet.


There is a program called "SunClock" that be used for that purpose.

Here is a brief overview of using program modules, if you are not familiar with their use.

  1. Create a folder, such as MyProgLib, for holding your program modules under the Niagara release folder:
  2. Extract the SunClock.sns file from the attached zip file and place it in the folder you created.
  3. Open WorkPlace Pro and open the UNC station into which the program module is to be placed.
  4. Open the Local Library and navigate to the folder you created in step 1 above.
  5. Copy the SunClock.sns module.
  6. Paste the module into the desired container within the UNC station.

The SunClock program module has the following outputs:
sLights        BooleanStatusType     Status Output On between LtsOn and LtsOff times    
pLtsOn         BooleanPriorityType   Priority Output to turn lights on
pLtsOff        BooleanPriorityType   Priority Output to turn lights off
SunRiseTime    DateTimeType          Calculated Sunrise Time
SunSetTime     DateTimeType          Calculated Sunset Time
LtsOn          DateTimeType          Calculated Lights On Time
LtsOff         DateTimeType          Calculated Lights Off Time

The program uses the following properties to control its operation:

LtsOnPriority          Priority level for turning lights on
LtsOffPriority         Priority level for turning lights off
Latitude               Geographic Latitude of location
Longitude              Geographic Longitude of location
SunRiseOffset          Minutes before sunrise to turn lights off
SunSetOffset           Minutes after sunset to turn lights on
DSTEnable              Enable Daylight Savings Time calculation
DSTBeginWeekOfMonth    Week of month that DST starts, 1=first
DSTBeginDayOfWeek      Day of week that DST starts
DSTBeginMonth          Month of year that DST starts      
DSTEndWeekOfMonth      Week of month that DST ends, 5=last
DSTEndDayOfWeek        Day of week that DST ends
DSTEndMonth            Month of year that DST ends


  • Enter Latitude as a positive number for locations in northern hemisphere
  • Enter Longitude as positive number for locations west of prime meridian 
  • Enter negative offsets to set control times after sunrise / before sunset    
Tags (1)
Labels (1)
No ratings
Version history
Revision #:
2 of 2
Last update:
‎2018-09-10 07:16 AM
Updated by: