Author Topic: Question for Davis VP2 expert.  (Read 5750 times)

0 Members and 1 Guest are viewing this topic.

Offline wuhu_software

  • Forecaster
  • *****
  • Posts: 688
    • WUHU Software Yahoo Group
Question for Davis VP2 expert.
« on: February 28, 2007, 11:37:59 AM »
Can someone tell me if the VantagePro2 DLL 2.3 can be used to communicate directly with the console or does this DLL talk to the Weatherlink application?

Thanks in advance.

Offline SLOweather

  • Administrator
  • Forecaster
  • *****
  • Posts: 2731
    • http://www.sloweather.com
Re: Question for Davis VP2 expert.
« Reply #1 on: February 28, 2007, 02:30:21 PM »
Nothing that I know of talks directly to the console, except the logger and the firmware updater. Everything else needs to communicate with the console via the data logger.

Offline wuhu_software

  • Forecaster
  • *****
  • Posts: 688
    • WUHU Software Yahoo Group
Re: Question for Davis VP2 expert.
« Reply #2 on: February 28, 2007, 05:43:06 PM »
Quote from: "SLOweather"
Nothing that I know of talks directly to the console, except the logger and the firmware updater. Everything else needs to communicate with the console via the data logger.


Does the WeatherLink software need to be running in order to communicate with the logger?

Thanks.

Offline racenet

  • Forecaster
  • *****
  • Posts: 1288
    • NH Weather Data
Re: Question for Davis VP2 expert.
« Reply #3 on: February 28, 2007, 07:43:25 PM »
Quote from: "wuhu_software"
Quote from: "SLOweather"
Nothing that I know of talks directly to the console, except the logger and the firmware updater. Everything else needs to communicate with the console via the data logger.


Does the WeatherLink software need to be running in order to communicate with the logger?

Thanks.


Some type of weather software needs to be running. Either weatherlink or third party software you decide to use, such as Virtual Weather Station (VWS), Weather Display (WD) and several other available packages.


Bob
www.theamericanflagstore.com - The American Flag Store



www.nhweatherdata.com - NH Weather Data

Offline dalecoy

  • Forecaster
  • *****
  • Posts: 4588
    • Lee's Summit, MO
Re: Question for Davis VP2 expert.
« Reply #4 on: March 01, 2007, 10:13:40 PM »
Quote from: "racenet"
Quote from: "wuhu_software"
Quote from: "SLOweather"
Nothing that I know of talks directly to the console, except the logger and the firmware updater. Everything else needs to communicate with the console via the data logger.


Does the WeatherLink software need to be running in order to communicate with the logger?

Thanks.


Some type of weather software needs to be running. Either weatherlink or third party software you decide to use, such as Virtual Weather Station (VWS), Weather Display (WD) and several other available packages.


Bob


**OR** you can write your own software, using the VPdll_32.exe package, or write your own.  In any case, you'll be communicating with the data logger.

Offline jaded

  • Member
  • *
  • Posts: 32
    • http://home.comcast.net/~jadeters/Weather.htm
Re: Question for Davis VP2 expert.
« Reply #5 on: March 02, 2007, 10:23:31 PM »
Quote from: "wuhu_software"
Quote from: "SLOweather"
Nothing that I know of talks directly to the console, except the logger and the firmware updater. Everything else needs to communicate with the console via the data logger.


Does the WeatherLink software need to be running in order to communicate with the logger?

Thanks.


The simple answer is no.  You can use a third party package such as VWS, meteo or other software to communicate with the console via the logger; or you can write your own.  It's just a connection via serial port, and Davis documented the protocol on their web site.

That said, it's not a particularly easy protocol to write yourself, as you'll probably want both a live data stream as well as responses to particular data queries.  Davis does provide a communications DLL that might make your task easier.

One thing to keep in mind is that if you run other software, the Davis software will not be able to open the serial port while the other software has it open.  This means you won't be able to use the Davis software while your other software is running (without some other special tricks.)

