Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

This document describes the configuration and the data flow of the prodos memodata processing. The prodos webserver offers an URI that triggers the download of a memodata zip file from the prodos control. New data are available after the completion of a dosing cycle. Specific parts of the memodata have to be extracted and stored at the SiteController.

The SiteController uses its module da_rest_client to interact with the prodos webserver by REST requests.

Determine the completion of a dosing cycle

The sensor globalstates_dosing_mode represents the current state of the dosing cycle:

Configuration of the sensor for the dosing mode
    <sensor sensor_id="globalstates_dosing_mode">
    <sensor_class>code</sensor_class>
      <state_evaluation_expressions>
        <state_evaluation_expression>
          <expression>True</expression>
            <true>%value%</true>
        </state_evaluation_expression>
      </state_evaluation_expressions>
      <sensor_gateway sensor_gateway_id="globalstates_gw">
      <demux>
        <keys>
          <key>dms</key>
          </keys>
        </demux>
      </sensor_gateway>
    </sensor>

This sensor requires the sensor gateway globalstates_gw:

Configuration of the sensor gateway
<sensor_gateway publish_strategy="on_change" sensor_gateway_id="globalstates_gw">
   <rest_client>
      <uri>/fcgi/data/globalstates/1</uri>
      <scheduling>
         <polling_interval>3000</polling_interval>
         <error_handling>
            <retry retry_interval_before_alert="2000"/>
            <timeout_handling>
              <fixed_timeout>1000</fixed_timeout>
            </timeout_handling>
         </error_handling>
      </scheduling>
   </rest_client>
</sensor_gateway>

With this scheduling parameters (3 seconds interval ) all changes of the dosing mode state are acquired. If the sensor globalstates_dosing_mode has the value 'AUTO Dosing _ END' or  'Dosing _ END' the dosing cycle is completed and new memodata could be downloaded.

Download of the memodata

An AutomationController rule detects the state change to the dosing cycle completion

Configuration of the download trigger rule
 	<rule rule_id="Prodos download trigger">
 	  <triggers>
 	    <trigger value_name="dosing_mode" value_type="string" trigger_topic="calibrated_result" sensor_id="globalstates_dosing_mode"/>
 	  </triggers>
 	  <conditions>
 	    <condition expr="dosing_mode == 'AUTO Dosing _ END' or dosing_mode == 'Dosing _ END'">
 	      <true>
 	        <action_list>
 	          <action action_id="download_memodata" command="download"/>
 	        </action_list>
 	      </true>
 	    </condition>
 	  </conditions>
 	</rule>

Please refer to The da_rest_client action to get more information about the download action.

The action itself is configured this way:

Configuration of the download action
    <action action_id="download_memodata" device_id="rest_test">
      <commands>
        <command command_id="download">download('/fcgi/control/memodata_download')</command>
      </commands>
    </action>
  • No labels