PROGRAMMER'S REFERENCE LIBRARY DOS/WINDOWS VERSION 4.1 ReadMe

Updated: 10-8-98

The Programmer's Reference Library is provided free of charge and "as is." Davis Instruments will provide support via e-mail at support@davisnet.com. We will not answer questions over the phone. If you have a question, please consult the files contained in this package, especially the frequently asked questions in the file "prdfaq.txt". The Programmer's Reference Library information will be periodically updated on our bulletin board and web site; if you cannot find answers to your question in "prdfaq.txt," check the web site for an updated version. If you still cannot find answer(s), you may submit your questions by e-mail. Please explain in as much detail as you can what you are having difficulty with and if possible include a copy of the source code section that is in question. We will do our best to answer your questions within a week. If the questions you have are lengthy or complicated, Davis Instruments is available for PAID support in one hour segments at $100.00 per hour.

The Programmer's Reference Library provides the information and materials needed to write custom applications for Davis weather stations and the WeatherLink. The current version of this documentation supports all of the weather stations manufactured by Davis as of 1/98 (these are: the Monitor II, Wizard II & III, Perception II, GroWeather, Energy, and Health stations). Also included in the Programmer's Reference Library are a pair of DLL's ("weatherlink.dll" and "groweather.dll") which can be used in custom applications.

Documentation is provided in both MS-Word 6.0 (.doc) and ASCII (.txt) file formats. The information contained in one format of a particular file is identical to the information in the other format. Please read the Technical Reference ("techref.txt" or "techref.doc") file before doing any programming. The Technical Reference describes each command the WeatherLink data logger understands, which are the same commands our WeatherLink Software uses. It also contains many tips and examples of how to use the commands effectively. Included are a series of "C" and Basic source code examples using the WeatherLink commands. We've included source code we have used to exercise the interface. With careful study it should answer questions the technical reference does not. The included source code makes calls to the commercial package "C ASYNCH MANAGER 5.0", and can not be used to make an .exe file without this library.

If you are programming in BASIC, look at the Visual Basic code (16 bit) in "comm.bas" which illustrates how to use the "LOOP" command. We suggest if you are after real-time weather data that you use the "LOOP" command.

The commands outlined in the Programmer's Reference Library, which are a combination of ASCII and binary data, can be sent out any RS232 serial port and used to extract from the weather station any data that the station displays (current conditions, highs, lows, etc.) as well as archive data from the WeatherLink.

Routines for driving the serial port are contained in the "weatherlink.DLL" and "groweather.DLL" files. If you do not use the DLL files, you must have enough knowledge of serial communications to be able to drive the serial port yourself, or use a third-party communication library to do it for you.

NOTE: Davis Instruments is not responsible for any damages resulting from use or misuse of the information on this disk.


What will this disk do for me?

This library contains the necessary information to enable a programmer to write custom programs using Davis weather stations and the WeatherLink. This consists of libraries documenting commands, source code example, and a pair of DLL's which may be used to communicate with the WeatherLink or the GroWeatherLink.


What does this disk contain?

readme.txt - This file contains an introduction and explanation of the contents and organization of the Programmer's Reference Library. The contents are the same as the contents of this page.

LinkDLL - The directory LinkDLL contains the file "weatherlink.DLL" a 32-bit DLL (version1.02), and related files. The Weatherlink DLL can be used on Windows 95, 98 and NT platforms. It can communicate with Monitor II, Wizard III, II, IIs and Perception stations. View the "readme.txt" file in the directory for more information on using the DLL.

GrowDLL - The directory GrowDLL contains the file "groweather.DLL" a 32-bit DLL (version 1.0), and related files. The GroWeather DLL can be used on Windows 95, 98 and NT platforms. It can communicate with the GroWeather station. View the "readme.txt" file in the directory for more information on using the DLL.

techref.txt - This file contains a technical description of the RS232 interface. It describes the primitive commands upon which all higher level functionality must be built. It also contains may examples of "C" code fragments to illustrate how the commands are used. In addition, this file contains tables of the station and link memory addresses. techref.doc - MS Word version of techref.txt

appendix.txt - This file contains descriptions of coded numerical and bit-mapped values. appendix.doc - MS Word version of appendix.txt

prdfaq.txt - This file contains short answers to may commonly asked questions. prdfaq.doc - MS Word version of prdfaq.txt

database.txt - This file contains a description of the database file formats created by the PC Link, GroWeather WinLink, Energy WinLink, and Health WinLink software sold by Davis Instruments. database.doc - MS Word version of database.txt

commands.c - This source was included to give you a source code reference of the commands in action.

serial.c - Example "C" interface to the chip.

serial.h - Header file for serial.c functions.

ascii.c - Converts a binary weather data file to ascii form.

ccitt.h - Tables used for the CRC checksum calculation.

thitable.h - A table for calculating Temperature- Humidity Index from temperature and humidity data.

For Visual Basic Programmer's look at the source code in COMM.BAS which illustrates how to use the LOOP command and decode the data packet sent back from the weather station.

COMM.BAS - BASIC source code using loop command. Visual Basic programmers should look at the source code in COMM.BAS which illustrates how to use the LOOP command and how to decode the data packet sent back from the weather station.