Research Ophthalmologist at the Jules Stein Eye Institute, UCLA
(I don't post my e-mail in public, but you can contact me via private message)
I regularly attend the following user groups:
(This round asks for getting and displaying information from a website.)
This is very simple example code to display a satellite image for a give location on the front panel.
The code contains three landmarks in Austin relevant to NI Week. It can easily be expanded by the programmer.
The program composes a simple URL based on the inputs and displays the resulting image.
Main Front Panel:
Main Block Diagram:
A version in LabVIEW 2010 and LabVIEW 8.2 is attached.
How is this one different from what is posted here:
http://decibel.ni.com/content/docs/DOC-7983
Sorry, I wasn't aware of the above quoted document. I did see a much earlier versions a couple of years ago somewhere on the UAV forum, though.
It's really much nicer, easy to understand how the example works, and it does not use Google's API.
However I don't see the data harvesting part... This example does nothing with data from website.
The other document and many other examples like it on the community use the Google Maps API and need an API key to use. Altenbach's uses url parsing to just interact with maps.google.com directly. Nice work!
peter_smith wrote:
This example does nothing with data from website.
I agree, but I don't think the problem description was that specific. It does get information from the web and displays it.
Initially, I had in mind to submit code to display realtime data from my solar panels connected to a TED 5000, but I decided to keep the URL private in order not to flood my connection and also for privacy and security reasons. Also, the mapping example had a few more features that I stripped out in the last iteration to keep the example focused. Distilling a programming concept to the bare essentials is important when writing a good coding example. This is not an application contest, IMHO.
To make it clear: what I wanted to say is the task in this round was to harvest data from a public site and display it in LV. Your code does not get/harvest any information not even data from any web site or network connection.
In fact it uses ActiveX. The ActiveX object gets the data, and it is the one displaying it, it is responsible for receiving, processing and displaying the data. LabVIEW code never ever "meets" or "sees" the data coming from the network.
By the way if you would have made a connection to the URL via DS or HTTP Client VIs, grab the image from Google by parsing some HTML and display it in a picture control, I did not say a word.
After all I don't want to say your code is not good, becuse it is good. It's straightforward, easy to understand and I'm pretty sure it is very useful for many users.
" This is not an application contest, IMHO. ", even though each and every entry was an application.
Dear Altenbach,
Thank you for this example - your code is very elegant. It still works like a dream despite changes Google have made since 2010, if you change the url root to 'http://maps.googleapis.com/maps/api/staticmap?'.
However, I am struggling to understand why it always prompts me to save an image when I first open the vi. (See below screenshot.) This happens before I even click 'run'.
I am guessing it is something to do with IwebBrowser2 and tried using 'property browser' to set Silent=true (which should prevent dialogue boxes), but on reopening the download prompt still appears.
It is the same unsolved problem as in the thread https://forums.ni.com/t5/LabVIEW/IWebBrowser2-load-last-content-without-execution/td-p/3314457 .
Do you experience this also? And do you know how I can prevent the download prompt? Any advice would be much appreciated.
Best regards,
Leah
Dear Leah Edwards,
I can't not run this example. Please help me. I changed the URL