Techincal documentation for GroWeather Dll



Description of the files included with the GroWeather Dll.

readme.txt Documents the DLL functions and structures. The Programmers reference disk contains detailed information about the software commands and the memory address table used in communication with the Monitor. The Dll functions can be used without the Programmers reference disk.
readme.htm readme.txt in html format.
groweather.dll Dll for communicating with GroWeather stations. This should be copied to your project or the windows directory.
groweather.lib import library for the Dll When compiling a in C/C++ environment include this library in the link path and groweather.h as the header file for your source files.
groweather.h C/C++ header file containing the declarations for the Dll functions.
groweather.bas A Visual Basic .bas file containing the declarations for the Dll functions. Include this in your Modules section of your Visual Basic Project.
groweather.def A text file containing the ordinal numbers associated with the Dll functions. This is mainly for programmers using the Dll at run time using the LoadLibrary function. The import library does not have to be linked at compile time in this case.
license.txt License agreement for the Dll.




The syntax used in the following constants, structures and functions is based on C .

int refers to a 4 byte integer
short int refers to a 2 byte integer
float refers to a 4 byte floating point
char refers to a single byte.



//Constants

INCHES 0
MM 1
MB 2
HECTO_PASCAL 3
FAHRENHEIT 0
CELSIUS 1
MPH 0
KNOTS 1
KPH 2
METERS_PER_SECOND 3
KM 1
MILES 0
NOT_SET -100
COM_ERROR -101
MEMORY_ERROR -102
COM_OPEN -103

//Structures

struct SensorImage
{
short int newPtr;
float airTemp;
float soilTemp;
short int humidity;
float barometer;
short int windSpeed;
short int windDirection;
float totalRain;
float rainRate;
short int solarRad;
long totalWindRun;
float totalEt;
long totalDegreeDays;
float totalEnergy;
long alarmBits;
char statusByte;
short int leafByte;
};


struct DateTime
{
short int year;
short int month;
short int day;
short int hour;
short int min;
};


struct TimeHourMin
{
short int hour;
short int min;
};


struct Options
{
char UseDialogBox;
char ClearArchive;
char WriteToFile;
char AppendToFile;
};


struct Units
{
char TempUnit;
char RainUnit;
char BaromUnit;
char WindUnit;
};


struct WeatherRecord
{
short int month,day,hour,min;
float hiAirTemp;
float lowAirTemp;
float soilTemp;
short int leafWetness;
short int solarRad ;
float solarEnergy ;
float AirTemp;
float barometer;
short int Humidity;
short int degreeDays;
float et;
float dewPoint;
float tempHumIndex;
float rain;
float rainRate;
short int windSpeed;
short int highWindSpeed;
float windChill;
short int windDirection;
short int windRun;
};


struct AutoClearOptions
{
char Temp;
char Wind;
char DailyET;
char Rain;
char DegreeDay;
char SolarEnergy;
char Humidity;
};


Return Values

NOT_SET indicates that the sensor is not connected. NOT_SET is also used as a parameter to clear values.

COM_ERROR indicates that there was a problem in communication with the Weather station. Check your com port settings and increase the value of timeout using SetCommTimeOutValues.

1 usually indicates success

-1 usually indicates failure.


The GroWeatherDll functions end with the letter 'G' to avoid possible conflict with the WeatherlinkDll if both are being used in the same project. The Dll Functions have been grouped as follows:

Initialization Functions

OpenCommPortG OpenCommPortStrG CloseCommPortG SetUnitsG
GetUnitsG SetupRainCollectorG

Lowlevel Functions

GetSerialCharG PutSerialStringG PutSerialCharG

General Functions

GetDllVersionG GetPeriodG ResetPeriodG GetRainRateG
GetBarometerG GetLeafWetnessG GetLWEG GetPrimaryPowerStatusG
GetBatteryPowerStatusG GetBarometerTrendG SetLWEG GetAirTempG
GetTHIG GetSoilTempG GetHumidityG GetWindDirectionG
GetModelNoG GetWindSpeedG GetStationTimeG SetStationTimeG
GetTotalRainG GetDailyRainG GetYearlyRainG SetCommTimeoutValG
SendSensorImagesG GetSensorImageG StopSendingImagesG PutBarometerG
GetCurrentSolarRadG GetDailySolarRadG GetSolarAvgEnergyG GetDewPtG
GetWindChillG GetTotalWindRunG GetDailyWindRunG GetAvgWindRunG
GetTotalETG GetDailyETG GetAvgETG GetTotalDegDaysG
GetDailyDegDaysG GetAvgDegDaysG GetDegDayBaseTempG GetDegDayMaxTempG
SetDegDayBaseTempG SetDegDayMaxTempG

