07-14-2011 02:42 PM
I have a device with static IP connected to my laptop. From the laptop, I can access the device through internet explorer by typing in the device's static IP in the explore. When I see the device website, I need to click a few things, enter a string a box, and click save.
Is there a way to automate this in LabVIEW? Thanks!
Solved! Go to Solution.
07-14-2011 03:47 PM
Yes you can. You can use the HTTP Post and HTTP Get VIs in the Internet toolkit. You will have to look at the source of the webpage to figure out what the POST parameters are if any. If it only uses GET then you can look at the URL as you press buttons to figure out how to build the URL string.
07-17-2011 06:07 PM
I guess I have to get the internet toolkit then. Does the toolkit comes with the developer suite? I only have the professional version of labview, do I have to purchase it then? What kind of licensing is availabe for the toolkit?
07-17-2011 09:55 PM
I think the toolkit is a $1,000 addon. But that is a lot of money if all you want to do is a POST or GET. Those are very simple protocols. Some information here and here. This one is a very good tutorial.
It is probably worth the money if you need all the other features the internet toolkit offers.
Here is an example of how to create your own POST vi. You just build a properly formatted string, send it to the port the http server is listening on, then read the html results until the server closes the connection.
address is the server name, e.g., ni.com. It does NOT start with http://
URL is the part after the server name, e.g., /forums in http://ni.com/forums
body is the post parameters. e.g., firstname=steve&lastname=chandler
07-18-2011 11:34 AM - edited 07-18-2011 11:35 AM
I noticed an error in my code. The equal comparison for the error code should be a not equal comparison.
One more thing that might get you. For a POST the URL should end with a forward slash or you will get an error depending on the server configuration. In the example below that would be /forums/
07-18-2011 01:28 PM
Another option, if you're using Internet Explorer, is to embed it as an ActiveX object. You can then navigate to the web page, fill values into the form, and submit it. There are several examples posted on this forum such as:
http://forums.ni.com/t5/LabVIEW/How-to-fill-out-and-submit-a-web-form-using-LabVIEW/m-p/289527