LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can LabVIEW read a text file from the Internet?

Solved!
Go to solution

I'm using LabVIEW 8.5 and I'd like to read a one-line unformatted text file stored on a web site (example: www.text.com/test.txt).

 

I have found that I can't do that using the standard Read from Text File subVI; is there a better way?

 

Thank you for your help.

0 Kudos
Message 1 of 9
(5,718 Views)
Use the "Datasocket Read" function found under Data Communication -> Datasocket.  Wire your URL to Connection In, and an empty string to the type input.  The contents of the text file will be returned as the Data output.
Message 2 of 9
(5,702 Views)
Solution
Accepted by topic author Arrington

Don't forget to form the entire url (e.g. starting with ftp or http).

 

You might also have to append the string [text] to the end of the URL. Check the help.

 

Here's a snippet:

 

 

Message Edited by altenbach on 02-13-2010 08:01 AM
Message 3 of 9
(5,695 Views)

Hey, that works far better than what I had so far... this version gets rid of the quotation marks at the beginning and end of the data.

Thank you!

0 Kudos
Message 4 of 9
(5,688 Views)

Hi,

 

I tried to read a .txt file like you suggested, bu i get en error: 1181 Protocol not recognized by LV. The file i am trying to read is on a https:// . Can that be the problem? I am using LV 2010.

 

 

Jozef Lipták
0 Kudos
Message 5 of 9
(5,163 Views)

Datasocket does not support https, to the best of my knowledge.

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 6 of 9
(5,149 Views)

Is it possible somehow to read a .txt file from https:// ? Anybody an idea ? 🙂

Jozef Lipták
0 Kudos
Message 7 of 9
(5,129 Views)

The "easiest" will be to use ActiveX and access the Internet Explorer ActiveX interface for this.

 

I would love to point you to a library I did last year on Lavag.org, but it needs some more work to be of use to most people.

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 8 of 9
(5,116 Views)

LabVIEW 2010 has an SLL VI that can be used with the HTTP GET VI: http://zone.ni.com/reference/en-XX/help/371361G-01/lvcomm/http_client/

 

Can't say that I've ever tried this, so I don't know if it will work for you. Not sure which security protocol it uses, though.

0 Kudos
Message 9 of 9
(5,115 Views)