Techincal documentation for Weatherlink Dll



Description of the files included with the Weatherlink 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.
weatherlink.dll Dll for communicating with WeatherMonitor stations. This should be copied to your project or the windows directory.
weatherlink.lib import library for the Dll When compiling a in C/C++ environment include this library in the link path and wetherlink.h as the header file for your source files.
weatherlink.h C/C++ header file containing the declarations for the Dll functions.
weatherlink.bas A Visual Basic .bas file containing the declarations for the Dll functions. Include this in your Modules section of your Visual Basic Project.
weatherlink.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 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
{
float outsideTemp;
float insideTemp;
short int insideHum;
int outsideHum;
float barometer;
int windSpeed;
int windDirection;
float totalRain;// Total rain on weather station.
};


struct DateTime
{
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 hiOutsideTemp;
float lowOutsideTemp;
float insideTemp;
float outsideTemp;
float barometer;
short int insideHum;
short int outsideHum;
float dewPoint;
float rain;
short int windSpeed;
short int hiWindSpeed;
short int windChill;
short int windDirection;
};



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 Dll Functions have been grouped as follows:

Initialization Functions

OpenCommPort OpenCommPortStr CloseCommPort SetUnits
GetUnits SetupRainCollector

Lowlevel Functions

GetSerialChar PutSerialStr PutSerialChar

General Functions

GetDllVersion GetBarometerTrend GetBarometer GetOutsideTemp
GetDewPt GetWindChill GetInsideTemp GetInsideHumidity
GetOutsideHumidity GetModelNo GetTotalRain GetDailyRain
GetYearlyRain SetCommTimeoutVal SendSensorImages GetSensorImage
StopSendingImages PutBarometer GetWindSpeed GetStationTime
SetStationTime GetArchiveInterval SetArchiveInterval PutTotalRain
GetWindDirection

Alarm Functions

GetTimeAlarm PutTimeAlarm SetDewPtAlarm GetDewPtAlarm
GetInsideLowTempAlarm GetInsideHiTempAlarm GetOutsideLowTempAlarm GetOutsideHiTempAlarm
PutInsideLowTempAlarm PutInsideHiTempAlarm PutOutsideLowTempAlarm PutOutsideHiTempAlarm
GetHiWindSpeedAlarm PutHiWindSpeedAlarm GetBarAlarm SetBarAlarm
GetLowWindChillAlarm PutLowWindChillAlarm GetLowInsideHumAlarm GetHiInsideHumAlarm
GetLowOutsideHumAlarm GetHiOutsideHumAlarm PutLowInsideHumAlarm PutHiInsideHumAlarm
PutLowOutsideHumAlarm PutHiOutsideHumAlarm

High Low Functions

GetHiLowTimesOutTemp GetHiLowTimesInTemp GetHiLowTimesOutHum GetHiLowTimesInHum
GetHiLowTimesDewPt GetHiInsideTemp GetLowInsideTemp GetHiOutsideTemp
GetLowOutsideTemp GetHiInsideHum GetLowInsideHum GetHiOutsideHum
GetLowOutsideHum GetHiDewPt GetLowDewPt GetLowTimesWindChill
GetLowWindChill GetHiTimesWindSpeed GetHiWindSpeed

Calibrate Functions

PutBarometerCal GetBarometerCal GetInsideTempCal PutInsideTempCal
GetOutsideTempCal PutOutsideTempCal GetHumCal PutHumCal
GetRainCal PutRainCal

Download Functions

GetNumberOfArchiveRecords Download GetArchiveRecord GetArchRecordNoByDate

Clear Functions

ClearHiInsideTemperature ClearLowInsideTemperature ClearHiOutsideTemperature ClearLowOutsideTemperature
ClearHiOutsideHumidity ClearLowOutsideHumidity ClearHiInsideHumidity ClearLowInsideHumidity
ClearHiDewPoint ClearLowDewPoint ClearHiwindSpeed ClearLowChill
ClearDailyRain ClearYearlyRain

Initialization Functions



