03-04-2011 05:45 AM
Hi,
I just started using LabView and i read almost every post but i couldn't find what i am looking for. So if i run the Vi (picture_2) i get in innerHTML indicator structure of HTML for my example:
<TABLE cellSpacing=0 width="100%" align=left>
<TBODY>
<TR>
<TD><A href=".\View.htm" target=viewframe><B>Home</B></A> <B>|</B> <A id=START onclick="ExecuteAction('a.wsdl',1)" href="#">START</A> <B>|</B> <A style="BACKGROUND-COLOR: lightblue"</A>
<B>Version: 2.000<BR>Build: 20110110</B></TD>
<TD align=right></TD></TR></TBODY></TABLE>
Here is where i can't find a way to press button START with ActiveX function. I know how to simulate mouse position and mouse click but i need ActiveX function only.
I found in ActiveX this Onclick function but i just can't get it to work (what do i need to write in (???????) and if i need more data to properly control the function.
Can somebody please help me with my proble?
Thanks
Picture_1 - Example of web browser page
Picture_2 - source code
Solved! Go to Solution.
03-07-2011 04:48 AM
Hi TRM,
did you try the "submit" command?
Mike
03-07-2011 07:48 AM
Hi Mike,
thanks for your reply!
I don't exactly know what you mean with "submit" command (can you give me some example)?
I thought that what i get from the page (innerHTML indicartor) will help me to call START function easily but i don't know how. I found out that there is also one javascript running in the back
and there are also some functions in it :
var xmlhttp
try
{ // Firefox, Opera 8.0+, Safari
xmlhttp=new XMLHttpRequest();
}
catch(e)
{ // Internet Explorer
try
{
xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");
}
catch(e)
{
try
{
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
catch(e)
{
alert("Your browser does not support AJAX!");
}
}
}
function ExecuteAction(url,action)
{
var aref=null
var itemId = ""
switch(action)
{
case 1: itemId="START"; break;
}
aref = document.getElementById("START").style.backgroundColor="lightblue"
xmlhttp.open("POST", url, true);
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4) {
var xxml = xmlhttp.responseXML.documentElement............
.............
Is there some option for me to call this javascript and this function getElementById. I tried this way and i can't get it to work?
Thanks for reply
03-07-2011 09:19 AM
Hi TRM,
sorry, submit is only possible if you use forms in your html page.
Is the page you want to command online reachable?
Mike
03-07-2011 10:35 AM
Yes it is Mike!
TRM
03-11-2011 06:51 AM - edited 03-11-2011 06:52 AM
Hi TRM,
according to your code from Picture_2 you are dealing with ActiveX item from Microsoft Explorer.
So you should look at the documentation of this ActiveX at www.msdn.com especially:
http://msdn.microsoft.com/en-us/library/aa752127(VS.85).aspx
This issues is more connected with handling this ActiveX, that programming in LV. The programming for this ActiveX will be the same from LV, VB, C#, Python...
Kind Regards,
Jiri Keprt
NI Czech Republic
CLA, CTA
03-13-2011 11:33 AM - edited 03-13-2011 11:34 AM
Hi, Jiri Keprt
thanks for your replay! I will take a look at this link. If i understand you correctly you mean that i probably need to find something as the right syntax for my code to be working?
Kind Regards,
TRM
03-14-2011 01:30 AM
HI TRM,
Could you please add your VI to the post?
Thanks,
Siva
03-14-2011 02:49 AM - edited 03-14-2011 02:53 AM
HI Siva,
here is Vi!
P.S.
Just for the testing i use www.google.com in URL box, because innerHTML shows me the same type of functions (onclick) that i try to interact with my program.
Thanks,
TRM
03-15-2011 02:57 AM
Hi TRM,
simplified you can look at the ActiveX item like on library with functions. LV does only interface to this library.
F.e. Navigate method is described here. Look at you G code, that invoke node Navigate has the same parameters.
So, you have to find in the documentation of the ActiveX what is the function, you are searching for, what is the right syntax and what data you should provide as input.
The easiest way is to find example in visual basic, because the name of the functions are closest to LV.
Regards,
Jiri
CLA, CTA