LAVA Forums Buy cool LAVA gear Forums RSS Feed

Welcome Guest ( Log In | Register )

> Related links

Check out our User Interface Code Repository Files or visit the LabVIEW Wiki User Interface Portal


Tags
(This content has not been tagged yet)
 
Reply to this topic Start new topic
> Passing Data To A Subpanel
Clara Merino
post Feb 3 2004, 01:30 PM
Post #1


I've come back for more.


Member
Posts: 2
Joined: 3-February 04
Member No.: 249
LV:6.1


Hi,

I'm building an application in which I would like to use subpanels. Up to now I've only been able to open the FP of the SubVIs called and, then, give values to the inputs but once loaded in the subpanel container. Is there any way of passing values to the inputs so that the SubVI starts running directly when called?

Thanks a lot,

Clara


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
Ad
post Feb 3 2004, 01:30 PM
Post #















Tags
(This content has not been tagged yet)
Go to the top of the page
Quote Post
Michael_Aivaliot...
post Feb 3 2004, 08:42 PM
Post #2


Confucius say: Crowded elevator always smell different to midget
Group Icon
*****

Admin
Posts: 2367
Joined: 13-October 02
From: Planet Earth
Member No.: 2
Using LabVIEW Since:1994
LV:8.5 ,8.2.1 ,7.1.1
Greece Canada United States My Blog My Gallery


I am curious to know how you are passing data to the sub-paneled VI right now?

In any case, to pass data to a VI control before launch you can use the VI Server Method Set Control Value. I have attached an image that shows how to do this before running and embedding the VI.
Attached thumbnail(s)
Attached Image
 

--------------------


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
Norm Kirchner
post Feb 3 2004, 11:39 PM
Post #3


Extremely Active
****

Premium Member
Posts: 595
Joined: 8-December 03
From: Dallas, Texas
Member No.: 208
Using LabVIEW Since:2000
LV:8.6 ,8.2.1 ,7.1.1
United States us_texas us_ohio My Gallery


Hi Clara,
There is a more direct route to accomplishing what I think you are looking to do. The attached image should get you up and running.
  • Create a "Call by reference Node"
  • Right click on the Call by ref node and select "VI Server" and then "Browse"
  • Select the VI that you are looking to throw in the sub panel
  • Right click on the reference input of the Call by reference node VI and create a constant
  • Disconnect the reference from the input and wire it to the input "Type specifier" of an "Open VI Reference" vi
  • Wire the vi reference of the open vi reference Vi to the Reference input of the Open by Type Specifier
  • The Image attached should show you the rest.
This solution requires you to learn a little about using the call by ref node if you don't have prior experience with it, but it is the most straighforward and clean way to accomplish sending inputs to a vi you are opening in a sub panel thumbup1.gif

--------------------
Norman J. Kirchner Jr.
Automation Software Engineer

~,~ The Captain Was Here
Premium Blend


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
Norm Kirchner
post Feb 3 2004, 11:41 PM
Post #4


Extremely Active
****

Premium Member
Posts: 595
Joined: 8-December 03
From: Dallas, Texas
Member No.: 208
Using LabVIEW Since:2000
LV:8.6 ,8.2.1 ,7.1.1
United States us_texas us_ohio My Gallery


Sumanabich frusty.gif

Here is the image
Attached thumbnail(s)
Attached Image
 

--------------------
Norman J. Kirchner Jr.
Automation Software Engineer

~,~ The Captain Was Here
Premium Blend


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
Jim Kring
post Feb 4 2004, 12:17 AM
Post #5


Changing the world, one VI at a time.
*****

JKI
Posts: 1696
Joined: 22-October 02
From: San Francisco, CA
Member No.: 17
Using LabVIEW Since:1995
LV:8.2.1 ,8.5 ,7.1.1
United States us_california Nothing Selected My Blog My Gallery


QUOTE (njkirchner @ Feb 3 2004, 03:39 PM)
Hi Clara,
    There is a more direct route to accomplishing what I think you are looking to do. The attached image should get you up and running.
  • Create a "Call by reference Node"



  • Right click on the Call by ref node and select "VI Server" and then "Browse"



  • Select the VI that you are looking to throw in the sub panel



  • Right click on the reference input of the Call by reference node VI and create a constant



  • Disconnect the reference from the input and wire it to the input "Type specifier" of an "Open VI Reference" vi



  • Wire the vi reference of the open vi reference Vi to the Reference input of the Open by Type Specifier



  • The Image attached should show you the rest.