Alarm Functions

GetAirHiTempAlarmG SetAirHiTempAlarmG GetAirLowTempAlarmG SetAirLowTempAlarmG
GetSoilHiTempAlarmG SetSoilHiTempAlarmG GetSoilLowTempAlarmG SetSoilLowTempAlarmG
GetBarAlarmG SetBarAlarmG GetTimeAlarmG PutTimeAlarmG
SetDewPtAlarmG GetDewPtAlarmG GetHiWindSpeedAlarmG PutHiWindSpeedAlarmG
GetLowWindChillAlarmG SetLowWindChillAlarmG GetLowOutsideHumAlarmG GetHiOutsideHumAlarmG
SetLowOutsideHumAlarmG SetHiOutsideHumAlarmG GetDegDayTotalAlarmG SetDegDayTotalAlarmG
GetDegDayTotalAlarmG SetDegDayTotalAlarmG GetHiTHIAlarmG SetHiTHIAlarmG
GetDailyETAlarmG SetDailyETAlarmG GetTotalETAlarmG SetTotalETAlarmG

High Low Functions

GetHiLowTimesAirTempG GetHiLowTimesOutHumG GetLowTimesWindChillG GetHiTimesTHIG
GetHiTimesWindSpeedG GetHiTimesRainRateG GetHiAirTempG GetLowAirTempG
GetHiSoilTempG GetLowSoilTempG GetHiOutsideHumG GetLowOutsideHumG
GetLowWindChillG GetHiWindSpeedG GetHiTHIG GetHiRainRateG

Calibrate Functions

GetWindCalG SetWindCalG GetAirTempCalG PutAirTempCalG
GetSoilTempCalG PutSoilTempCalG GetHumCalG PutHumCalG
PutBarometerCalG GetBarometerCalG GetRainCalG PutRainCalG

Download Functions

GetArchiveIntervalG SetArchiveIntervalG GetNumberOfArchiveRecordsG DownloadG
GetArchiveRecordG GetArchiveRecordByAddrG GetArchRecordNoByDateG

Clear Functions

ClearHiAirTemperatureG ClearLowAirTemperatureG ClearHiSoilTemperatureG ClearLowSoilTemperatureG
ClearHiOutsideHumidityG ClearLowOutsideHumidityG ClearHiwindSpeedG ClearLowChillG
ClearDailyRainG ClearYearlyRainG PutTotalRainG GetAutoClearG
PutAutoClearG

Initialization Functions



short int OpenCommPortG (short int comPort, int baudRate, char linkRev);
Parameters
comPort  number of the port to be opened.
baudrate  This can be 1200 or 2400.
linkRev  Link revision. Can be the character 'D' or 'E'
Description Use this function to open the com port. CloseCommPortG closes
the port. This function must be called before any other function in the Dll which
communicates with the weather station.
Return Values
1 if successful
COM_OPEN if com is already open
MEMORY_ERROR system is low on memory
COM_ERROR communication error


short int OpenCommPortStrG (char* comPort, intbaudRate);
Parameters
comPort a character string such as"COM1" Maximum size is 256.
baudrate This can be 1200 or 2400.
linkRev  Link revision. Can be the character 'D' or 'E'
Description
Use either this function or OpenCommPortG to open the com port. CloseCommPortG
closes the port.
Return Values
1 if successful
COM_OPEN if com is already open
MEMORY_ERROR system is low on memory
COM_ERROR communication error.


short int CloseCommPortG();
Description
Closes the comport opened by OpenCommPortG or OpenCommPortStrG. This function
should only be used after opening the com port.
Return Values
1 if successful
COM_ERROR if com was already closed


short int SetUnitsG(Units* WeatherUnits);
Parameters
struct Units {
char TempUnit;
char RainUnit;
char BaromUnit;
char WindUnit;
};
Description The Dll sets the default units as following:
Temperature unit is FAHRENHEIT
Barometer unit is INCHES
Rain unit is INCHES
Wind unit is MPH
The variables in the structure Units can be set to one of the following unit
constants defined in the header file weatherlink.h or weatherlink.bas . The Dll
functions expects the input parameters in these units and returns the values in the
units currently set. So if the Dll temperature unit is set to Fahrenheit then any
function which returns a temperature will return the value in Fahrenheit.
SetUnitsG can be used to change the units in the Dll.
Return Values
1 if successful


