11-28-2011 11:01 AM
I am fairly new to LabVIEW and I am trying to make a VI that will be able to text me and let me know when a test is about to be done or if something has caused it to shutdown. My VI uses www.onlinetextmessage.com but I can't get it to click the Send Message button.
I can get it to insert text in the text fields. I just can get it to click send.
Can you help me?
Solved! Go to Solution.
11-28-2011 12:01 PM
This is just after a quick look at your code and the web page - I haven't tested it - but try changing the class of the type input to the last Variant to Data (the "send message" element) to IHTMLFormElement, then use the "submit" method instead of "click." Also, for sending an SMS from LabVIEW you might find it easier to send it as an email. Searching on this forum for "SMS email" will provide several examples.
11-28-2011 02:36 PM
I have tried making it a form and using submit but it always automatically reverts back.
11-28-2011 03:59 PM
@MoonMan wrote:
I have tried making it a form and using submit but it always automatically reverts back.
I don't know why it would "revert back" - maybe you're not choosing the correct ActiveX class? Try the attached modification of your VI.
11-29-2011 09:02 AM
Well it sure seemed like that should have worked but no luck. When I try to add the FormElement with submit in my VI after I wire in the reference wire it automaticaly changes to a regular Element. Then it wont run because submit is not an option for Element, I have to change the submit back to click.
I dont understand, it really seems like the click should work, and it seems like the submit should have also worked. Getting text into the different fields was easy enough.
If it helps people I have also attached the subVI that the VI calls.
11-29-2011 11:18 AM - edited 11-29-2011 11:23 AM
@MoonMan wrote:
Well it sure seemed like that should have worked but no luck. When I try to add the FormElement with submit in my VI after I wire in the reference wire it automaticaly changes to a regular Element. Then it wont run because submit is not an option for Element, I have to change the submit back to click.
I dont understand, it really seems like the click should work, and it seems like the submit should have also worked. Getting text into the different fields was easy enough.
Did you try my modified version? That uses IHTMLFormElement properly. If you then change the element name from "Send Message" to "txtmsg" (the name of the form), it appears to work - or at least, it pops up an advertising window in Internet Explorer (I didn't fill in any of the fields as I don't want to give out my phone number or email address to some random website, especially one that pops up advertising).
When you try to change to FormElement, what steps are you taking? Are you changing the type of the "type" input to Variant to Data? You'll need to right-click on that constant, Select ActiveX Class... and choose IHTMLFormElement.
As a LabVIEW style note, you should close all the ActiveX references you open. That means all the references (IHTMLFormElement, IHTMLElementCollection, etc) need a Close Reference when you're done with them.
Again, I think sending an email is a better way to send a text message from within LabVIEW, and for that matter, you might be able to find a better website for doing it. TMobile allows their subscribers to send SMS messages through their website and it appears that AT&T provides a similar service; Verizon provides a web page to send SMS to their users.
EDIT: by the way, the submit button is not a named element (it has a "Value" property but not a "Name" property) so you can't get a reference to it by name. If you probe the item output of the IHTMLElementCollection property node, you'll see it returns an empty variant, which is why "click" has no effect.