LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to enter a value in an input box with set xy-coordinates in another stand-alone program

Solved!
Go to solution

Hi,

 

I need to enter a value in a stand-alone windows program (just an industrial executable that I have no control over). Essentially I just want to automate manual key entering to avoid having to do it manually by:

1. Place the cursor over the screen xy-coordinates where the text input box is located

2. Click

3. Enter value

4. Press enter

 

Cheers,

Mattias

0 Kudos
Message 1 of 5
(2,291 Views)

Hello Mattias, 

 

NI has an article on how automate keystrokes here: https://forums.ni.com/t5/Example-Code/Programmatically-Simulate-Key-Strokes-in-LabVIEW/ta-p/3521756

 

Good luck with your project!

 

Looking a little closer, I don't think my link above will do quite what you're looking for.  

 

Have a look at this older post here:  https://forums.ni.com/t5/Example-Code/Programmatically-Simulate-Key-Strokes-in-LabVIEW/ta-p/3521756

 

There is also another method of simulating keyboard events:  https://forums.ni.com/t5/Example-Code/Using-LabVIEW-to-Simulate-Keyboard-Events/ta-p/3996210

---------------------
Patrick Allen: FunctionalityUnlimited.ca
0 Kudos
Message 2 of 5
(2,279 Views)

Great, thanks Patrick,

 

I've had a look at the code, but unless I make a mistake, there is no way to select where on the screen I want to enter the code?

 

The stand-alone industrial processing control program I'm trying to control covers the whole Windows screen and has more than 30 fields/boxes where one can enter values, but I only need to change the values in one of the boxes during processing (which can run for hours, which is why I don't want to sit there and manually enter numbers all day).

 

Is that possible with the program you supplied and I missed it?

 

Cheers,

 

Mattias

0 Kudos
Message 3 of 5
(2,262 Views)
Solution
Accepted by topic author Mattias_247

Oops, it seems I accidentally posted the same link twice.  

 

This was the second link I meant to post. 

https://forums.ni.com/t5/LabVIEW/Can-LabVIEW-control-another-program-or-emulate-keys-pressed-on/m-p/...

 

The above post mentions something called AutoIT.  I have not used this personally, but there are a few examples of using it with LabVIEW. 

 

To simulate a mouse click to select the active region in your other program, have a look at this post here: https://forums.ni.com/t5/LabVIEW/Can-LabView-generate-a-mouse-click-for-another-program/td-p/795252  

 

There is some example code here: https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z0000015ASTSA2&l=en-CA

 

It might take a some time to get all the coordinates of the places you need to click.  But at least you would only have to do it once.  

 

---------------------
Patrick Allen: FunctionalityUnlimited.ca
0 Kudos
Message 4 of 5
(2,241 Views)

Ha ha, great, thanks, I think that'll do the trick, many thanks.

 

(If I don't get it to work, I may ask more questions!) 

 

Cheers,

 

Mattias

0 Kudos
Message 5 of 5
(2,235 Views)