short int GetUnitsG(Units* WeatherUnits);
Description
Fills the structure WeatherUnits with the units currently being used in the Dll.
Return Values
1 if successful


short int SetupRainCollectorG(float RainClickInc,short int NativeUnit, short int DisplayUnit);
Parameters
RainClickInc Consult you Rain Collector manual to find out the native increment. The possible values are .01, .1, .2 , 1
NativeUnit This is the unit for the native increment. This can be in the constant INCHES or MM .
DisplayUnit The unit which will be used in the Dll functions dealing with rain such as GetDailyRain,GetYearlyRain. Again this can be in INCHES or MM. The rain unit can also be set using the function SetUnitsG .
Description
Lets the Dll know what type of rain collector is installed and sets the rain
calibration on the station. Also sets the rain display unit used internally by
the Dll functions.
Return Values
-1 if error 1 if successful


Lowlevel Functions



Normally the Dll functions should be sufficient to communicate with the Weather station and obtain data. The low level functions provide additional flexibility which lets a user send his own commands and retrieve data. The serial port has be opened first before using any of these functions.

short int GetSerialCharG ();
Description
Retrieves a character from the serial port. The port should have been opened
with either OpenCommPortG or OpenCommPortStrG.
Return Values
-1 if error


short int PutSerialStrG (const char *stringtoport);
Description
Sends the character string "stringtoport" to the serial port.
Return Values
0 if successful
-1 if error


short int PutSerialCharG (unsigned char c);
Description
Sends a character to the serial port
Return Values
0 if successful
-1 if error


General Functions



float GetDllVersionG ();
Description
Gets the Dll version number.
Return Values
1 if successful


float GetPeriodG ();
Description
Gets the period in days.
Return Values
COM_ERROR if error


short int ResetPeriodG ();
Description
Clears the period on the station.
Return Values
COM_ERROR if error
1 if successful


float GetRainRateG ();
Description
Gets the current rain rate in Inches or mm per hour.
Return Values
COM_ERROR if error
1 if successful


float GetBarometerG ();
Description
Returns the calibrated barometric pressure.
Return Values
COM_ERROR if error


short int GetLeafWetnessG ();
Description
Returns the leaf wetness, a value from 0 to 15. The GroWeather station can use either the soil temp sensor or the leaf wetness sensor. Use the function SetLWEG() to inform the station that the connected sensor is the leaf wetness sensor.
Return Values
COM_ERROR if error
NOT_SET if sensor is not connected


short int GetLWEG ();
Description
Returns 1 if LeafWetness is enabled on the station otherwise returns 0 for Soil Temp. Use SetLWEG() to choose the leaf wetness sensor.
Return Values
COM_ERROR if error


short int GetPrimaryPowerStatusG();
Description
Returns 0 if the primary power voltage is low and 1 if the voltage is high.
Return Values
COM_ERROR if error


short int GetBatteryPowerStatusG ();
Description
Returns 0 if the batterry voltage is low and 1 if the voltage is high.
Return Values
COM_ERROR if error


short int GetBarometerTrendG ();
Description
Returns the barometric trend. The possible values are
0 means steady
1 means rise
2 means fall
The trend remains at steady unless the barometric pressure changed by more than .02
inches over the past hour.
Return Values
COM_ERROR if error


short int SetLWEG(short int SetSensorType);
Parameters
SetSensorType Set to 1 to enable leaf wetness sensor and 0 to enable soil temp sensor.
Description
Enable the leaf wetness or the soil temp sensor on the station.
Return Values
COM_ERROR if error
1 if successful


float GetAirTempG();
Description
Returns the calibrated outside temperature.
Return Values
COM_ERROR if error
NOT_SET if sensor is not connected


float GetTHIG();
Description
Returns the Temperature-Humidity Index. It uses outside temperature and outside humidity (both calibrated).
Return Values
COM_ERROR if error
NOT_SET if sensor is not connected


float GetSoilTempG();
Description
Gets the soil temperature. Use the function SetLWEG() to inform the station to use the soil temp sensor instead of the leaf wetness sensor.
Return Values
COM_ERROR if error
NOT_SET if sensor is not connected


short int GetHumidityG();
Description
Returns the humidity.
Return Values
COM_ERROR if error
NOT_SET if sensor is not connected


short int GetWindDirectionG();
Description
Returns the wind direction in degrees. The possible values are from 0 to 359.
Return Values
COM_ERROR if error
NOT_SET if sensor is not connected


