Help
  • Explore Community
  • Get Started
  • Ask the Community
  • How-To & Best Practices
  • Contact Support
Notifications
Login / Register
Community
Community
Notifications
close
  • Forums
  • Knowledge Center
  • Events & Webinars
  • Ideas
  • Blogs
Help
Help
  • Explore Community
  • Get Started
  • Ask the Community
  • How-To & Best Practices
  • Contact Support
Login / Register
Sustainability
Sustainability

Join our "Ask Me About" community webinar on May 20th at 9 AM CET and 5 PM CET to explore cybersecurity and monitoring for Data Center and edge IT. Learn about market trends, cutting-edge technologies, and best practices from industry experts.
Register and secure your Critical IT infrastructure

Sample PE program for synchronizing controllers time across networks and time zones

Building Automation Knowledge Base

Schneider Electric Building Automation Knowledge Base is a self-service resource to answer all your questions about EcoStruxure Building suite, Andover Continuum, Satchwell, TAC…

cancel
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Home
  • Schneider Electric Community
  • Knowledge Center
  • Building Automation Knowledge Base
  • Sample PE program for synchronizing controllers time across networks and time zones
Options
  • Bookmark
  • Subscribe
  • Email to a Friend
  • Printer Friendly Page
  • Report Inappropriate Content
Invite a Co-worker
Send a co-worker an invite to the portal.Just enter their email address and we'll connect them to register. After joining, they will belong to the same company.
You have entered an invalid email address. Please re-enter the email address.
This co-worker has already been invited to the Exchange portal. Please invite another co-worker.
Please enter email address
Send Invite Cancel
Invitation Sent
Your invitation was sent.Thanks for sharing Exchange with your co-worker.
Send New Invite Close

Related Forums

  • Intelligent Devices Forum

Previous Next
Contributors
  • RandyDavis
    RandyDavis
  • AbeMeran
    AbeMeran

Invite a Colleague

Found this content useful? Share it with a Colleague!

Invite a Colleague Invite
Back to Building Automation Knowledge Base
Options
  • Bookmark
  • Subscribe
  • Email to a Friend
  • Printer Friendly Page
  • Report Inappropriate Content
0 Likes
1024 Views

Link copied. Please paste this link to share this article on your social media post.

Trying to translate this page to your language?
Select your language from the translate dropdown in the upper right. arrow
Translate to: English
  • (Français) French
  • (Deutsche) German
  • (Italiano) Italian
  • (Português) Portuguese
  • (Русский) Russian
  • (Español) Spanish

Sample PE program for synchronizing controllers time across networks and time zones

Captain AbeMeran Captain
‎2021-01-22 07:51 AM

on ‎2021-01-22 07:51 AM

Issue

Synchronizing time across many networks and multiple time zones

Product Line

Andover Continuum

Environment

Continuum Cyberstation

Cause

Guidelines for implementing an efficient yet compact Cyberstation PE program to synchronize time on large installations consisting of many Continuum networks across multiple time zones.

Networks.png

Resolution

The solution presented here requires that in each network the time master (controller with the lowest ACCNetId) is identified by setting its description to PTM. (Primary Time Master)

It is also recommended that the controller with the second-lowest ID is identified as the STM.

Obviously, the program itself could identify the time master for each Network but doing this outside of the program makes for a simpler, more robust implementation.

TimeMasters.png

To implement the solution, simply create a program in one of the Continuum Cyberstations and insert the code provided below.

Configured the HOUR System Variable in the Cyberstation to trigger the program.

The program, as written, will sync the time once a day at 3:00 AM

There is a local variable (Verbose) that controls the level of information the program prints to the message window, recommends this be set to print everything when the implementation is first put in place to ensure it is operating as expected, then print only errors afterward.

'This program synchronizes time between Cyberstation and controllers across Networks and time zones.
'Program is triggered by the HOUR system variable

'SETUP
'In each network, the controller with the lowest ACCNetID must be identified as the Primary Time Master
' by setting its description to PTM
'Optionally, the controller with the second-lowest ACCNetID can be identified as the Secondary Time Master
' by setting its description to STM

