LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Programmatically Running and Controling One VI from Another Using VI Server

Hello all,

I have to build a vi(M) which controls another one(S). S uses event
structure to handle user interaction on its own front panel.
My question is how I can generate events from M as if the used would do
interactively on S.
What I know is that Value(Signaling) causes Labview to do that, but how
I can set/change that Control Property in M?

Thanks in advance,
bye, Thom
0 Kudos
Message 1 of 9
(2,769 Views)
Hi,
Please take a look at one of my previous post here
Look for VS_Pass_Data.zip
 
Regards,
 
Ian F
Since LabVIEW 5.1... 7.1.1... 2009, 2010, 2014
依恩与LabVIEW
LVVILIB.blogspot.com
0 Kudos
Message 2 of 9
(2,763 Views)

Hi Anonymous,

      If you pass a control reference from M to S, then the event-structure in S can detect the changes in M, by registering for the events - see pic for what it looks like in "S":

Cheers!

Message Edited by Dynamik on 05-29-2006 01:36 PM

When they give imbeciles handicap-parking, I won't have so far to walk!
0 Kudos
Message 3 of 9
(2,759 Views)
Hi Anonymous,
      This answers your question - which I didn't read carefully the first-time through! Smiley Wink
In this case a reference to a boolean-reference is passed to S.  S gives M the boolean-reference (via reference), now M can cause events in S as if they happend in S!
 

Message Edited by Dynamik on 05-29-2006 01:59 PM

Message Edited by Dynamik on 05-29-2006 02:02 PM

When they give imbeciles handicap-parking, I won't have so far to walk!
0 Kudos
Message 4 of 9
(2,753 Views)
Hi Dynamik,

Thank you for the idea, but it's maybe not the solution or I haven't
understood you yet.
1. I suspect you presume M is a main, S is a subvi, however, M should
load S dinamically (Open VI reference,..). S has the event structure to
handle user interaction. After all, M task is to stimulate S'
buttons,... if I say so. While the user are playing with the M' buttons,
S' buttons should follow it.
2. I read this :
http://zone.ni.com/devzone/conceptd.nsf/webmain/68D318643AFA3CA086256928006C64A4
, but as I see, all the stuff concern sub vi control what I don't need.
Now, what I'm curious most, (I hope the question is good) how to get
refnum in M to the controls of S.
Unfortunately, the whole business is complicated by the event structure.
Without it, it'd be easy to achieve that by using "Call by reference
node" or similar in M.
I hope I was clear.
Thank you all in advance.

Thom

Dynamik wrote:
> Hi Anonymous,
>       This answers your question - which I didn't read carefully the first-time through! Smiley Wink
> In this case a reference to a boolean-reference is passed to S.  S gives M the boolean-reference (via reference), now M can cause events in S as if they happend in S!
>  
> <img src="http://forums.ni.com/attachments/ni/170/187223/1/RefToRef.JPG">
> Message Edited by Dynamik on 05-29-2006 01:59 PMMessage Edited by Dynamik on 05-29-2006 02:02 PM
>
>
> RefToRef.JPG:
> http://forums.ni.com/attachments/ni/170/187223/1/RefToRef.JPG
0 Kudos
Message 5 of 9
(2,737 Views)

I'm not near a LV system so can't recall exact syntax.  But if M opens S dynamically, then M will have a VI refnum that references S.  Hook up that VI refnum to a VI server property node, and there's a property known as something like Front Panel-->Controls that will return an array of references to S's front panel controls.  You may need to search through them to find the right one(s). 

With the right control reference(s), you can write values to the 'Value (signaling)' property to programmatically simulate user interactions.

-Kevin P.

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
0 Kudos
Message 6 of 9
(2,733 Views)


@Anonymous wrote:
My question is how I can generate events from M as if the used would do
interactively on S.


Sorry for any confusion, Anonymous - hope this helps!


When they give imbeciles handicap-parking, I won't have so far to walk!
Download All
Message 7 of 9
(2,725 Views)
Dynamik wrote:
> Anonymous wrote:My question is how I can generate events from M as if the used would do interactively on S.
>
>
> Sorry for any confusion, Anonymous&nbsp;- hope this helps!
It helped. Thank so much.
But, how did you do the "RefToBoolRef" control on aS.vi?
If I place a "Control Refnum" (Controls Palette >> Modern >> Refnums >>
Control Refnum) control on the front, I cannot drop the appropriate
control in it because the "Boolean" reference doesn't exist on the
front. (If I see well, here we need a "pointer (RefToBoolRef) to the
pointer(Boolean Reference)", but I didn't find in the doc how I can do
that.)

Thanks again in advance.
>
>
> aM.vi:
> http://forums.ni.com/attachments/ni/170/187497/1/aM.vi
>
>
> aS.vi:
> http://forums.ni.com/attachments/ni/170/187497/2/aS.vi
0 Kudos
Message 8 of 9
(2,714 Views)

Hi Anonymous,

      Here's how I create a reference to a reference - but there may be other (easier) ways... Smiley Wink

 

When they give imbeciles handicap-parking, I won't have so far to walk!
0 Kudos
Message 9 of 9
(2,706 Views)