Offline wuhu_software

  • Forecaster
  • *****
  • Posts: 688
    • WUHU Software Yahoo Group
Re: Question for Davis VP2 expert.
« Reply #6 on: March 03, 2007, 10:41:18 AM »
Quote from: "jaded"
Quote from: "wuhu_software"
Quote from: "SLOweather"
Nothing that I know of talks directly to the console, except the logger and the firmware updater. Everything else needs to communicate with the console via the data logger.


Does the WeatherLink software need to be running in order to communicate with the logger?

Thanks.


The simple answer is no.  You can use a third party package such as VWS, meteo or other software to communicate with the console via the logger; or you can write your own.  It's just a connection via serial port, and Davis documented the protocol on their web site.

That said, it's not a particularly easy protocol to write yourself, as you'll probably want both a live data stream as well as responses to particular data queries.  Davis does provide a communications DLL that might make your task easier.

One thing to keep in mind is that if you run other software, the Davis software will not be able to open the serial port while the other software has it open.  This means you won't be able to use the Davis software while your other software is running (without some other special tricks.)


That brings up an interesting question, whether or not the Weatherlink software itself is using the DLL to communicate to the logger. If it is, and the DLL is properly writen, then multiple applications could access the logger at the same time.

My guess is that it would be too convenient and obvious, so this is probably not the case.  :roll:

Offline SLOweather

  • Administrator
  • Forecaster
  • *****
  • Posts: 2731
    • http://www.sloweather.com
Re: Question for Davis VP2 expert.
« Reply #7 on: March 03, 2007, 02:58:28 PM »
The easy way is to use Tinplate's excellent VirtualVP program to interface up to 8 apps to the VP2 (4 via serial, 4 TCP/IP).

Offline jaded

  • Member
  • *
  • Posts: 32
    • http://home.comcast.net/~jadeters/Weather.htm
Re: Question for Davis VP2 expert.
« Reply #8 on: March 07, 2007, 12:24:41 AM »
Quote from: "wuhu_software"

That brings up an interesting question, whether or not the Weatherlink software itself is using the DLL to communicate to the logger. If it is, and the DLL is properly writen, then multiple applications could access the logger at the same time.

My guess is that it would be too convenient and obvious, so this is probably not the case.  :roll:

No, they don't use the DLL itself in their code.  Even if they did, the DLL is just a communications wrapper, again accessible by a single program at a time.  My real hope is that they will someday create an NT service with a COM interface that will provide access to the data in a shared fashion, firing events as data arrives, doing the logging, that sort of thing.  Then, you could run their WeatherLink as a front end when you want to see the data, or you could write your own code to display it; maybe a little weatherbug-like tool tray application, trigger alarms, operate water sprinklers, or whatever.

The serial nature of the communications protocol pretty much prevents two programs from cooperatively sharing the port -- how would one program know if the data is what it requested?  Worse, what would happen if both programs sent conflicting requests to the VP? One might be asking for a dump of the archive, while the other requests the real time data, or both could ask for dumps, etc.  But if the data were available on a COM interface, it could be constantly requesting and receiving everything, and providing it to all consumers in a thread-safe fashion.  And as a service, it also would run constantly in the background, not requiring me to stay logged in just to keep my web site up-to-date.

VirtualVP is one way to sort-of accomplish the goal.  It allows one program to act as the "host", doing the data requests, downloading and logging the data, etc.  So you could run Weatherlink as this "main host", but open another serial port to read the data in a different app (like VWS or meteo.) I'm not sure if VirtualVP does any "lockout" to prevent collisions.

Offline wuhu_software

  • Forecaster
  • *****
  • Posts: 688
    • WUHU Software Yahoo Group
Re: Question for Davis VP2 expert.
« Reply #9 on: March 07, 2007, 08:05:03 AM »
Quote from: "jaded"
Quote from: "wuhu_software"

