LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

execute event by program

I have a VI that gets settings out of an ini file when the user push a button. This execute a event reading the ini-file. He can modifie the settings and save them afterwards.
When I use this programm as a subVi, I have the filename with the settings, and want to get the data of this file without user activity.

How can I execute a event case by labview?
0 Kudos
Message 1 of 4
(2,882 Views)
There are a couple of options you have here. However, neither is very graceful. If possible, it would be nice if you could change the subVI so that it behaves without requiring events. However, here are a couple of ideas to get you started if you want to leave it as it is.

1. The first example VI I attached, SimulateKeyEvent.vi, is one which I found on NI's website that simulates keyboard events using Windows API calls.

2. The second program is also from their website. It is called programmatic events.vi and may be closer to what you are looking for.

Check these out and see if they get you started. Hopefully, they can give you an idea of what tools are available. Best of luck!
J.R. Allen
Download All
Message 2 of 4
(2,882 Views)
Thanks a lot.
I will give it a try. Looks good.
0 Kudos
Message 3 of 4
(2,882 Views)
You first priority (IMO) should be to remove the events from this VI if you want to use it as a subVI. SubVI's should generally not use the event structure unless they have Front Panels open and are part of the user interface.

Your VI should contain only the code necessary to read the ini-file. You would call this subVI from another top-level VI that has the event structure and gives the user the ability to modify the values.

Probably what will work best in your case is to select the ini-file reading code on your current VI and then choose the "Create SubVI" option from the Edit menu. This will turn the section of code that reads the ini file into a distinct SubVI that you can then call from multiple places without having to worry about generating ev
ents.

If you need futher guidance, let me know.

Scott Menjoulet
0 Kudos
Message 4 of 4
(2,882 Views)