Facility Control

 View Only
  • 1.  Timer to Trigger Salvo in Ultrix

    Posted 02-12-2023 11:29

    I have a facility where we blackout screens with a salvo triggered by a button on an Ultritouch. I would like to have that salvo fire after a certain time rather than right away. The goal is to blackout the screens with a salvo an hour after I leave. Is there a script or something in the visualizer that will allow me to do this? 



    ------------------------------
    Ryan Ellis
    Design Engineer
    Diversified
    ------------------------------


  • 2.  RE: Timer to Trigger Salvo in Ultrix

    Posted 02-22-2023 17:03

    Hi Ryan

    The fastest way to run delayed script is to use our ogscript.asyncExec to run a function after a specified number of milliseconds.

    To do this in Visual Logic, you will want to use the "Create Function" tool to create a custom function:

    Give your function a name like "TurnOffLights" or "DelayedScript"

    Put your functional code in the function:

    Back in your "Main" tab, use the Custom Code block to pass your function to our asyncExec code and tell it how many milliseconds to delay:

    <abs contexttype="opengear" keepalive="true" style="bg#dark;">
       <button buttontype="push" height="115" left="57" name="Run script in one minute" top="55" width="352">
          <task tasktype="ogscript">
    function DelayedScript() {
    
    
    
    
    	/*! block id=1000 !*/
    	ogscript.debug("PUT DELAYED CODE IN FUNCTION");
    	/*!!
     	&lt;block id="1000" type="ogscript_debug" x="149" y="111" w="419" MESSAGE="PUT DELAYED CODE IN FUNCTION" /&gt;
    	!!*/
    }
    
    
    
    
    /*! block id=1001 !*/
    ogscript.asyncExec(DelayedScript, 60000);
    /*!!
     &lt;block id="1001" type="customcode" x="130" y="57" w="343" CODE="ogscript.asyncExec(DelayedScript, 60000);" /&gt;
    !!*/
    /*!!&lt;checksum&gt;f203d1c1226da4cbc3f07126b5059cf5&lt;/checksum&gt;!!*/</task>
       </button>
    </abs>
    


    ------------------------------
    James Peltzer
    Ross Video
    ------------------------------