short int GetModelNoG();
Description
Returns the model type of the Weather Station.
Model# Model Name Model# Model Name
0 Wizard III 8 ----
1 Wizard II 9 ----
2 Monitor A ----
3 Perception B ----
4 GroWeather C ----
5 Energy D ----
6 Health E ----
7 ---- F Old
Return Values
COM_ERROR if error


float GetWindSpeedG
Description
Gets the current wind speed.
Return Values
COM_ERROR if error


short int GetStationTimeG (DateTime* DateTimeStation);
Description
Fills the structure DateTime with the current weather station time. The range
for the hour is 0-23.
Return Values
COM_ERROR if error
1 if successful


short int SetStationTimeG (DateTime* DateTimeStation);
Parameters
DateTimeStation
short int year The year value should be set in the long format such as 1998 rather than 98.
short int month
short int day
short int hour Hour range is 0-23.
short int min
Description
Sets the station time.
Return Values
COM_ERROR if error
1 if successful


float GetTotalRainG ();
Description
Returns the total rain.
Return Values
COM_ERROR if error


float GetDailyRainG ();
Description
Returns the daily rain. This value can be cleared using the ClearDailyRainG or the PutAutoClear function.
Return Values
COM_ERROR if error


float GetYearlyRainG ();
Description
Same as GetTotalRain().
Return Values
COM_ERROR if error


short int SetCommTimeoutValG(short int ReadTimeout, short int WriteTimeout);
Parameters
ReadTimeout in milliseconds
WriteTimeout in milliseconds
Description
The default values for sending a character and receiving a character are set
to 2 seconds in the Dll. Use this function to change the time out values.
This function should only be used after opening the com port.
Return Values
1 if successful
COM_ERROR if error


short int SendSensorImagesG (short int n);
Parameters
n Request the link to send n packets of weather data (sensor image).
Description
This call basically implements the LOOP command. The packets can be retrieved
using the Dll function GetSensorImageG.
Ex:
SensorImage sI;
if ( SendSensorImagesG(1) != COM_ERROR)
  GetSensorImageG(&sI);
Return Values
1 if successful
COM_ERROR if error


short int GetSensorImageG (SensorImage* sI);
Parameters
sI A pointer to the structure SensorImage
Description
Gets the loop packets requested by the function SendSensorImagesG. This
function should only be used after a call to SendSensorImagesG. The structure
SensorImage is filled with raw values i.e. not calibrated.The windrun is always returned in miles.
Return Values
1 if successful
COM_ERROR if error
CRC_ERROR if crc error


short int StopSendingImagesG ();
Description
This function should be used after SendSensorImagesG and tells the Weather
Station to stop sending the loop packets requested by the function SendSensorimagesG.
Return Values
1 if successful


short int PutBarometerG(float Barom);
Description
Sets the current Barometric reading on the station to the value in the parameter
Barom by adjusting the calibration.
Return Values
1 if successful
COM_ERROR if error


short int GetCurrentSolarRadG();
Description
Gets the current solar radiation in Watts per meter squared.
Return Values
1 if successful
NOT_SET if sensor is not connected


float GetDailySolarRadG();
Description
Gets the daily solar radiation in Langleys.This value can be cleared using the PutAutoClear function.
Return Values
1 if successful
COM_ERROR if error


float GetSolarAvgEnergyG();
Description
Gets the average daily solar radiation in Langleys for the GroWeather period.
Return Values
1 if successful
NOT_SET if


float GetDewPtG ();
Description
Returns the Dew point.
Return Values
COM_ERROR if error
NOT_SET if sensor is not connected


float GetWindChillG ();
Description
Returns the wind chill.
Return Values
COM_ERROR if error
NOT_SET if sensor is not connected


float GetTotalWindRunG ();
Description
Returns the total wind run. Wind run is the distance calculated by integral summation of wind speed multiplied by the measurement period.
Return Values
COM_ERROR if error


float GetDailyWindRunG ();
Description
Returns the daily wind run. This value can be cleared using the PutAutoClear function.
Return Values
COM_ERROR if error


float GetAvgWindRunG ();
Description
Returns the average daily wind run for the GroWeather period.
Return Values
COM_ERROR if error


float GetTotalETG ();
Description
Returns the total ET in daily wind run for the GroWeather period.
Return Values
COM_ERROR if error


float GetDailyETG ();
Description
Returns the daily ET for the GroWeather period. This value can be cleared using the PutAutoClear function.
Return Values
COM_ERROR if error


float GetAvgETG ();
Description
Returns the average ET for the GroWeather period.
Return Values
COM_ERROR if error


float GetTotalDegDaysG ();
Description
Returns the total degree days.
Return Values
COM_ERROR if error