This solution requires you to learn a little about using the call by ref node if you don't have prior experience with it, but it is the most straighforward and clean way to accomplish sending inputs to a vi you are opening in a sub panel  thumbup1.gif

Norm and Clara,

:!: I discovered a bug during beta testing, which is caused by calling the CRB and SubPanel methods in parallel (as done in your example, Norm). This has been fixed (I hope), but it is probably better to 1st call the SubPanel method and then invoke the CBR node. You can take a look at the attached example to see what I'm talking about and to test whether the bug is really fixed.

Regards,

-Jim
Attached File(s)
Attached File  Example___Subpanel_Race_Condition.zip ( 19.41K ) Number of downloads: 327
 

--------------------
-----------------------------------------------------------------------------------------------------
| Book | OpenG | LAVA | Champion | VIPM | Builder | Blog | JKI |
-----------------------------------------------------------------------------------------------------


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
Michael_Aivaliot...
post Feb 4 2004, 12:36 AM
Post #6


Confucius say: Crowded elevator always smell different to midget
Group Icon
*****

Admin
Posts: 2367
Joined: 13-October 02
From: Planet Earth
Member No.: 2
Using LabVIEW Since:1994
LV:8.5 ,8.2.1 ,7.1.1
Greece Canada United States My Blog My Gallery


QUOTE (Jim Kring @ Feb 3 2004, 07:17 PM)
You can take a look at the attached example to see what I'm talking about and to test whether the bug is really fixed.

Well, I tried it out and it seems to be fixed. thumbup1.gif

However there is a place for both implementation methods. I usually use sub-panels as part of a larger user interface approach. I prefer my sub-panel call to be non-blocking so my caller can go about it's business. This is why I prefer the VIServer implementation. However from an ease of use standpoint the call by reference is much better.

--------------------


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
Jim Kring
post Feb 4 2004, 12:47 AM
Post #7


Changing the world, one VI at a time.
*****

JKI
Posts: 1696
Joined: 22-October 02
From: San Francisco, CA
Member No.: 17
Using LabVIEW Since:1995
LV:8.2.1 ,8.5 ,7.1.1
United States us_california Nothing Selected My Blog My Gallery


QUOTE (Michael Aivaliotis @ Feb 3 2004, 04:36 PM)
Well, I tried it out and it seems to be fixed.  thumbup1.gif

However there is a place for both implementation methods. I usually use sub-panels as part of a larger user interface approach. I prefer my sub-panel call to be non-blocking so my caller can go about it's business. This is why I prefer the VIServer implementation. However from an ease of use standpoint the call by reference is much better.

Michael,

I agree with you that both the CBR node and the Run method have thier place. Same thing with synchronous vs asynchronous SubPanelled VI calls (Run method can be either blocking or non-blocking depending on the "Wait until done" argument). However, I was simply referring to the fact that the two primitives (CBR node and SubPanel method) should not be called in parallel, since this causes a race condition that LabVIEW has already choked on (at least in Beta). I looked at your example, and you are forcing these primitives to execute sequentially (via data flow), so you're OK thumbup1.gif

Cheers,

-Jim

--------------------
-----------------------------------------------------------------------------------------------------
| Book | OpenG | LAVA | Champion | VIPM | Builder | Blog | JKI |
-----------------------------------------------------------------------------------------------------


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
Clara Merino
post Feb 4 2004, 10:42 AM
Post #8


I've come back for more.


Member
Posts: 2
Joined: 3-February 04
Member No.: 249
LV:6.1


QUOTE (Michael Aivaliotis @ Feb 3 2004, 03:42 PM)
I am curious to know how you are passing data to the sub-paneled VI right now?

Well, now I don't pass any data to the SubVIs, that's the point. What I was doing was calling them from the subpanel and then setting the input values by hand... But this is of little use for my application and that's why I asked smile.gif

I will try using the Call by Ref method... Thanks a lot to all of you!

Ciao,

Clara


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post

Reply to this topicStart new topic

 




Time is now: 1st December 2008 - 10:50 PM