LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Request Data from an Internet Site

Hi

 

i am trying to request a service from a website but i dont know which VI i should use. 

I have to request the data in the address of the site itself and i am expexting data in the  xml format.

 

How should i proceed with it?

Somil Gautam
Think Weird
0 Kudos
Message 1 of 8
(3,705 Views)

If the service you describe is a web service, then you can use the Import Web Service function in LabVIEW to read the data and view it as a LabVIEW data type (cluster, array, etc...)

 

If it is NOT a standard web service, the quickest solution would probably be to use the DataSocket protocol to retrieve the data. You would need to parse the XML yourself...

Message Edited by Phillip Brooks on 11-16-2009 07:18 AM

Now is the right time to use %^<%Y-%m-%dT%H:%M:%S%3uZ>T
If you don't hate time zones, you're not a real programmer.

"You are what you don't automate"
Inplaceness is synonymous with insidiousness

Message 2 of 8
(3,688 Views)

It might be as easy as reading the website's page? In the data, the address is echoed, and you can parse out the information you need? Just a guess. The attached VI will read a web page.

 

 

Richard






Message 3 of 8
(3,669 Views)

Here is another possible soultion 

 

http://zone.ni.com/devzone/cda/epd/p/id/2743.

 

It has code to get the HTML code from a URL.

 

Once you have this, all you need to do is parse this code (String) for the data of interest

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 4 of 8
(3,641 Views)

Thanks all for the reply. Smiley Happy

 

This is the site from which i am trying to get the data. The input is in the form of an application id and address and in return i am going to get the coordinates (latitude & longitude) of the place.

 

There are many of toolkits in labVIEW for accessing internet. But i dont know from where should i start

 

Somil Gautam
Think Weird
0 Kudos
Message 5 of 8
(3,613 Views)

The solution suggested by Broken Arrow seems to be perfect for you.

You can use the same one for your application.

0 Kudos
Message 6 of 8
(3,536 Views)

I got it working with the example from the Yahoo web page. LV Version 2009f2.

 

1. The solution by BrokenArrow gives error 42 from the DataSocket Read.

 

2. The solution from the NI site is working with a little change. You have to set the property of IHTMLElement to OuterText. You will get the XML in the indiactor HTML Source Code.

 

Once you have the XML you can either parse the string by yourself or use the JKI EasyXML toolkit.

Waldemar

Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
Don't forget to give Kudos to good answers and/or questions
0 Kudos
Message 7 of 8
(3,527 Views)

Thanks all for your contribution towards the thread.

 

I got the solution from the NI itself.

 

There is an example  at this link

Somil Gautam
Think Weird
0 Kudos
Message 8 of 8
(3,471 Views)