'v1.0 SE PSS 1010 1011 1110 - FOR PROOF OF CONCEPT PURPOSE ONLY
'--------------------------------------------------------------------------------------------------
Object theCX
Object theNetwork
Object theWS 'The Workstation where the program is running
Number WS_UTCOffset 'The UTC Offset of theWS
Number syncDone
Number Verbose 'Prints to theWS message window. Set to 1 to print errors only, set to 2 to print synchronization information.

Line INIT
  If Hour <> 3 then Stop  'sync time once a day at 3am
  theWS = CurWorkstation() 'get the name of the Cyberstation where the program is running
  WS_UTCOffset = getname("root\" ; theWS Alias ; " UTCOffset") 'and theWS UTC Offset
  Verbose = 0 'default to silent operation
  Goto SynchronizeTime

Line SynchronizeTime
  If OpenList("Network", theNetwork) is Success then
    While GetObject(theNetwork) is Success 'for each Network...
      If Verbose = 2 then Print "Syncronizing time on NETWORK: " ; theNetwork Alias
      If OpenList("InfinityController", theCX, theNetwork) is Success then
        While GetObject(theCX) is Success 'for each CX controller in the network...
          syncDone = False 'reset the sync done flag
'Print theCX alias REMOVE COMMENT TO PRINT CX NAME, HELPFUL WHEN DEBUGGING THIS PROGRAM
          If theCX Description = "PTM" and theCX CommStatus = OnLine then 'is this controller the time master and if so, is it ONLINE?
            If Verbose = 2 then Print "Time syncronized on NETWORK: " ; theNetwork Alias ; ", CONTROLLER: " ; theCX Alias ; " (Primary Time Master)"
            getname(theNetwork Alias ; "\" ; theCX Alias ; "\Date") = Date + ((theNetwork UTCOffset - Cyber221 UTCOffset) * 60) 'synchronize its time
            syncDone = True 'we're done with this network...
            Break '...so break out of the inner while loop
          Endif
          If theCX Description = "STM" and theCX CommStatus = OffLine then 'look for a secondary time master if primary not online
            If Verbose = 2 then Print "Time syncronized on NETWORK: " ; theNetwork Alias ; ", CONTROLLER: " ; theCX Alias ; " Secondary Time Master"
            getname(theNetwork Alias ; "\" ; theCX Alias ; "\Date") = Date + ((theNetwork UTCOffset - Cyber221 UTCOffset) * 60) 'synchronize its time
            syncDone = True 'we're done with this network...
            Break '...so break out of the inner while loop
          Endif
        Endwhile
        CloseList(theCX)
        If syncDone = False and Verbose > 0 then Print "No time master found online for NETWORK: " ; theNetwork Alias ; "," ; Date
      Else
        If Verbose > 0 then Print "ERROR, can't open Controller list " ; Date
      Endif
    Endwhile
    CloseList(theNetwork)
  Else
    If Verbose > 0 then Print "ERROR, can't open Network list " ; Date
  Endif

  Stop 

Line E
  If Verbose > 0 then Print "Program hit ERROR line, " ; Date
  Stop 
Labels (1)
Labels:
  • Andover Continuum
Tags (8)
  • Find more articles tagged with:
  • AbeMeran21
  • network
  • sync
  • synchronization
  • time
  • time zones
  • utc
  • UTCOffet
Was this article helpful? Yes No
No ratings

Link copied. Please paste this link to share this article on your social media post.

To The Top!

Forums

  • APC UPS Data Center Backup Solutions
  • EcoStruxure IT
  • EcoStruxure Geo SCADA Expert
  • Metering & Power Quality
  • Schneider Electric Wiser

Knowledge Center

Events & webinars

Ideas

Blogs

Get Started

  • Ask the Community
  • Community Guidelines
  • Community User Guide
  • How-To & Best Practice
  • Experts Leaderboard
  • Contact Support
Brand-Logo
Subscribing is a smart move!
You can subscribe to this board after you log in or create your free account.
Forum-Icon

Create your free account or log in to subscribe to the board - and gain access to more than 10,000+ support articles along with insights from experts and peers.

Register today for FREE

Register Now

Already have an account? Login

Terms & Conditions Privacy Notice Change your Cookie Settings © 2025 Schneider Electric

This is a heading

With achievable small steps, users progress and continually feel satisfaction in task accomplishment.

Usetiful Onboarding Checklist remembers the progress of every user, allowing them to take bite-sized journeys and continue where they left.

of