LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to simulate click button, enter string on the window/dialog of the other running application?

Would you please provide some example code ?

 

Millions of thanks !

0 Kudos
Message 11 of 18
(1,251 Views)

@BigDrum wrote:

Would you please provide some example code ?

 

Millions of thanks !


Just use VI Server (search for it) to open VI references, then control references.

 

Make sure the VI doesn't have separated complied code, and drop it on the exe in windows explorer.

 

I wouldn't know what to make, as I have no idea what your application look likes.

 

As a first test, try to get this to work:

VI Server in Exe.png

 

There are caveats. Not all VIs will have a front panel for instance. This test won't do anything useful with the wrong VI index and Control index. But for GUI VIs you should be able to get control values. And set them. Often, the value will be overwritten by the program. But if the GUI VI has value change events, a value (Signaling) will trigger the event.

0 Kudos
Message 12 of 18
(1,239 Views)

Thank you for your example ! It help me when I am running a vi.

 

I'd like to do the same thing when running an executable. Would you please provide example code ?

 

Attached a simple example of the application. After build that into executable and run it, how can I simulate click button, enter string by separate vi ?

Download All
0 Kudos
Message 13 of 18
(1,222 Views)

This would only be easy if you refactor the Boolean buttons to switch, not latch. With latching buttons, it's going to be hell, as value (signaling) won't work.

 

So, update your code, and please explain what you'd like to automate (and how).

0 Kudos
Message 14 of 18
(1,217 Views)

1. run the executable

2. code and run another vi to simulate the keystroke on the executable

              Click "START", the dialog popup

              Enter a string on the dialog and click "OK" so the dialog close

 

Please help on step 2 to provide a vi or sample code.

 

I need repeat step 2 hundreds of times automatically instead of manually. That is why I need simulate/automate step 2.

0 Kudos
Message 15 of 18
(1,209 Views)

Did you change the button mechanics?

 

Again, simulate a press for:

1) Switch action - Send value (signaling)

2) Latch action - get FP, get coordinates, convert coordinates, call windows API.

 

1) is a lot easier.

0 Kudos
Message 16 of 18
(1,195 Views)

My executable in last post is "Switch". Attached again here.

 

But the real executable I need to automatically strike is "Latch when release"

 

Would you please provide some sample code for both cases ?

0 Kudos
Message 17 of 18
(1,189 Views)

@BigDrum wrote:

But the real executable I need to automatically strike is "Latch when release"


Well, you're on your own there.

 

It's terrible, and too much work for now.

 

Why do you need that? On the event, set the value to the old value, and nobody will notice the difference.

 


@BigDrum wrote:

Would you please provide some sample code for both cases ?


I'm off for now.

 

I'll have a look next week, but only for the switch buttons.

0 Kudos
Message 18 of 18
(1,183 Views)