AnsweredAssumed Answered

PI Connector for UFL and and XML website

Question asked by Frank_ on Oct 8, 2019
Latest reply on Oct 9, 2019 by cramsey

I am trying to get the flow of a river into my PI system. We are using PI Connector for UFL. I am trying to write the INI file for the website (https://water.weather.gov/ahps2/hydrograph_to_xml.php?gage=alfw1&output=xml). I am having a hard time following the documentation, and was wondering if some one could help out.

Here is the basic of what I have

 

'https://water.weather.gov/ahps2/hydrograph_to_xml.php?gage=alfw1&output=xml
'Pend Oreille River AT Albeni Falls

FIELD(1).NAME = "primary"
FIELD(1).TYPE = "Number"

FIELD(2).NAME = "flow"
FIELD(2).TYPE = "DateTime"
FIELD(2).FORMAT = "yyyy-MM-ddThh:mm:ss.000-07:00"

'FIELD(3).NAME = "Temp"
'FIELD(4).NAME = "Temp2"


[MSG]
MSG(1).NAME = "MSG_1"

 

---------------------------------

 

Here is where I go off the rails and am lost. How do I get the most current (or first) flow rate from the XML?

 

<site xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" timezone="PST8PDT" originator="OTX" name="Pend Oreille River AT Albeni Falls" id="ALFW1" xsi:noNamespaceSchemaLocation="https://weather.gov/ohd/hydroxc/schemas/hydrogen/HydroGenData.xsd" generationtime="2019-10-04T22:39:08+00:00">
<disclaimers>...</disclaimers>
<sigflows>...</sigflows>
<zerodatum units="ft MSL">0</zerodatum>
<rating dignity="official">...</rating>
<alt_rating dignity="computed">...</alt_rating>
<observed>
<datum>
<valid timezone="UTC">2019-10-04T22:00:00-00:00</valid>
<primary name="Flow" units="kcfs">26.2</primary>
<pedts>QRIRR</pedts>
</datum>
<datum>
<valid timezone="UTC">2019-10-04T21:00:00-00:00</valid>
<primary name="Flow" units="kcfs">26.2</primary>
<pedts>QRIRR</pedts>
</datum>
<datum>
<valid timezone="UTC">2019-10-04T20:00:00-00:00</valid>
<primary name="Flow" units="kcfs">26.1</primary>
<pedts>QRIRR</pedts>
</datum>
<datum>
Any help would be appreciated.

Outcomes