LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

external GUI Manipulation

Solved!
Go to solution
Much much easier to setup and use AutoHotKey. Not sure why or what WTM is necesary... good luck.
0 Kudos
Message 21 of 26
(1,652 Views)

Richjoh, the Wireless Test Manager (WTM) software from Agilent has several variables that need controls in the automation, hence a simple autokey script wouldn't suffice as I'd be required to change it quite often. 

 

smercurio_fc, I installed the new autoIt, and initially, everything was working fine.  I took care of the controlclick node as well.  However, after closing labview, and restarting it, I encountered the same error.  The error always occurs in WTMRun.  I highlighted the execution and the error at WinExists said this: Error code 1,  Incorrect function in WTM Run.vi

I reselected the function at the invoke node again, but to no avail, I still get these errors, which still leads me to believe that for some reason, the reference inputted into the subVI WTM Run is not the same as before. 

 

Also, the reason I have so many local variables was to avoid having too many wires crossing on top of each others.  Is it really a disadvantage to use local variables?

0 Kudos
Message 22 of 26
(1,630 Views)
If it helps, I just did another highlighted execution, and probed the input ActiveX reference to WTM Run.  The value was 3010461696.  The probe of the ActiveX reference input into the WinExists node (in WTM Run) has a vlue of 0.  If I am not mistaken, these values should be the same. 
0 Kudos
Message 23 of 26
(1,623 Views)
Solution
Accepted by msharma

richjoh wrote:
Much much easier to setup and use AutoHotKey.

How so? The packages seem somewhat equivalent to me, as far as basic functionality is concerned. Both have an installer. Both have functions to control windows. Both have functions to activate buttons, send keystrokes, etc. There is, though, one major difference. AutoHotKey doesn't have a built-in ActiveX interface, and the COM library for AutoHotKey seems to have been cobbled together as an afterthought. 

 

Back to the main problem:

 

Yes, those values should be the same. It makes no sense to me that they're not the same.  Try this simple test: Place the WinExists node in your main VI. Make sure you wire an empty string to the strText input or you will get an error.

 

As for your question regarding local variables: Using local variables to avoid having too many wires cross is not a good reason to use local variables. If not used properly they can (and often do) lead to race conditions. Local variables have their use. Yours is not one of them. Smiley Wink

 

Additional code comments:

  • You main loop needs a wait function. Otherwise you have a greedy loop
  • In your "Start Test" VI I'm not sure what the first loop is doing, but it seems to me that the second loop should be a for-loop with the list of test plans being auto-indexed. If you want to stop the loop on an error use the for-loop conditional terminal.

Aside: I recall you mentioning that this software supposedly had a .NET interface, but you abandoned that because you said ".NET was proving to be a little difficult". What was your problem? I don't want to completely side-track you, but the .NET interface may be more reliable. 
Message 24 of 26
(1,612 Views)

smercurio_fc, it seems like that's done the trick.  Looks like it had more to do with the empty strings that I was inputting.  Before I was only inputting the "empty string constants" into terminals that required and input.  Now i've started putting in those same empty string constants into the ones that don't require an input and seems to work fine now.  I've also followed your advice and replaced my local variables to just wires from the source Smiley Happy

 

I am in the process of making the loop changes you have suggested.  Further, yes the software does have a .NET interface, but it became too difficult due to a lack of a proper programming guide from the software itself.  Hence I had no way of seeing what function I should call or intialize or create an object from, etc.  I also emailed Agilent and asked to get a programmer's guide, but they refused saying the function names were strictly for Agilent developer's.  So I figured for the time being, to have some automation working, I went the way of Auto-It.  But it would be nice to have the function calls of the WTM directly available on labview

0 Kudos
Message 25 of 26
(1,590 Views)

Yes I have to spell it out, the point is to not use ActiveX (my personal preferance) but if you must be all means .... USE AutoIt. Seems to work fine for your project. Happy coding. 🙂

 

I've work around ActiveX b4 and will do so in the future when possible to keep the coding simple as possible.

Message Edited by richjoh on 11-11-2008 05:31 PM
0 Kudos
Message 26 of 26
(1,583 Views)