float GetDailyDegDaysG ();
Description
Returns the daily degree days.
Return Values
COM_ERROR if error


float GetAvgDegDaysG ();
Description
Returns the average daily degree days.
Return Values
COM_ERROR if error


float GetDegDayBaseTempG();
Description
Returns the base threshold for the degree day.
Return Values
COM_ERROR if error


float GetDegDayMaxTempG();
Description
Returns the upper threshold for the degree day.
Return Values
COM_ERROR if error


float SetDegDayBaseTempG(float baseTemp);
Description
Returns the base threshold for the degree day.
Return Values
COM_ERROR if error


float SetDegDayMaxTempG(float baseTemp);
Description
Sets the upper threshold for the degree day. baseTemp can be in Celsius or Fahrenheit.
Return Values
COM_ERROR if error


Alarm Functions



float GetAirHiTempAlarmG();
Description
Gets the high air temperature alarm.
Return Values
COM_ERROR if error
NOT_SET if alarm is clear


short int SetAirHiTempAlarmG(float hiAlarm);
Description
Sets the high air temperature alarm.The alarm is cleared if the value of hiAlarm is NOT_SET .
Return Values
COM_ERROR if error
1 if successful


float GetAirLowTempAlarmG();
Description
Gets the low air temperature alarm.
Return Values
COM_ERROR if error
NOT_SET if alarm is clear


short int SetAirLowTempAlarmG(float lowAlarm);
Description
Sets the low air temperature alarm.The alarm is cleared if the value of lowAlarm is NOT_SET .
Return Values
COM_ERROR if error
1 if successful


float GetSoilHiTempAlarmG();
Description
Gets the high Soil temperature alarm.
Return Values
COM_ERROR if error
NOT_SET if alarm is clear


short int SetSoilHiTempAlarmG(float hiAlarm);
Description
Sets the high Soil temperature alarm.The alarm is cleared if the value of hiAlarm is NOT_SET .
Return Values
COM_ERROR if error
1 if successful


float GetSoilLowTempAlarmG();
Description
Gets the low Soil temperature alarm.
Return Values
COM_ERROR if error
NOT_SET if alarm is clear


short int SetSoilLowTempAlarmG(float lowAlarm);
Description
Sets the low Soil temperature alarm.The alarm is cleared if the value of lowAlarm is NOT_SET .
Return Values
COM_ERROR if error
1 if successful


float GetBarAlarmG ();
Description
Get the barometric alarm. Return NOT_SET if alarm is cleared.
Return Values
COM_ERROR if error
NOT_SET if alarm is clear


short int SetBarAlarmG (float barAlarm);
Description
Sets the barometric alarm.The possible values for the barAlarm in Inches are
.02,.04,.06 and NOT_SET to clear the alarm. If the Dll uses a unit other
than Inches for the Barometer then enter the value for barAlarm in that
unit. So if the Dll uses mm the possible values for barAlarm are .5,1.0,1.5 mm .
Return Values
COM_ERROR if error
1 if successful


short int GetTimeAlarmG (TimeHourMin* TimeAlarm);
Description
Fills the structure TimeAlarm with the station alarm. Hour range is 0-23
and NOT_SET when alarm is not set. Min range is 0-60 and NOT_SET when
alarm is not set.
Return Values
1 if successful
COM_ERROR if error
NOT_SET if alarm is clear


short int PutTimeAlarmG (short int Hours ,short int Minutes);
Parameters
Hours range is 0-23 minutes range is 0-60.If either value is set to
NOT_SET then the alarm on the station is cleared.
Description
Sets the time alarm on the weather station.
Return Values
-1 if input parameters are out of range.
1 if successful
COM_ERROR if error


short int SetDewPtAlarmG (short int TurnOn);
Parameters
TurnOn = NOT_SET to turn it off
TurnOn = 1 to turn it on
Description
Sets the Dew pt alarm on the station. The Dew pt alarm sounds when
the Dew Pt is within 1 degree of the Dew Pt.
Return Values
1 if successful
COM_ERROR if error


short int GetDewPtAlarmG();
Description
Checks whether the dew point alarm is set on the station.
Return Values
1 if alarm is set
COM_ERROR if error
NOT_SET if alarm is clear


short int GetHiWindSpeedAlarmG ();
Description
Gets the high wind speed alarm.
Return Values
COM_ERROR if error
NOT_SET if alarm is clear


short int PutHiWindSpeedAlarmG (short int hiAlarm);
Description
Sets the high wind speed alarm. Alarm is cleared if hiAlarm is set to NOT_SET.
Return Values
COM_ERROR if error
1 if successful


