Jump to content

LV7.1 - redirect keystrokes to effect specific EXE


liat00

Recommended Posts

Hi,

I'm working on a project which needs to interface with a exe file which does functional testing on PCBs. I do not have the source code. I know that any exe can be controlled via command window, however i want to know if there are any other ways...

The idea is to automate the process. Currently to run through the whole process the operator needs to click on a "continue" button several times.

Instead of doing this, I want to simulate keystrokes of tab+tab+space on Labview.

Can i redirect the keystrokes to effect the software running and not Labview?

Thanks!

LSH

Link to comment

Hi,

I'm working on a project which needs to interface with a exe file which does functional testing on PCBs. I do not have the source code. I know that any exe can be controlled via command window, however i want to know if there are any other ways...

The idea is to automate the process. Currently to run through the whole process the operator needs to click on a "continue" button several times.

Instead of doing this, I want to simulate keystrokes of tab+tab+space on Labview.

Can i redirect the keystrokes to effect the software running and not Labview?

Thanks!

LSH

You can set the mouse position and generate a click event programmatically.

There is an example somewhere on NI's Website.

maybe this one

Link to comment

You can set the mouse position and generate a click event programmatically.

There is an example somewhere on NI's Website.

maybe this one

I want the Labview GUI to be the main screen though.

The actual software should be only in the background (where the operator doesn't see it). I want the operator to see only pass/fail.

simulating keystrokes or mouse click event effects labview - not the running software.

Link to comment

My suggestion isn't LabVIEW, so maybe you won't like it, but if you've never heard of it there is a scripting language called AutoIt designed for tasks like this.

It implements a bunch of handy APIs which let you do things like find the current activate window, get a list of open windows, get details of controls within those windows, and send keyboard/mouse input to all the of the above. I've used it before and I know a couple other people who really like it (hooovahh, cough cough).

You *could* implement these same APIs in LV, but why re-invent the wheel if you don't have to, right? :)

  • Like 1
Link to comment

My suggestion isn't LabVIEW, so maybe you won't like it, but if you've never heard of it there is a scripting language called AutoIt designed for tasks like this.

It implements a bunch of handy APIs which let you do things like find the current activate window, get a list of open windows, get details of controls within those windows, and send keyboard/mouse input to all the of the above. I've used it before and I know a couple other people who really like it (hooovahh, cough cough).

You *could* implement these same APIs in LV, but why re-invent the wheel if you don't have to, right? :)

I just took a look at AutoIt... and it looks perfect to what i want to accomplish. thank you asbo!

I still would like to know if such a think is possible in LV - just for knowledge base.

Link to comment

[...] I still would like to know if such a think is possible in LV - just for knowledge base.

From the AutoIt website:

Also supplied is a combined COM and DLL version of AutoIt called AutoItX that allows you to add the unique features of AutoIt to your own favourite scripting or programming languages!

(Look, they misspelled "favorite"!   :D

Link to comment

Yes I've used Autoit in LabVIEW, with ActiveX there's an example on NI's website some where...here it is. Be aware that the ActiveX doesn't have nearly as many features as the AutoIt, it seems the ActiveX call is only for the most used functions (which probably is you're use case).

Another thing to keep in mind (probably not for this project) is that AutoIt can be compiled into a EXE with command line switches. What I've done in the past is build AutoIt code, then compiled it into a EXE (which should run in Windows without any installer) and then have LabVIEW interface with it by using the command line. I've also tried talking to AutoIt EXE using DDE and had some limited success. I could get LabVIEW to send out to the application, but I couldn't get the application to talk back to LabVIEW.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.