Facility Control

Expand all | Collapse all

Set Context IP

  • 1.  Set Context IP

    Posted 6 days ago

    I'm working on a ross platform where there same code is being used across multiple similar systems. I need the system to listen to a GPIO card housed in an open gear frame, but both the frame IP and card slot need to be variable.  Below I have the context of the unit set to the IP address of the frame with the OG IP and slot number of the card so I can grab the params I need from the frame. 

    Does anyone know how do I reach into context and changed the objectID from another function? 

    <context contexttype="opengear" name="GPI-8941" objectid="10.0.0.205:5253&lt;br&gt;Slot 3&lt;br&gt;GPI-8941" objecttype="GPI-8941"/>​


    ------------------------------
    Brandon Baker
    ------------------------------


  • 2.  RE: Set Context IP

    Ross Staff
    Posted 4 days ago
    Hi Brandon
    You can create parameters for the dynamic fields and reload your context when they change. Here is an example panel that does just that:
    <abs contexttype="opengear">
       <meta>
          <params>
             <param access="1" maxlength="0" name="Server Panel IP" oid="Server_IP" type="STRING" value="192.168.1.100" widget="text"/>
             <param access="1" constraint="0.0;65535.0;0.0;65535.0;1" constrainttype="INT_STEP_RANGE" name="OGP Port" oid="OGP_Port" precision="0" type="INT32" value="5254" widget="spinner"/>
             <param access="1" constraint="0.0;65535.0;0.0;65535.0;1" constrainttype="INT_STEP_RANGE" name="Slot" oid="Device_Slot" precision="0" type="INT32" value="3" widget="spinner"/>
          </params>
       </meta>
       <param expand="true" height="37" left="19" oid="Server_IP" top="18" width="152">
          <task tasktype="ogscript">ogscript.reload('client-data');</task>
       </param>
       <abs bottom="0" contexttype="opengear" id="client-data" left="0" objectid="%value['Server_IP'][0]%:%value['OGP_Port'][0]%&lt;br&gt;Slot %value['Device_Slot'][0]%&lt;br&gt;GPI-8941" objecttype="GPI-8941" right="0" top="75">
          <label height="78" left="41" name="Test" style="txt-align:west" top="30" width="172"/>
       </abs>
       <param expand="true" height="38" left="180" oid="OGP_Port" top="17" width="84">
          <task tasktype="ogscript">ogscript.reload('client-data');</task>
       </param>
       <param expand="true" height="38" left="280" oid="Device_Slot" top="17" width="84">
          <task tasktype="ogscript">ogscript.reload('client-data');</task>
       </param>
    </abs>
    ​


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



  • 3.  RE: Set Context IP

    Posted 4 days ago
    Well this is pretty interesting. I was missing %value% as an option and that changes how I approach some of these problems.  Thank you James!  This is going to simply a significant amount of work.


    ------------------------------
    Brandon Baker
    ------------------------------