float GetLowWindChillAlarmG ();
Description
Gets the low wind chill alarm.
Return Values
COM_ERROR if error
NOT_SET if alarm is clear


short int SetLowWindChillAlarmG (float lowAlarm);
Parameters
if lowAlarm is set to NOT_SET then the alarm is cleared.
Description
Sets the value of low wind chill alarm.
Return Values
COM_ERROR if error
1 if successful


short int GetLowOutsideHumAlarmG ();
Description
Returns the low outside humidity alarm
Return Values
COM_ERROR if error
NOT_SET if alarm is clear


short int GetHiOutsideHumAlarmG ();
Description
Returns the high outside humidity alarm
Return Values
COM_ERROR if error
NOT_SET if alarm is clear


short int SetLowOutsideHumAlarmG (short int lowAlarm);
Description
Sets the low outside humidity alarm. If the value of lowAlarm is
NOT_SET then the alarm is cleared.
Return Values
COM_ERROR if error
1 if successful


short int SetHiOutsideHumAlarmG (short int hiAlarm);
Description
Sets the high outside humidity alarm. If the value of hiAlarm is
set to NOT_SET then the alarm is cleared.
Return Values
COM_ERROR if error
1 if successful


int GetDegDayTotalAlarmG ();
Description
Returns the alarm value for total degree days.
Return Values
COM_ERROR if error
NOT_SET if alarm is clear


short int SetDegDayTotalAlarmG (float hiAlarm);
Description
Sets the alarm for total degree days. If the value of hiAlarm is set to NOT_SET then the alarm is cleared.
Return Values
COM_ERROR if error
1 if successful


float GetHiTHIAlarmG ();
Description
Returns the high THI alarm. There is no low THI alarm.
Return Values
COM_ERROR if error
NOT_SET if alarm is clear


short int SetHiTHIAlarmG (float hiAlarm);
Description
Sets the high THI alarm. If the value of hiAlarm is set to NOT_SET then the alarm is cleared.
Return Values
COM_ERROR if error
1 if successful


float GetDailyETAlarmG ();
Description
Returns the Daily ET alarm.
Return Values
COM_ERROR if error
NOT_SET if alarm is clear


short int SetDailyETAlarmG (float hiAlarm);
Description
Sets the Daily ET alarm. If the value of hiAlarm is set to NOT_SET then the alarm is cleared.
Return Values
COM_ERROR if error
1 if successful


float GetTotalETAlarmG ();
Description
Returns the Total ET alarm.
Return Values
COM_ERROR if error
NOT_SET if alarm is clear


short int SetTotalETAlarmG (float hiAlarm);
Description
Sets the Total ET alarm. If the value of hiAlarm is set to NOT_SET then the alarm is cleared.
Return Values
COM_ERROR if error
1 if successful


High Low Functions



short int GetHiLowTimesAirTempG (DateTime* DateTimeHiAirTemp,DateTime* DateTimeLowAirTemp);
Description
Fills the DateTime structures with the high and low times. Use a function like
GetAirTempG to make sure that the outside temperature sensor is connected before
using this function.
Return Values
COM_ERROR if error
1 if successful


short int GetHiLowTimesOutHumG (DateTime* DateTimeHiOutHum,DateTime* DateTimeLowOutHum);
Description
Fills the DateTime structures with the high and low times. Use a function like
GetHumidityG to make sure that the outside humidity sensor is connected before
using this function.
Return Values
COM_ERROR if error
1 if successful


short int GetLowTimesWindChillG (DateTime* DateTimeLowWindChill);
Description
Fills the DateTime structure with the time for low wind chill.
Return Values
COM_ERROR if error
1 if successful


short int GetHiTimesTHIG (DateTime* DateTimeHiTHI);
Description
Fills the DateTime structure with the time for hight THI.
Return Values
COM_ERROR if error
1 if successful


short int GetHiTimesWindSpeedG (DateTime* DateTimeHiWindSpeed);
Description
Fills the DateTime structure with the time for hi wind speed.
Return Values
COM_ERROR if error
1 if successful
NOT_SET if the highest wind speed is 0 .

short int GetHiTimesRainRateG (DateTime* DateTimeHiRainRate);
Description
Fills the DateTime structure with the time for high rain rate.
Return Values
COM_ERROR if error
1 if successful


float GetHiAirTempG();
Description
Gets the high outside temperature.
Return Values
NOT_SET if the sensor is not connected
COM_ERROR if error


