Facility Control

 View Only
  • 1.  Changing IP Address on trigger

    Posted 07-31-2018 13:07
    Hi all,

    I looked around the forum and couldn't find a solution for this. Basically, I have a bunch of xpressions, operating from a single dashboard. Upon failure of an xpression, I want to quickly point to another Xpr's ip address.

    I have a bunch of xpression devices. I'm basically looking for a script that when button press, it assigns a parameter (typed IP address) to a devices.host

    Thank you in advance.
    Al.


  • 2.  RE: Changing IP Address on trigger

    Posted 07-31-2018 13:36

    Hi Al.
    While you can write a script that will update (temporarily) the host table: (ogscript.putPrivateString('hosts', 'DEVICE_ID.host', 'NEW_IP_ADDRESS');
    A better approach for what you're trying to achieve is to use the "create parameter" option when you add your XPression device to your panel. When you do this, the value of the parameter will always be used as the IP Address for the XPression commands.


     

    <abs contexttype="opengear">
       <meta>
          <lookup id="hosts">
             <entry key="MyXPression.scriptport">false</entry>
             <entry key="MyXPression.color">-1145302</entry>
             <entry key="MyXPression.port">7788</entry>
             <entry key="MyXPression.host">params.getValue('XPression_Host', 0)</entry>
             <entry key="MyXPression.scripthost">true</entry>
             <entry key="MyXPression.devicetype">XPression</entry>
          </lookup>
          <params>
             <param access="1" constraintstrict="false" constrainttype="STRING_STRING_CHOICE" maxlength="0" name="XPression Host" oid="XPression_Host" type="STRING" value="192.168.100.100" widget="radio-toggle">
                <constraint key="192.168.100.100">Primary</constraint>
                <constraint key="192.168.100.101">Backup</constraint>
             </param>
          </params>
       </meta>
       <param expand="true" height="98" left="10" oid="XPression_Host" style="style:toggleButton;" top="13" width="281"/>
       <button buttontype="push" height="66" left="19" name="Take 1" top="121" width="265">
          <task tasktype="ogscript">
    
    
    /*! block id=1000 !*/
    rosstalk.sendMessage(params.getValue('XPression_Host', 0), parseInt(ogscript.getPrivateString('hosts', 'MyXPression.port')), "TAKE " + 1 + ":" + (1 -1) + ":" + 1);
    /*!!
     &lt;block id="1000" type="MyXPression_xpression_take" x="10" y="100" w="243" color="#ee862a" TAKEID="1" BUFFER="1" LAYER="1" /&gt;
    !!*/
    /*!!&lt;checksum&gt;79c675d1461608f03cb38f01db454658&lt;/checksum&gt;!!*/</task>
       </button>
    </abs>

    Hope that helps.

    James


    #DashBoard


  • 3.  RE: Changing IP Address on trigger

    Posted 07-31-2018 14:16
    Yes, this helps. I totally missed that. Thank you!
    #DashBoard