02-08-2021 02:34 PM
Would you please provide some example code ?
Millions of thanks !
02-10-2021 02:08 AM
@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:
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.
02-11-2021 11:42 AM
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 ?
02-11-2021 12:01 PM - edited 02-11-2021 12:02 PM
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).
02-11-2021 01:01 PM
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.
02-12-2021 02:57 AM
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.
02-12-2021 11:13 AM
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 ?
02-12-2021 01:21 PM
@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.