Facility Control

 View Only
  • 1.  Pause

    Posted 07-02-2019 23:39

    I have set up Dashboard to send IR commands to a Set Top Box with rosstalk.sendMessage().  I want to program it to change the channel by sending a series of 4 commands. However it is only picking up one or two of the commands.  It looks like a need to set a delay between each.  Is there a way to do this without using an async function?  I have tried implementing a pause command similar to below but that did not work.

    rosstalk.sendMessage(command for 1);

    return 500;

    rosstalk.sendMessage(command for 6);

    return 500;

    rosstalk.sendMessage(command for 0);

    return 500;

    rosstalk.sendMessage(command for 7);



  • 2.  RE: Pause

    Posted 07-03-2019 17:17

    Just found it in another thread.

    <task tasktype="pause">number of milliseconds to pause</task>


    #DashBoard


  • 3.  RE: Pause

    Posted 07-03-2019 19:40

    If you put your calls into a function and use ogscript.asyncExec, you can also just call ogscript.pause(number_of_milliseconds);

    Using this, you would be able to make an arbitrary "send" function like this:

    function sendCmd(cmd)
    {
    ogscript.asyncExec(function ()
    {
    for (var i = 0; i < cmd.length; i++)
    {
    rosstalk.sendMessage(command for cmd[i]);
    ogscript.pause(500);
    }
    });
    }

    sendCmd([1,6,0,7]);

    #DashBoard