Facility Control

 View Only

Dashboard: Display UDP Data

  • 1.  Dashboard: Display UDP Data

    Posted 4 hours ago

    Evening. I am sure that I am missing something simple. I am trying to display some UDP data in a label on a custom dashboard. I've created the listener and created the label. Just not certain that my code for capturing the listener's input is actually working because nothing displays.

    Any suggestions appreciated. Code follows:

    <?xml version="1.0" encoding="UTF-8"?><abs contexttype="opengear" id="_top" keepalive="true" style="">
       <meta>
            <params>
             <param access="1" maxlength="1024" name="UDPstring" oid="0x2" type="STRING" value="blank" widget="default"/>
            </params>
             <listener autostart="true" id="UDPListener" listenport="21321" maxlength="1024" name="UDPListen" string="true" udp="true">
                    <task tasktype="ogscript">
                    if (event.isMessageEvent()) {
                    // Get the raw message string from the event
                    var message = event.getBytesAsString();
                    // Logic to write to a parameter (e.g., 'myParam')
                    params.setValue('UDPstring', 0, message);
                    }
                    </task>
            </listener>  
       </meta>
       <label height="50" id="001" left="121" name="Test" style="txt-align:west" top="57" width="304">
       </label>
       <label height="122" id="002" left="121" objectid="UDPstring" style="txt-align:west" top="157" width="304">
       </label>      
    </abs>



    ------------------------------
    Larry Mitchell
    Mavrick Productions
    ------------------------------