12-09-2008 09:34 AM
Hello
I am currently doing a project where we I need to be able to control and view google earth from labview.
I have already seen and played with the "google earth - lv" - LLB file posted on the forum, which gives me the capacity to input GPS data etc to google earth; but I also need to be able to import the real-time image back from google earth - back to labview.
The image will form a "moving map" as part of an reconfigurable aircraft cockpit simulator I am creating.
Is this possible through Active X, embedded objects etc?
I am fairly new to labview and its full capabilities so any help would be much appreciated.
Cheers
Adam
12-10-2008 08:42 AM
Hi Adam,
Just to let you know I am looking into this for you. I think I am getting close but it is proving tricky. There is a way to get the OLE reference for the window and then embed it into programs. I have found an example to do this in C# and trying to convert this to LabVIEW. I think I am quite close just struggling to get the last bit working. Basically there is a type called stdole.Picture which I believe should accept the handle that GetMainHwnd and then we end up with a reference to put into an activeX image but I am struggling to get past a couple of errors at the moment but will let you know when I make any progress.
Regards,
12-14-2008 07:46 AM
Hi James
Thanks for your efforts and I look forward to hearing something from you in the near future.
Regards
Adam
12-15-2008 11:53 AM
Hi Adam,
I've done it! After quite a while tinkering I have managed to get the render window to embed although it is a slight work around. Normal LabVIEW controls don't have proper Window's window handles but ActiveX controls do. By putting down an internet browser control I could then use the Windows API to access the window handle for this control through a couple of dll calls and then embed the GE render window in this This effectively just moves the display from Google Earth to LabVIEW and you will notice that it has dissappeared from the Google Earth window. This means that you simply manipulate it in the same way with the libraries you have found. The code is a bit messy and wont handle resizing and I intend to sort this out tomorrow but for the time being here it is!
12-15-2008 05:43 PM
12-16-2008 06:49 AM
Hi,
I have commented the code and saved it back to 8.5 for you. It should be back compatible as the clever stuff is done by the Windows API rather than in LabVIEW. The reason this was tricky is that we needed a Window's window to place the render window in. Normal LV controls do not have their own window however initialised ActiveX windows do. So I have simply placed a web browser control that creates a window whos handle we can get and place the render window inside. It may be possible to create one from scratch in code but this would require much more work.
I tried to add code so that resizing the control would resize the view but could not get this working however resizing the Google Earth window also resizes the render view.
Hope this helps. In the near future I may try and pick this up again and improve on this e.g. add mouse functions and resizing but unfortunately do not have time now. However if you do make any improvements yourself please post it here as it seems there is a lot of interest in this.
Regards,
01-06-2009 05:53 PM
James
Thanks again for the VI code. I am finally trying to integrate my cockpit together but I am having difficulty running the labview 8.5 VI.
I get the following errors:
1. Invoke Node: Invalid Method
The method selected in the invoke node is invalid or no method has been selected. Right-click the invoke node and select a method.
2. Wire: Class Conflict
u have connected a refnum of one type to a refnum of another type and both types are members of some class hierarchy, but there is neither a simple up cast nor type cast between the two classes.
3. Front panel terminal "web browser": unwired front panel teminal
Appreciate any pointers on what i need to change.
Thanks
Adam
01-07-2009 03:16 AM
Hi Adam,
1 and possibly 2 sounds like you need to reselect the ActiveX class. To do this right click on the GE refnum and go to select ActiveX class >> browse. Then find the reference for GE Application. On my system I need to select Earth 1.0 from the top dropdown box and then you will need to select the ApplicationGE object that appears under this. This requires that Google Earth is already installed on the machine.
Number 3 is just a warning and will not prevent the program running.
I hope this solves the issue but let me know if not.
Regards,
01-07-2009 05:22 AM
Hi James
It seems the ActiveX was set incorrectly but I still get the same error even when I reset it.
I think that it maybe the invoke node but i dont fully understand what what its doing.
I have attached a screen shot to try and make it a bit easier to understand what is going off.
Thanks again
Adam
01-07-2009 05:47 AM
Hi,
It appears you have a slightler different version of the GE initialise VI than I do as it is giving an incorrect reference type out. Please try replacing this with the one attached.
Regards,