LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Program selection (LabVIEW 2012)

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.

0 Kudos
Message 1 of 12
(3,174 Views)

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

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 2 of 12
(3,151 Views)

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 

 

0 Kudos
Message 3 of 12
(3,101 Views)

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

0 Kudos
Message 4 of 12
(3,076 Views)

Use State Machine to call the VI's Based on the Event in the Main VI(Program Select). which will solve your Problem.

 

ProgramSelect.png

 

Use this Example Sample Program

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 5 of 12
(3,067 Views)

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

0 Kudos
Message 6 of 12
(3,039 Views)

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.

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 7 of 12
(3,021 Views)

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).


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 8 of 12
(3,012 Views)

If you know the name of the VI in the .exe, you should be able to get to it like this:

exep.png

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 9 of 12
(3,005 Views)

Hi Paul,

 

Thank you very much for your suggestion but still did not work.

 

Regards,

Tatzmon

0 Kudos
Message 10 of 12
(2,989 Views)