Facility Control

 View Only
  • 1.  Trigger dashboard with UDP from Qlab

    Posted 11-02-2017 15:21
    I want to trigger tasks in dashboard with qlab and i want to know how i can use the UDP-listener. Can you give some examples on how to receive the strings and how to process the information to trigger different tasks in dashboard.

    so, I want to be able to trigger qlab, with something like a buzzerbutton(I know how to handle this part), and then make qlab trigger dashboard to do tasks like; switch to a specific camera on the carbonite and also maybe trigger CG of some sort from xpression.

    If i'm unclear on something please tell me and i will try to be more specific.



  • 2.  RE: Trigger dashboard with UDP from Qlab

    Posted 11-03-2017 13:57

    To listen for UDP input, you would create a tag and have it process the results either as a string or as a byte array.

    Here is a fairly basic panel that sends strings or bytes to itself.

    <abs contexttype="opengear">
         <table height="104" left="6" right="7" top="7">
            <tr>
               <button buttontype="push" colspan="1" fill="both" name="Send UDP String" rowspan="1" weightx="0.0" weighty="1.0" width="200">
                  <task tasktype="ogscript">ogscript.sendUDPString('localhost', 7890, 'This is a string');</task>
               </button>
               <button buttontype="push" colspan="1" fill="both" name="Send UDP Bytes" rowspan="1" weightx="0.0" weighty="1.0" width="200">
                  <task tasktype="ogscript">ogscript.sendUDPAsBytes('l-ottjpeltzer', 7890, '00 00 01 02 03 04 05 06');</task>
               </button>
               <label colspan="1" fill="both" id="output" rowspan="1" style="bg#dark;txt-align:center;bdr:etched;" weightx="1.0" weighty="1.0"/>
               <listener buttontype="toggle" colspan="1" fill="both" id="UDP Listener" listenport="7890" maxlength="1024" name="Listen for UDP on port 7890" style="t:bg#DF0C0C;f:bg#panelbg;" udp="true" weightx="0.0" weighty="1.0">
                  <task tasktype="ogscript">if (event.getEventType() == 1)
      {
      var bytes = event.getBytes();
      if (bytes != null &amp;&amp; bytes.length &gt; 0)
      {
      if (bytes[0] == 0)
      {
      var rxBytes = '';
      for (var i = 0; i &lt; bytes.length; i++)
      {
      rxBytes += bytes[i] + ' ';
      }
      ogscript.rename('output', 'Got Bytes: ' + rxBytes.trim());
      }
      else
      {
      ogscript.rename('output', 'Got String: ' + event.getBytesAsString());
      }
      }
      }</task>
               </listener>
            </tr>
         </table>
      </abs>

    #DashBoard