10-07-2008 11:35 AM
Hi,
Looks like you are on a better path, but if you do end up resorting to simulated key strokes you may find the attached VI useful for trying out combinations.
Cheers,
Blue
10-07-2008 03:03 PM
Msharma,
after going down a similiar path trying to use windows API, i found a much simplier way to perform automation. U can use your "System Exec.vi" located in the communication pallette to run Autohotkey scripts or the like. Download Autohotkey from there website.
In a nutshell, I installed Autohotkey. Record a script (aka macro) using mouse and keyboard clicks. Autohotkey has 2 exe, one is for recording the other is for running. Once you save your script file, you need to set the OS default file type to the AutoHotKey run (not record) assuming you have admin rights for all user accounts.
When its time to run the automation part, I send a system exec command to run the Autohotkey script. from that point on its automated... .
regards,
11-06-2008 08:58 AM
Thanks for the help everyone. .NET was proving to be a little difficult, so chose to use the Auto it interface on labview to automate the WTM software. it works well, but I do have a small annoying problem.
My main interface VI is made up of several subVI's that I pass the Autoit ActiveX reference to. I first open the automation reference, then pass it to the subVIs within which I'm invoking several methods to perform certain tasks. It works well for the most part, except when I start labview. It is a weird error that anytime I close labview and start again, the initial run never works unless I delete the input to my sub VI and re-add it. After this, the VI runs normally, but the problem is encountered again when I close labview all together, and re-start.
Any idea what's happening? Clearly after highlighting my execution, I saw that after opening the autotit automation, the reference from the open automation to the input of my first sub VI is not correct or causing some error. I've attached a visual for this:

11-06-2008 12:56 PM
11-06-2008 12:57 PM
11-10-2008 10:20 AM
Sorry. This thread completely fell off my radar. I don't know if you're still having problems, but can you provide any more information about the error? What does it say in the "source" part? Can you upload your code?
Side-note: in your while loop you're using a local variable to read the value of the Listbox. Just use the control terminal - it's right there.
11-10-2008 02:35 PM
Unfortunately, apart from this error window that i'm attaching, there's nothing else I can tell you. I am still encountering this problem. i have attached the code as well.
Looking at the block diagram for WTM Run, once the autoit reference is passed from the Main Interface, there is no problem until it hits the first invoke node. After that, the error arises. This error seems to be fixed once I re-open an open automation on the Main Interface (i.e. delete the old "open automation" block, and replace it with a new one).
Any help or idea on this would be great. Thanks.
11-10-2008 03:36 PM
I did not get an error at the WinExists node when I ran your code. However, it seems I have a different version of AutoIt than the one you may have, since when I opened your code there was a broken arrow. The signature for ControlClick was different.
I suspect the problem you're running into is the same problem I discovered here. Note: You should wire a value to the "timeout" input for WinWaitActive.
Also, you really need to learn to stop using so many local variables. None of your local variables are necessary. Use wires!
11-10-2008 04:26 PM
Hey smercurio_fc. I made the changes you suggested, yet I'm still encountering the same problem, it keeps stoppnig with the same error message. Could this be a system error? I'm currently using AutoIt Version 3. The Autoit Library I'm using is called AutoItX3 1.0 Type Library Version 1.0
The class I use in the automation open block is AutoItX3Lib.IAutoItX3. Should I look into another version? I'm also using LabView 8.6.
As I mentioned, I was encountering the same errors again, and this time to fix the errors, I had to get rid of the input terminal in the sub VI WTM Run and re-insert it, which then allowed the program to run again. I haven't the slightest clue as to what's happening, there must be some discrepency with the reference values being passed.
11-10-2008 04:48 PM