LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Best way to interact with 3rd party program

I have some 3rd party software that I did not write and do not have the source code to.

It is essentially several string controls and a few graphs (not written in LabVIEW).

I would like to change a few of the inputs on the string controls on a regular time interval.

 

Here is how I might do it (in psudo-code). Is there an easier/better way to do it?

 

if program is open:

move window to absolute location

move mouse to absolute location (over string control)

generate left-click

generate key down (for the keys i want to input)

 

else:

open program

(run the rest of the code in the above if statement)

 

 

Since I cannot run this program through LabVIEW similar to how you can programmatically enter values to a DLL,

the only way I could think of is to automatically move the mouse, click, then automatically type the values.

This seems like an adhoc, inefficient way to do it, but I cant think of a nicer way to do it.


Any thoughts?

Cory K
0 Kudos
Message 1 of 5
(2,778 Views)

There was a conversation here recently of a very similar nature. If I rember correctly (?) Gourge Zou of G-Toolbox fame had a solution. Search the forum, its here somewhere.

 

But first!

 

Have you ruled out passing arguement via a commnad line? If the app supports command line arguements then ... well you know the rest of the story Smiley Wink

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 2 of 5
(2,757 Views)

I've had to do this in the past with a Matlab executable that we were given. It was a real pain becaused I had to do precisely what you're talking about doing. I made it easier on my life by using AutoIt. I just wrote scripts in AutoIt and compiled the scrips into miniature executables and just called those executables from LabVIEW. For the most part it worked relatively well.

 

If the app is written using standard Windows controls then the job is a little easier since there are functions that will let you send messages to specific controls in a window, so you don't have to resort to moving a mouse to a specific location and clicking. With the Matlab executable I couldn't do that since Matlab was drawing its own controls (like LabVIEW does), so the controls were not accessible that way.

Message 3 of 5
(2,753 Views)

smercurio_fc wrote:

I've had to do this in the past with a Matlab executable that we were given. It was a real pain becaused I had to do precisely what you're talking about doing. I made it easier on my life by using AutoIt. I just wrote scripts in AutoIt and compiled the scrips into miniature executables and just called those executables from LabVIEW. For the most part it worked relatively well.

 

If the app is written using standard Windows controls then the job is a little easier since there are functions that will let you send messages to specific controls in a window, so you don't have to resort to moving a mouse to a specific location and clicking. With the Matlab executable I couldn't do that since Matlab was drawing its own controls (like LabVIEW does), so the controls were not accessible that way.


 

I found myself smiling after reding your post because a South Park episode was called to mind. I believe it may have been the "The Earth is reality Show" episode where the boys were visited by a superior being that at first frightened them so it allowed them to choose the form. After a number of options they agreed on "A giant taco that sh_ts ice cream.

 

So feel free to let loose with any dropping you are moved to share. Smiley Surprised

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 4 of 5
(2,748 Views)

I took a look through the documentation for the software and it doesnt have any command prompt interface.... sigh.

I'll try searching on the forums for the thread you are talking about. Thanks

Cory K
0 Kudos
Message 5 of 5
(2,707 Views)