LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Lat Long -> TimeZone error 66

There is a web service that returns the timezone for latitude, longitude coordintes at http://www.earthtools.org/webservices.htm#timezone that I would REALLY like to be able to use; however, I can't get it to work.  For example, http://www.earthtools.org/timezone/40.71417/-74.00639 which is a coordinate for NYC returns XML data including <offset>-5</offset> for EST. 
 
The above URL works just fine in IE or Firefox; however, I can't figure out a way to make it work with LV.  I'm using 8.5.1 on XP.  Using the Internet Toolkit, I get error 66 and using datasockets I get error 42 (although I suspect that that is supposed to be 0x42 = 66).  Error 66 is "The network connection was closed by the peer."
 
I had the thought that perhaps the web service requires a cookie, but I can't find one on for that site on my machine.
 
I've attached a simple example VI to illustrate.  Can anyone figure out how to make this work?
 
Thanks,
 
Travis
0 Kudos
Message 1 of 3
(3,094 Views)
The reasons of the why are dark, but you should append [text] to your url:

For further info see LAVA.
Here's the output from the Datasocket:

<?xml version="1.0" encoding="ISO-8859-1" ?>
<timezone xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.earthtools.org/timezone-1.1.xsd">
  <version>1.1</version>
  <location>
    <latitude>40.71417</latitude>
    <longitude>-74.00639</longitude>
  </location>
  <offset>-5</offset>
  <suffix>R</suffix>
  <localtime>8 Jun 2008 09:35:00</localtime>
  <isotime>2008-06-08 09:35:00 -0500</isotime>
  <utctime>2008-06-08 14:35:00</utctime>
  <dst>Unknown</dst>
</timezone>



Ton



Message Edited by TonP on 06-08-2008 04:31 PM

Message Edited by TonP on 06-08-2008 04:37 PM
Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 2 of 3
(3,082 Views)

Thanks Ton, that did the trick.  I have no idea how I was supposed to figure that out, but it works.

BTW, I tried adding the same [text] string to the DataSockets call to google in my uploaded VI, and it made LabVIEW crash (repeatably).  I guess it isn't a general solution.

Travis

0 Kudos
Message 3 of 3
(3,059 Views)