Facility Control

 View Only
  • 1.  Recall carbonite Solo's memory at time

    Posted 05-15-2017 07:46
    Hello every one;

    I have a Carbonite Black Solo that i use like a matrix to run on air. I would like to recall memory at time. Do you think it is possible?

    for exemple : at 8h00 , recall memory 1 and at 8h26, recall memory 2

    Thanks


  • 2.  RE: Recall carbonite Solo's memory at time

    Posted 05-16-2017 16:43

    It requires a bit of script but this is the technique that would do it (you can get fancier with the JavaScript date object to make it recall "today" instead of on a specific day)

    Note: DashBoard cannot guarantee this command will be send frame-accurately and it will be using your local system's clock for the time.

    function doMemAtTime(memNum, meNum, time)
    {
       var rossTalkCmd = "MEM " + memNum + ":ME:" + meNum;   
       function recallMem()
       {
          rosstalk.sendMessage('PUT_IP_HERE', 7788, rossTalkCmd);
       }
    
       var now = new Date();
       var delay = time.getTime() - now.getTime();
       if (delay >= 0)
       {
          ogscript.asyncExec(recallMem, delay);
       }
    }
    
    
    doMemAtTime(1, 1, 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
    doMemAtTime(2, 1, new Date(2017, 4, 17, 8, 26, 0, 0));

    #DashBoard


  • 3.  RE: Recall carbonite Solo's memory at time

    Posted 05-22-2017 06:03
    Hi James;

    How can I use your code ?

    I would like to recall a memory at 6:00AM and another one at 07:58 AM each day.

    Is it possible to do that automatically (I don't want to push a button, I won't use human resource).

    #DashBoard


  • 4.  RE: Recall carbonite Solo's memory at time

    Posted 05-23-2017 17:49

    Something along these lines should work for you:

    <meta>
          <api>function doMemAtTime(memNum, meNum, time)
    {
       var rossTalkCmd = "MEM " + memNum + ":ME:" + meNum;   
       function recallMem()
       {
          rosstalk.sendMessage('PUT_IP_HERE', 7788, rossTalkCmd);
          scheduleTomorrow(memNum, meNum, time); //Reschedule 
       }
    
       var now = new Date();
       var delay = time.getTime() - now.getTime();
       if (delay &lt; 0)
       {
          delay = 0;
       }
       
       ogscript.asyncExec(recallMem, delay);
    }
    
    function scheduleToday(memNum, meNum, time)
    {
       var today = new Date();
       var newTime = new Date(today.getFullYear(), today.getMonth(), today.getDate(), time.getHours(), time.getMinutes(), time.getSeconds(), time.getMilliseconds());
       if (newTime.getTime() - today.getTime() &lt; 0) //IF we are too late for today
       {
          ogscript.debug("Too late for today.");
          scheduleTomorrow(memNum, meNum,  time);
       }
       else
       {
          ogscript.debug("Scheduled task for today: " + newTime);
          doMemAtTime(memNum, meNum, newTime);
       }
    }
    
    function scheduleTomorrow(memNum, meNum, time)
    {
       var today = new Date();
       var newTime = new Date(today.getFullYear(), today.getMonth(), today.getDate() + 1, time.getHours(), time.getMinutes(), time.getSeconds(), time.getMilliseconds());
       ogscript.debug("Scheduling for " + newTime);
       doMemAtTime(memNum, meNum, newTime);   
    }</api>
          <ogscript handles="onload">var task1Time = new Date();
    task1Time.setHours(6);
    task1Time.setMinutes(0);
    task1Time.setSeconds(0);
    task1Time.setMilliseconds(0);
    
    var task2Time = new Date();
    task2Time.setHours(7);
    task2Time.setMinutes(58);
    task2Time.setSeconds(0);
    task2Time.setMilliseconds(0);
    
    scheduleToday(1, 1, task1Time);
    scheduleToday(2, 1, task2Time);</ogscript>
       </meta>

    #DashBoard


  • 5.  RE: Recall carbonite Solo's memory at time

    Posted 05-24-2017 11:24
    Hi James;

    Thanks for your help, i will try it. I just have to create a new custom pannel and paste the code ? I suppose the pannel has to be open to wrok ? If I close the pannel the script doesn't work ?

    Is this script will work daily ?

    #DashBoard


  • 6.  RE: Recall carbonite Solo's memory at time

    Posted 05-24-2017 13:49
    Yes, if you add this script to a Custom Panel, it should work.
    The panel would need to be open.
    You'll notice I have a function that gets called when the script is run to schedule the execution for the next day as well.

    You'll probably want to test this a little more and let it run for a few days to make sure it is working the way you intended. A few edge cases that have not been tested:
    1. Changing from daylight saving time to standard time (and back)
    2. Going from the last day of the month to the first day of the month
    3. Going from the last day of the year to the first day of the year

    Perhaps do some testing by modifying your computer's clock (and then re-opening the panel)?

    #DashBoard