LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Create a string from HTML code

Hello to all,

 

What i have already create is a web browser integrate into a VI project and from this i can read some values like temperature or humidity. Also i have put a HTML window in order to take this values and to export to a string (for example to check these values from the browser and to be able to see in separate constat). Can you help how to do this with an example??

 

Thanks in advance

 

0 Kudos
Message 1 of 8
(3,823 Views)

What exactly are you doing?


Why are you using a web browser?

 

HTML code is a text, so I don't understand what you are trying to do.

 

 

0 Kudos
Message 2 of 8
(3,786 Views)

What i am trying to do is to monitor and control a temperature sensor. To do that i can put an IP address of the sensor to the browser. So what i have already done is to integrate a browser to Labview project. What i am trying to do now is to see in the HTML text that is the name of the sensor and to export the value of this to a separate string like a constant.

0 Kudos
Message 3 of 8
(3,783 Views)

Am I correctly understanding that you have embedded a web browser into your front panel, using ActiveX?  If the HTML is simple, it may be easier to use DataSocket (or the Internet Toolkit, if you have it) to retrieve the raw HTML, then parsing out the parts that you need.  If that's not an option, or the HTML is complex, it would help if you can provide your code, and a screenshot and the HTML source of the web page you're trying to read.

0 Kudos
Message 4 of 8
(3,761 Views)

Below i have attached the code and the HTML code from the sensor. If you have to recommend anything it will be usefull for me. I have another problem now. If you see in the HTML code you will see that i have three different values to export(temperature, humidity and dewpoint) but all of them have the same regular expression in order to request in my code. Do you know how is it possible to solve this problem because always i take the same temperature value for three of them.

 

Thanks in advance

Download All
0 Kudos
Message 5 of 8
(3,743 Views)

Why so complicated?  You need make only one DataSocket request for the HTML, not three, and there's no need for the variant functions.  Parse the HTML in a loop to get all three values as shown below.  I haven't tested this because I'm not willing to retype the text from your JPG screenshot just to see if it works, but if it's not right it's at least pretty close.

parse temp humid.png

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

Sorry but i cant see the picture. Is it possible to re-send again???

 

Thank you

0 Kudos
Message 7 of 8
(3,671 Views)

Not sure why you can't see the picture, but here it is as an attachment.

0 Kudos
Message 8 of 8
(3,635 Views)