Discussion:
Davis Instruments Vangage Pro Weather Station and LabVIEW
(too old to reply)
jharbert
2007-04-03 19:40:09 UTC
Permalink
I am developing a VI for communication with the Davis Instruments
Vantage Pro Weather Station in LabVIEW.  I need to be able to take the
current weather conditions off of the weather station and display them
in a VI.  The Weather Station will be connected via RS232 to a Compact
Fieldpoint.  Currently I am planning on sending the request command
over the serial (through VISA?), which would return a signal containing
all of the the needed data (which could be parsed within LabVIEW). 
Does anyone know either how to do this or a better way to communicate
with the Weather Station?

Thank you,
Joshua
AnalogKid2DigitalMan
2007-04-03 20:40:07 UTC
Permalink
Cool. I have had a wireless Monitor II for the past decade but have never bothered to interface LabVIEW to it.
You might be able to use a 3rd party program to intercept/monitor the communication data between the VantagePro and the PC com port while running the Davis software. That would give you insight into what data is sent between the two and then use VISA functions to create a driver in LabVIEW to do the same.
Maybe a call to Davis, you never know, they might supply you with the protocol and command/data set.
Good Luck!
AnalogKid2DigitalMan
2007-04-03 22:10:08 UTC
Permalink
Joshua:
Nice find on the Davis site, I haven't been there in years....
Looks like you have a couple options.
1. They have documented the serial command set and data format. You can look in LabVIEW help and search examples for serial communication (like Basic SerialReadandWrite). Set up the COM port accordingly and send a simple command and read the response as a test. To create a driver, at least in LabVIEW 8.2, under Tools/Instrumentation/CreateInstrumentDriverProject- use a GeneralPurpose (Message Based) for a source driver. I never have used it, but it may get you quicly started on the path. You can also probably use Windows Hyperterminal first as a sanity check before trying LabVIEW.
2. They also have a nice dll library that appears to be well documented. Within LabVIEW, you can make calls to the dll and get data back. As long as it was written in C osr stdcall, you can use the CallLibraryFunctionNode function. There is a section in the LabView Help- Calling Code Written in Text Based Languages that describes how to do this.
Hope this helps
-AK2DM
Edit: I just saw you are using Compact Fieldpoint- Not sure what that is and how it may affect use of the options above.Message Edited by AnalogKid2DigitalMan on 04-03-2007 03:05 PM
Ravens Fan
2007-04-06 00:10:07 UTC
Permalink
You should have no problems adapting this to fieldpoint.
 
You will need to make a project, and add your fieldpoint device as a target.  Add the VI under the fieldpoint target in the project explorer tree.  You can open the VI from there.  Set your com port according.  When you press run, it will deploy the VI to the compact fieldpoint and start running it from there.
Ravens Fan
2007-04-17 01:10:09 UTC
Permalink
Which compact Fieldpoint controller do you have?
I have a cFP-2120 which has 4 serial ports.  Com1 is a 9-pin D-sub RS-232.  Com2 and 3 are also RS-232, but use an RJ-50 connector.  Very similar to an RJ-45 but have 10 pins.  Com4 is an RS-485 with the RJ-50 connector.
You say you are using Com2.  So does that mean you are using an RJ-50 connector?   I had to buy special cables from NI to be able to use the RJ-50 as I could not find those connectors commercially available to make my own cable.  Perhaps you have a wiring problem with the pins on the connector, or if you are using a D-sub, perhaps you are actually on Com1.  Of course check the settings for baud, parity, and stop bits.
Just some thoughts.
LeoArcu
2007-11-27 12:10:08 UTC
Permalink
Hi! i´ve been trying to interface a Davis Vantage Pro with LabVIEW. I´m using the DLL that they provide in their website and calling those functions in my program using the Call Library Function Node. The program works very good until I try to leave, then it throws a memory.cpp error. I think I might be doing a bad access to the functions in the DLL but I don´t know how to fix it. Does anyone know?
 
Thanks
Leo
 
 
Kevin_H
2007-11-28 22:40:05 UTC
Permalink
Hi Leo,
 
Thank you for contacting National Instruments.  Memory.cpp errors are sometimes difficult to isolate.  You said the program works until you try to leave.  How long is the program running before the error occurs?  Does the error seem to always occur at the same time?  Also, is there any more information that comes with this error? Error line number perhaps? 
 
It sounds like you might have a memory leak issue.  I look forward to hearing back from you.
 
Regards,
 
Kevin H
LeoArcu
2007-12-05 12:40:10 UTC
Permalink
Hi! thanks for answering that fast. The error message that appears says:





Fatal Internal Error: "memory.cpp", line 342



It appears when I close the LabVIEW, not when I finish the application.
The DLL that I´m using makes a serial port access, and also it reserves some space in the memory to load the data from the station. There is no function to release that space, I think the problem might be related to that.
I´m attaching the code to this message, and the DLL.
 
Someone said not to leave the program... well this program might never end because it´s a kind of datalogger, but I don´t know if after a lot of loops from the program it will throw the same error.
 
Thanks
Leo


Panel Davis.zip:
http://forums.ni.com/attachments/ni/170/288499/1/Panel Davis.zip
Kevin_H
2007-12-06 23:40:04 UTC
Permalink
Hey Leo,
I think you are on the right track.  Any program that continously allocates new memory will eventually run into some memory problems, and that is most likely the cause of your error.  I would definitely see if you could rewrite part of that dll to better manage memory in your application.
Regards,
Kevin H

Loading...