float GetLowAirTempG();
Description
Gets the low outside temperature.
Return Values
NOT_SET if the sensor is not connected
COM_ERROR if error


float GetHiSoilTempG();
Description
Gets the high soil temperature.
Return Values
NOT_SET if the sensor is not connected
COM_ERROR if error


float GetLowSoilTempG();
Description
Gets the low soil temperature.
Return Values
NOT_SET if the sensor is not connected
COM_ERROR if error


short int GetHiOutsideHumG();
Description
Gets the high outside humidity.
Return Values
NOT_SET if the sensor is not connected
COM_ERROR if error


short int GetLowOutsideHumG();
Description
Gets the low outside humidity.
Return Values
NOT_SET if sensor is not connected
COM_ERROR if error


float GetLowWindChillG();
Description
Gets the low wind chill value.
Return Values
NOT_SET if sensor is not connected
COM_ERROR if error


float GetHiWindSpeedG();
Description
Gets the high wind speed.
Return Values
COM_ERROR if error


float GetHiTHIG();
Description
Gets the high THI value.
Return Values
NOT_SET if sensor is not connected
COM_ERROR if error


float GetHiRainRateG();
Description
Gets the high rain rate.
Return Values
COM_ERROR if error


Calibrate Functions



float GetWindCalG();
Description
Gets the current wind calibration. The wind speed is calculated as follows Wind Speed = "SpdDta" * 1600 / "SpdCal" and the default wind calibration is 1600.
Return Values
COMM_ERROR if error


short int SetWindCalG(short int Windcal);
Description
Sets the wind calibration.
Return Values
COMM_ERROR if error
1 if successful


float GetAirTempCalG ();
Description
Gets the outside temperature calibration.
Return Values
COMM_ERROR if error


short int PutAirTempCalG (float calNumber);
Parameters
Set calNumber to 0 to clear the calibration. The calNumber should be in the units
that the Dll is currently using. See the SetUnitsG function.
Description
Sets the outside temperature calibration on the station.
Return Values
1 if successful
COM_ERROR if error


float GetSoilTempCalG ();
Description
Gets the soil temperature calibration.
Return Values
COMM_ERROR if error


short int PutSoilTempCalG (float calNumber);
Parameters
Set calNumber to 0 to clear the calibration. The calNumber should be in the units
that the Dll is currently using. See the SetUnitsG function.
Description
Sets the soil temperature calibration on the station.
Return Values
1 if successful
COM_ERROR if error


short int GetHumCalG();
Description
Gets the outside humidity calibration.
Return Values
COM_ERROR if error


short int PutHumCalG (short int calNumber);
Parameters
Set calNumber to 0 to clear the calibration.
Description
Sets the outside humidity calibration.
Return Values
1 if successful
COM_ERROR if error


float GetBarometerCalG();
Description
Gets the current barometric calibration. The barometric calibration is
added to the current station value to give the calibrated value.
Return Values
COMM_ERROR if error


short int PutBarometerCalG (float calNumber);
Description
Sets the Barometric calibration on the station. calNumber should be in the current
unit for barometer being used in the Dll.
Return Values
1 if successful
COM_ERROR if error


short int GetRainCalG();;
Description
Gets the rain calibration.
Return Values
COM_ERROR if error


short int PutRainCalG (short int calNumber);
Description
Sets the rain calibration number. This function is included for
completeness. The calibration is set when you use the function
SetupRainCollectorG. Consult your rain collector manual for
more information on rain calibration numbers.
Return Values
1 if successful
COM_ERROR if error


Download Functions



short int GetArchiveIntervalG ();
Description
Gets the archive interval in minutes on the station.The possible values are 1,5,10,15,30,
60,120 .
Return Values
COM_ERROR if error
The archive period in minutes


short int SetArchiveInterval (short int intervalCode);
Parameters
Valid Values 1,5,10,15,30,60,120
Description
Sets the archive interval in minutes on the station.
Return Values
COM_ERROR if error
1 if successful


short int GetNumberOfArchiveRecordsG();
Description
Returns the number of records in the archive memory.
Return Values
COM_ERROR if error


short int DownloadG(Options* DnloadOptions, char* DnloadFileName);
Parameters
The Options structure is defined as:
struct Options
{
char UseDialogBox;
char ClearArchive;
char WriteToFile;
char AppendToFile;
};
Set the values of the parameters inside it to configure the download of the
archive data.
UseDialogBox Set this to 1 to display the dialog box requesting the user to proceed with the download.
ClearArchive Set this to 1 to clear the archive memory after a download.
WriteToFile Set this to 1 and specify a file name in DnloadFileName to store the archive data in a text file with the name DnloadFileName. This file will deletes any previous contents if the file exists else creates a new file.
AppendToFile Set this to 1 and specify an existing file name in DnloadFileName. The archive data is appended to this file after downloading.
Description
Starts the download of the archive data. Returns the number of records transferred.
Return Values
0,-1 if an error occurs.
# of records transferred if successful.


