Sharon_ Posted February 24, 2011 Report Share Posted February 24, 2011 Hi friends, I am developing a LV application where I load webpages in Labview and I test the LED/Slider bars of the webpages. I can change the values of LEDs and other indicators thru' a simulator. But the changes are not reflected in the webpage because my Labview browser is loading the previous page(from memory..?!). I tried 'Refresh' invoke property- didn't work. Is there a way to clear memory and load the webpages? Thanks, Sharon Quote Link to comment
Mr Mike Posted February 24, 2011 Report Share Posted February 24, 2011 You can append a random variable to the URL. But first a quick primer on URLs: "http://" is the protocol "www.example.com" is the host name (the computer the web page is on) "/some/place.html" is the path "?random=SomeRandomValue" is the query string The query string is a question mark (?) followed by a set of "variable=value"s, separated by ampersands (&). So if your URL is http://www.a.com/b.html you could make it http://www.a.com/b.html?rand=1234. If your original URL already had a query string (e.g. http://www.a.com/b.html?a=1) then you'd use http://www.a.com/b.h...?a=1&rand=1234. That will force the page to reload because the browser recognizes that could be a different page.. Just remember to use a different random each time. That's a common problem in a number of programming situations not just limited to LabVIEW. The HTTP protocol has metadata saying how long to keep a cached copy around and also metadata to say if a file is newer than another copy. I'm not sure if your web server isn't sending that data, it's sending the wrong data, or LabVIEW isn't respecting that. 2 Quote Link to comment
Sharon_ Posted February 25, 2011 Author Report Share Posted February 25, 2011 You can append a random variable to the URL. But first a quick primer on URLs: "http://" is the protocol "www.example.com" is the host name (the computer the web page is on) "/some/place.html" is the path "?random=SomeRandomValue" is the query string The query string is a question mark (?) followed by a set of "variable=value"s, separated by ampersands (&). So if your URL is http://www.a.com/b.html you could make it http://www.a.com/b.html?rand=1234. If your original URL already had a query string (e.g. http://www.a.com/b.html?a=1) then you'd use http://www.a.com/b.h...?a=1&rand=1234. That will force the page to reload because the browser recognizes that could be a different page.. Just remember to use a different random each time. That's a common problem in a number of programming situations not just limited to LabVIEW. The HTTP protocol has metadata saying how long to keep a cached copy around and also metadata to say if a file is newer than another copy. I'm not sure if your web server isn't sending that data, it's sending the wrong data, or LabVIEW isn't respecting that. Hi Mike, Yeah...it works.. Yes it does. Thank you very much... -Sharon P.S: for other junior Labview developers. the '?' symbol could also be followed by ".html"-(for eg: http://abc.com/read.cgi?page=templates/admin_masterconfig.html&Sharon=12) in that case we will use only '&' symbol like "&random=xxx" not one more '?random=xxx'- it will show an error. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.