Page
220
of
248
@MEASUREMENT
def minutes_of_daylight(pv):
"""
This program counts minutes of daylight in a 24 hour period.
The following measurement setup configuration is assumed:
Analog type for PV reading, measurement interval is one minute
:param pv: analog reading form PV sensor
:return: number of daylight minutes so far
"""
global m_daylight
if pv > 0.8:
""" greater than 0.8 indicates daylight """
m_da= 1.0
if ascii_time_hms(time_scheduled()) == "00:00:00":
""" at midnight, reset the counter"""
m_daylight = 0.0
return m_daylight
In the example above, every time measurement M1 is made, it will first collect a reading from the analog
sensor. It will then feed that reading to the
minutes_of_daylight
function which will produce the final
result
m_daylight
. That final result gets logged and transmitted.
20.1.4
Dew Point Measurement Script Example
Dew point is computed by putting air temperature and relative humidity readings through an equation.
The dew point example uses a total of three measurements:
One measurement is setup to measure air temperature. It may be any type of sensor, but it must
be labeled as “AT”.
A second measurement will interface to a relative humidity sensor. Again, this sensor may be of
any type as long as it produces a relative humidity reading. It ne
eds to be labeled “RH”.
The last measurement computes dew point. This one will use a script. The measurement type
used is not relevant as the sensor readings come from the other two measurements.
The
optimal measurement type to use is Manual Entry because it makes no sensor reading.
All three measurements should be scheduled at the same time to produce an accurate dew point
result.
AT and RH do not have to be logged for this setup to work.
Here is what the station will do with this setup:
Measure AT and RH. These are standard measurements.
Run the script for the dew point computation, using the AT and RH values just measured.
Produce a dewpoint result.
This is the dew point script:
Содержание SUTRON XLINK 100
Страница 1: ...Operations Maintenance Manual SUTRON XLINK 100 500 Part No 8800 1217 Rev 8 44 4 January 14 2022...
Страница 230: ...Page 230 of 248...
Страница 247: ...Page 247 of 248...