취소
다음에 대한 결과 표시 
다음에 대한 검색 
다음을 의미합니까? 

open subvi front panel in executable

해결 완료!
솔루션으로 이동

Hi,

In my labview project the MainVI contains about 20 subVIs. My goal is that on clicking a button on the front panel of the main VI I would like to open a particular subVI( assume it to be subVI 10). To do this in the labview development environment I used a openVI reference with its input vi path being the name of the VI i want to launch(subVI 10) and then set a true constant to the front panel to pop up the subvi front panel. This works well in the labview development environment but when I create an executable I am not able to open my subVI. I looked around on the knowledge base and found this article. 

http://digital.ni.com/public.nsf/allkb/24F54CF34391074D862570E6005857DE. But this article talks about launching the front panel everytime the subVI is called. This would not work in my case as sometimes the user may not want to launch the subVI. Also I have a lot of controls and indicators on the subVI hence there is no way I can have that on the main VI as it would clutter everything on the main VI.

 

In the  properties settings for builiding the executable, under the Source File Settings Category I  can see the remove front panel option for the dependencies but it doesnt allow to set the option for the subVI individually. I can only set remove front panel for all contained items.  So any help on how to address this issue is greatly appreaciated.

0 포인트
1/14 메시지
12,982 조회수

Use a property node and set the fp panel to open. See below

 

Example.png

Tim
GHSP
0 포인트
2/14 메시지
12,972 조회수

aeastet wrote:

Use a property node and set the fp panel to open. See below


Errr... that sounds like exactly what the user is already doing. The problem, as I read it, is that the subVI's front panel is being stripped when built into the executable, and they want to keep the front panel.

 


tarunA wrote:
In the  properties settings for builiding the executable, under the Source File Settings Category I  can see the remove front panel option for the dependencies but it doesnt allow to set the option for the subVI individually. I can only set remove front panel for all contained items.  So any help on how to address this issue is greatly appreaciated


It's true that you cannot set options for individual VIs within a folder. However, keep in mind that the folder structure in the project tree does not have to match the actual folder structure on disk. Thus, you can create a "special" folder in your project where you place these VIs that you don't want to strip the front panel, and set the properties accordingly. 

0 포인트
3/14 메시지
12,959 조회수

Hi tarunA,

 

did you include your SubVIs in the Executable?

 

Cheers,

Pattos

LabVIEW Gretchin
0 포인트
4/14 메시지
12,941 조회수

In your subvi call, you can edit the properties of a subi to always show front panel when called. (r-click a sub-vi in your diagram)

Or you can edit the vi's properties to always show the front panel.

 

The difference? In the first case it's the caller that decides if it should be shown or not (sub vi's are usually not shown), but in the other the subvi has decided to always be shown regardless of caller.

 

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 포인트
5/14 메시지
12,934 조회수

I suggest you don't use 'Property node' but 'Invoke node' FP.Open which you can play with the display mode.

 

InvokeNodeOpenVI.jpg 

 

 

My point of view is that you must avoid to play with general VI or project options as soon as possible because code is less readable... With Properties or Methods, you're able to check what you develop... But it's a personnal point of view 😉

0 포인트
6/14 메시지
12,920 조회수

"But this article talks about launching the front panel everytime the subVI is called. This would not work in my case as sometimes the user may not want to launch the subVI. "

 

Then dont call/launch the sub vi. 🙂

Or is the sub vi always running and you only want to see it at times?

 

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 포인트
7/14 메시지
12,900 조회수
yes the sub vi is always running but i want to only see it some times( this is dependent on the user, i want to give the user complete control on when to view the front panel )
0 포인트
8/14 메시지
12,888 조회수

@Pattos

 

yes i did include the sub vi in the executable.

0 포인트
9/14 메시지
12,886 조회수
솔루션
승인자 tarunA

Have you tried using Static VI references instead of using "Open VI" with a file path?  With a Static VI reference, the compiler has a better idea on what you are trying to accomplish at runtime.

 

I have done that in executables before, w/o any problem.  I personally like to have a boolean input to the SubVI called "Show Window" (or something like that), and then have the SubVI handle how it wants to Open (or close) its Front Panel.

 

original_2.png

 

There is more than this going on.... the snippet kinda took liberties.

 

This is within the SubVI (which my Main VI is always running).  The SubVI contains a static reference to itself.  I have a button on my Main VI's front panel that when pressed sends a "True" to the "Show Window?" boolean input.  The SubVI responds by openning up the front pannel. The opposite happens when the button is depressed.

 

This code has been compiled in many executables and works w/o any problems.

 

Edit: Cropped image.  That boolean coming in is "First Call".  The LV 2009 snippet feature made that "error out 2" terminal.  Lol.  I wouldn't name it that.

Message Edited by Nickerbocker on 01-13-2010 10:30 AM
10/14 메시지
12,871 조회수