LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to embed web browser?

Hi - I would like to embed a web browser in a LabView VI. Specifically, what I am trying to do is to plot GPS coordinates to Google Maps. What this would involve is taking in the coordinates from the serial port, then calling some javascript functions in a web browser to plot them. Javascript functions can be called by passing them to the address bar. For example, you can type this into your address bar and hit enter:

javascript:alert("hello world");

So really - all I need is an embedded web browser (that shows up in my VI, not in a seperate window) that I can change the URL of. Can anybody suggest how to do this? I only need Windows XP compatibility, and I am using Labview 8.2.

Thanks!

-Mike
0 Kudos
Message 1 of 4
(6,926 Views)
Mike -

You can do this with an ActiveX container(in the controls palette) and either the Internet Explorer or Firefox ActiveX control.  I assume the properties exported from either of these controls will allow you to send your JavaScript command as the URL, but have never tried it so I don't know for sure.

J

Jason King
LabVIEW R&D
National Instruments
0 Kudos
Message 2 of 4
(6,919 Views)

Here is a simple example:

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

0 Kudos
Message 3 of 4
(6,905 Views)
Hi - I tried to use the above example as a model for how to do this, but I'm having, well, odd results. Please see the attached block diagram so that you can see what I'm doing. Also - ignore all the serial code - it is related eventually (once I get this web interface working) - but right now it is irrevelant. All I'm trying to do is set it up so that I can click on the boolean button and have it go to the address in the URL control. But like I said - the behavior I'm seeing is very, very odd. Specifically - it seems the browser window often captures keystrokes, even when the url control has focus. For example, here is an example of oddness:
 
Start VI. It is at www.google.com. URL control says "www.google.com". I can put the cursor in the URL control and hit backspace, but it has no effect. I can highlight the whole thing and hit backspace and it will delete it. Now let's say I leave it at www.google.com and hit the boolean button. Now if I try typing in the URL control - I can type there - but the same typing shows up in the search bar in the google page!! What is going on?! This behavior has me very confused. 
I have attached the block diagram as well as the whole vi for anybody's inspection. I would really, really appreciate it if anybody could take a look at this and see if they have any ideas as to what I'm doing wrong.
 
Thanks!
 
-Mike
Download All
0 Kudos
Message 4 of 4
(6,850 Views)