04-21-2017 03:32 AM
Hi,
I have two different LabVIEW built (.exe) files and i want to make a new Front Panel to select the program without browsing it. I already tried using System Exec.VI but it only work on opening the file and cannot close when it is not selected. Anyone have an idea, it would be a great help.
Thanks You.
04-21-2017 05:54 AM
share the piece of code or snippet of New Front panel.
Hope to close FP when File path is not selected should be handled in LabVIEW
04-23-2017 10:09 PM
Hi Palanivel,
Good day to you!
Actually, I am just a newbie of LabVIEW with few topics I've learned from an in-house training. I attached my initial code where it can select the program to open but I want to have it closed automatically when the selector if OFF. Please help and you may modify my code to what it is intended for. Thank you very much.
Regards,
Renato
04-24-2017 02:44 PM
Hi Tatzmon,
Have you seen the following KnowledgeBase article? It shows how you can avoid using System Exec, by invoking a VI reference or changing the settings of your subVI to close after run.
How Do I Programmatically Open and Close a VI Within Another VI?: http://digital.ni.com/public.nsf/allkb/9282BA6C907DF5B2862572480069E570
04-24-2017 11:48 PM
Use State Machine to call the VI's Based on the Event in the Main VI(Program Select). which will solve your Problem.
Use this Example Sample Program
05-04-2017 02:50 AM
Hi Palanivel,
I tried your recommended way of programming but still end up an error ( see attached). Please be informed that the LabVIEW programs I've had here were already in .exe (built executable), so if I use the Open/Invoke VI's, an error will appear. Please let me know if there is another way.
Thanks,
Tatzmon
05-05-2017 07:33 AM
Recommended suggestion is for VI calling and not for Executable, so error is expected by obvious.
So its better to use system.exe to launch exe and make sure your executable can access a file and will stop when it encounter a shutdown string in the file by which you can close the executable.
05-05-2017 08:59 AM
You might also want to consider using the .NET Process API for launching/shutting down the executables. It has more options for gracefully telling an application to shutdown. If you use System Exec, you would have to manually close the application (or kill the process).
05-05-2017 10:57 AM
If you know the name of the VI in the .exe, you should be able to get to it like this:
05-07-2017 10:08 PM
Hi Paul,
Thank you very much for your suggestion but still did not work.
Regards,
Tatzmon