short int GetArchiveRecordG(WeatherRecord* newRecord, short int i);
Description
Fills the WeatherRecord structure with the data for the record number i in the data just downloaded from the archive. The records are numbered from 0 . This function can be used to access the downloaded data instead of the options in DownloadG which write the data to a file. This function must be used immediately after the DownloadG function. If another Dllfunction other than the ones in the download group is called after DownloadG then the Dll frees the memory used for storing the downloaded data. The windDirection in the record is a number from 0-15 .Appendix F of the programmer's Reference Disk contains the mapping from the number to the Sector code. Note that if the Download function is used to save the archive data in a text file then the text file contains the Sector codes and not a number.
Return Values
1 if successful


short int GetArchiveRecordByAddrG(WeatherRecord* newRecord, short int ptr);
Description
Fills the WeatherRecord structure with the data for the archive record with the address in the parameter ptr . One way of using this function is to obtain bulletin data using GetSensorImageG and then use the newPtr value in the SensorImage structure to call GetArchiveRecordByAddrG. If newPtr is greater than 0 then the address of the last record is (newPtr - 32) otherwise it is (((32*1024)-256)-64). This method obtains the contents of the last archived record without calling the DownloadG function.
Return Values
1 if successful
COM_ERROR if error


short int GetArchRecordNoByDateG(DateTime* recDate);
Description
Gets the position of the first record in the data just downloaded whose date
and time is greater than the recDate. The positions are numbered from 0 .This
function should be used after DownloadG to find out which records the user
needs to store in the database.
Return Values
-1 if error


Clear Functions



short int ClearHiAirTemperatureG();
Description
Clears the high air temperature.
Return Values
COM_ERROR if error
1 if successful


short int ClearLowAirTemperatureG();
Description
Clears the low air temperature.
Return Values
COM_ERROR if error
1 if successful


short int ClearHiSoilTemperatureG();
Description
Clears the high soil temperature.
Return Values
COM_ERROR if error
1 if successful


short int ClearLowSoilTemperatureG();
Description
Clears the low soil temperature.
Return Values
COM_ERROR if error
1 if successful


short int ClearHiOutsideHumidityG();
Description
Clears the high outside humidity.
Return Values
COM_ERROR if error
1 if successful


short int ClearLowOutsideHumidityG();
Description
Clears the low outside humidity.
Return Values
COM_ERROR if error
1 if successful


short int ClearHiWindSpeedG();
Description
Clears the high wind speed.
Return Values
COM_ERROR if error
1 if successful


short int ClearLowChillG();
Description
Clears the low wind chill.
Return Values
COM_ERROR if error
1 if successful


short int ClearDailyRainG();
Description
Clears the daily rain.
Return Values
COM_ERROR if error
1 if successful


short int ClearYearlyRainG();
Description
Clears the yearly rain.
Return Values
COM_ERROR if error
1 if successful


short int PutTotalRainG (float TotalRain);
Description
Sets the total rain to the value of TotalRain.
Return Values
COM_ERROR if error
1 if successful


short int GetAutoClearG (AutoClearOptions* Opt, TimeHourMin* TimeAutoClear);
Description
Fills the variables Opt and Sets the station to Auto Clear for the weather parameters specified in Opt and the time specified in TimeAutoClear. If Auto Clear is not set then Opt and TimeAutoClear contain 0's .
Return Values
COM_ERROR if error
1 if successful


short int PutAutoClearG (AutoClearOptions* Opt, TimeHourMin* TimeAutoClear);
Parameters
AutoClearOptions Opt : To enable Auto Clear for any of the variables in this structure set the value of it 1 else set it to 0. To disable AutoClear set all the variables in Opt and TimeAutoClear to 0.
char Temp;
char Wind;
char DailyET;
char Rain;
char DegreeDay;
char SolarEnergy;
char Humidity;

TimeHourMin TimeAutoClear:
short int hour;
short int min;

Set the time of Auto Clear by filling in the values of hour and min.The range for hour is 0-23.
Description
Sets the station to Auto Clear for the weather parameters specified in Opt and the time specified in TimeAutoClear.
Return Values
COM_ERROR if error
1 if successful