Facility Control

 View Only
  • 1.  NK router switching based on scheduled time

    Posted 05-03-2018 19:38
    Hello,

    Is dashboard able to be programmed to do Auto switching for NK router based on scheduled time? For example, at 9:00 PM, route IN 16 to OUT 6, and at 11:00 PM, router IN 10 to OUT 6.


  • 2.  RE: NK router switching based on scheduled time

    Posted 05-03-2018 21:40

    We have had a few posts recently related to doing functions at specific times. Here is a basic example that can be adapted to call NK commands:

    function doRouteAtTime(dst, src, level)
    {
       function recallRoute()
       {
          nk.doSwitchWithLabels(dst, src, level);
       }
    
       var now = new Date();
       var delay = time.getTime() - now.getTime();
       if (delay >= 0)
       {
          ogscript.asyncExec(recallRoute, delay);
       }
    }
    
    
    doRouteAtTime('Dest Name', 'Src Name', 'Lvl Name', new Date(2017, 4, 17, 8, 0, 0, 0)); //Note that Date constructor takes Y, M, D, H, M, S, MS and January is month 0
    doRouteAtTime('Dest Name 2', 'Src Name 2', 'Lvl Name', new Date(2017, 4, 17, 8, 26, 0, 0));

    #DashBoard


  • 3.  RE: NK router switching based on scheduled time

    Posted 05-04-2018 15:31
    I will give it a try. Thanks.
    #DashBoard