short int OpenCommPort (short int comPort, int baudRate);
Parameters
comPort  number of the port to be opened.
baudrate  This can be 1200 or 2400.
Description Use this function to open the com port. CloseCommPort 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 OpenCommPortStr (char* comPort, intbaudRate);
Parameters
comPort a character string such as"COM1" Maximum size is 256.
baudrate This can be 1200 or 2400.
Description
Use either this function or OpenCommPort to open the com port. CloseCommPort
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 CloseCommPort();
Description
Closes the comport opened by OpenCommPort or OpenCommPortStr. 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 SetUnits(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.
SetUnits can be used to change the units in the Dll.
Return Values
1 if successful


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


short int SetupRainCollector(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 SetUnits .
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 GetSerialChar ();
Description
Retrieves a character from the serial port. The port should have been opened
with either OpenCommPort or OpenCommPortStr.
Return Values
-1 if error


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


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


General Functions



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


short int GetBarometerTrend ();
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


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


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


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


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


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


short int GetInsideHumidity();
Description
Returns the inside humidity.
Return Values
COM_ERROR if error


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


short int GetModelNo();
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 GetTotalRain ();
Description
Returns the total rain.
Return Values
COM_ERROR if error


float GetDailyRain ();
Description
Returns the daily rain. This value can be cleared using the function ClearDailyRain .
Return Values
COM_ERROR if error


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


short int SetCommTimeoutVal(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 SendSensorImages (short int n);
Parameters
n Request the weatherlink 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 GetSensorImage.
Ex:
SensorImage sI;
if ( SendSensorImages(1) != COM_ERROR)
  GetSensorImage(&sI);
Return Values
1 if successful
COM_ERROR if error


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


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


short int PutBarometer(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


float GetWindSpeed();
Description
Gets the current wind speed.
Return Values
COM_ERROR if error


short int GetStationTime (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 SetStationTime (DateTime* DateTimeStation);
Description
Sets the station time.
Return Values
COM_ERROR if error
1 if successful


short int GetArchiveInterval ();
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 PutTotalRain (float TotalRain);
Description
Sets the total rain to the value of TotalRain.
Return Values
COM_ERROR if error
1 if successful


short int GetWindDirection();
Description
Gets the wind direction in degrees.
Return Values
COM_ERROR if error


Alarm Functions



short int GetTimeAlarm (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 PutTimeAlarm (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 SetDewPtAlarm (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 GetDewPtAlarm();
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


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


float PutInsideLowTempAlarm (float lowtempAlarm);
Description
Sets the low inside temperature alarm.The alarm is cleared if the
value of lowtempAlarm is NOT_SET .
Return Values
COM_ERROR if error
1 if successful


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


float PutInsideHiTempAlarm (float hitempAlarm);
Description
Sets the high inside temperature alarm. The alarm is cleared if the
value of hitempAlarm is NOT_SET .
Return Values
COM_ERROR if error
1 if successful


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


float PutOutsideLowTempAlarm (float lowtempAlarm);
Description
Sets the low outside temperature alarm.The alarm is cleared if the
value of lowtempAlarm is NOT_SET .
Return Values
COM_ERROR if error
1 if successful


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


float PutOutsideHiTempAlarm (float hitempAlarm);
Description
Sets the high outside temperature alarm.The alarm is cleared if the
value of hitempAlarm is NOT_SET .
Return Values
COM_ERROR if error
1 if successful


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


short int PutHiWindSpeedAlarm (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 GetBarAlarm ();
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 SetBarAlarm (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


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


short int PutLowWindChillAlarm (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 GetLowInsideHumAlarm ();
Description
Returns the low inside humidity alarm
Return Values
COM_ERROR if error
NOT_SET if alarm is clear


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


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


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


short int PutLowOutsideHumAlarm (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 PutHiOutsideHumAlarm (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


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


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


High Low Functions



short int GetHiLowTimesOutTemp (DateTime* DateTimeHiOutTemp,DateTime* DateTimeLowOutTemp);
Description
Fills the DateTime structures with the high and low times. Use a function like
GetOutsideTemp 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 GetHiLowTimesInTemp (DateTime* DateTimeHiInTemp,DateTime* DateTimeLowInTemp);
Description
Fills the DateTime structures with the high and low times. Use a function like
GetInsideTemp to make sure that the inside temperature sensor is connected before
using this function.
Return Values
COM_ERROR if error
1 if successful


short int GetHiLowTimesOutHum (DateTime* DateTimeHiOutHum,DateTime* DateTimeLowOutHum);
Description
Fills the DateTime structures with the high and low times. Use a function like
GetOutsideHumidity 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 GetHiLowTimesInHum (DateTime* DateTimeHiInHum,DateTime* DateTimeLowInHum);
Description
Fills the DateTime structures with the high and low times. Use a function like
GetInsideHumidity to make sure that the inside humidity sensor is connected before
using this function.
Return Values
COM_ERROR if error
1 if successful


short int GetHiLowTimesDewPt (DateTime* DateTimeHiDewPt,DateTime* DateTimeLowDewPt);
Description
Fills the DateTime structures with the high and low times.
Return Values
COM_ERROR if error
1 if successful


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


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


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


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


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


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


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


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


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


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


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


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


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


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


Calibrate Functions



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


short int PutBarometerCal (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


float GetInsideTempCal ();
Description
Gets the inside temperature calibration.
Return Values
COMM_ERROR if error


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


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


short int PutOutsideTempCal (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 SetUnits function.
Description
Sets the outside temperature calibration on the station.
Return Values
1 if successful
COM_ERROR if error


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


short int PutHumCal (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


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


short int PutRainCal (short int calNumber);
Description
Sets the rain calibration number. This function is included for
completeness. The calibration is set when you use the function
SetupRainCollector. 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 GetNumberOfArchiveRecords();
Description
Returns the number of records in the archive memory.
Return Values
COM_ERROR if error


short int Download(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 GetArchiveRecord(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
Download which write the data to a file. This function must be used
immediately after the Download function. If another Dllfunction other than
the ones in the download group is called after Download then the Dll frees
the memory used for storing the downloaded data.
Return Values
returns 1 if successful


short int GetArchRecordNoByDate(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 Download to find out which records the user
needs to store in the database.
Return Values
-1 if error


Clear Functions



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


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


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


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


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


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


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


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


short int ClearHiDewPoint();
Description
Clears the high dew point.
Return Values
COM_ERROR if error
1 if successful


short int ClearLowDewPoint();
Description
Clears the low dew point.
Return Values
COM_ERROR if error
1 if successful


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


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


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


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