That brings up an interesting question, whether or not the Weatherlink software itself is using the DLL to communicate to the logger. If it is, and the DLL is properly writen, then multiple applications could access the logger at the same time.

My guess is that it would be too convenient and obvious, so this is probably not the case.  :roll:

No, they don't use the DLL itself in their code.  Even if they did, the DLL is just a communications wrapper, again accessible by a single program at a time.  My real hope is that they will someday create an NT service with a COM interface that will provide access to the data in a shared fashion, firing events as data arrives, doing the logging, that sort of thing.  Then, you could run their WeatherLink as a front end when you want to see the data, or you could write your own code to display it; maybe a little weatherbug-like tool tray application, trigger alarms, operate water sprinklers, or whatever.

The serial nature of the communications protocol pretty much prevents two programs from cooperatively sharing the port -- how would one program know if the data is what it requested?  Worse, what would happen if both programs sent conflicting requests to the VP? One might be asking for a dump of the archive, while the other requests the real time data, or both could ask for dumps, etc.  But if the data were available on a COM interface, it could be constantly requesting and receiving everything, and providing it to all consumers in a thread-safe fashion.  And as a service, it also would run constantly in the background, not requiring me to stay logged in just to keep my web site up-to-date.

VirtualVP is one way to sort-of accomplish the goal.  It allows one program to act as the "host", doing the data requests, downloading and logging the data, etc.  So you could run Weatherlink as this "main host", but open another serial port to read the data in a different app (like VWS or meteo.) I'm not sure if VirtualVP does any "lockout" to prevent collisions.


A simple DLL could also do the trick. DLLs can be thread safe, start their own internal threads (say a main communications thread), control the orderly communication with the device, or just about anything else. A DLL does not necessarily have to be a simple wrapper (although it sounds like that is what Davis has created).

COM might be nice for accessing from multiple development environments. It would certainly be nice for VB programmers.

I will have to investigate the Virtual VP. It seems that is the best solution for multiple applications wanting to access the device.

Thanks.

Offline tinplate

  • Forecaster
  • *****
  • Posts: 368
    • http://www.softwx.com/products.html
Re: Question for Davis VP2 expert.
« Reply #10 on: March 16, 2007, 04:39:53 PM »
The problem with multiple programs accessing the the Console is not just problem inherent in serial communication (it's designed to have just two nodes, or "ends"). The problem is the design of the VP communications protocol itself. The protocol is not just a simple request/receive. Some of the console commands put the console into modes that have long lasting effect. The two main examples are the LOOP command (i.e. LOOP 200 means send me 200 live data packets, each one sent at about 2 second intervals), and DMPAFT (send me a bunch of archive data). These commands take time to execute. While DMPAFT is executing, live data isn't being sent. If the console is sending LOOP data, interrupting it to send a different command stops the loop data. That is why using a program such as GPSGate which just splits the serial stream results in confusion. If two programs are talking to the console, they rightly expect they are the only one. And when they send a command such as LOOP 200, they expect 200 loop packets back. If the second program sends its own command and interrupt that, the first program can get screwed up (why did I just get data for a command I didn't send?).

VirtualVP solves this by being the only program connected to the console. It gets loop data all the time, and when a program sends some other console command, VirtualVP slips it quickly to the console and then continues the loop data. The connected programs only get the reponse they ask for, so from their standpoint they think their the only ones connected the console. The archive data is handle by keeping it cached within VirtualVP so when a program requests it, VirtualVP responds with the data out of its cache instead of having to interrupt the console from providing timely live data packets.

Earlier posters are correct. The dll is just a wrapper around the communications protocol. Any program that can send and receive via a serial port can talk to the console. The dll doesn't do anything magic. In fact, you can even open up the old Windows terminal program and interactively "talk" to the console using that. I've done it many times while poking around the console's capabilities.

Steve