LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

referencing an element from cluster

hmmm.... Maybe I am thinking way too much for that can be done simpler. I was just thinking of creating a reference of an indicator on the subvi and drag it into the mainvi and then attaching that value to the indicator of the mainvi. But then, I would not use the output s on connector panes of the subvi. That's what I thought. Never mind! I get it now. Thanks! 😉

 

I may not be perfect, but I'm all I got!
0 Kudos
Message 31 of 42
(975 Views)

Smercurio, I think you may be a little confused as to what Vee Jay is asking.  He didn't word it properly, but I know what he is asking.

 

VeeJay:  You can create a control reference to a main vi indicator, pass it to the subvi, and write to a value property node of that reference along with writing to the subvi indicator.  That way, as the indicator changes in your subvi, you will see the same value in main.  To clarify things, you are not usinga reference to the subvi indicator, but you are using a reference to the main vi indicator, and you have to write to both the subvi indicator and the reference value property together.  It is not a two way street, it is simply sending references to main controls and indicators to a subvi, so it still is a one way street.  But the data seems to go both ways.  Confusing enough?

 

This is illustrated by the two vi's attached.  Notice how the main indicator gets updated by actions in the subvi, while the subvi is running.  Save both vi's to the same folder.  Open the main.  If it starts looking for the subvi, point to its location where it is saved.

 

 

- tbob

Inventor of the WORM Global
Download All
Message 32 of 42
(970 Views)
lol..... my beginner programmer lingo 🙂 You are right. It seems like two way street although it is not. I can see it now. Thanks!
Message Edited by VeeJay on 06-02-2010 02:22 PM
I may not be perfect, but I'm all I got!
0 Kudos
Message 33 of 42
(956 Views)

Hi Guys. i have one more question. How to make the two parallel loops in effect parallel when you use notifiers to send the "end loop" value between loops? If I remove notifier queue and just use "local variable" to send "end loop" value to both loops, I find that both loops update main vi based on the time delays in each subvi. But, if I have the notifier queue, I see that they are not in effect parallel and sometimes , only one subvi updates the main vi. Is this correct? I really like the use of notifiers between parallel loops but if that sacrifices the concept of parallel running of loops, then is there another option?

 

V

 

 

Message Edited by VeeJay on 06-03-2010 10:35 AM
I may not be perfect, but I'm all I got!
0 Kudos
Message 34 of 42
(936 Views)

VeeJay wrote:

Hi Guys. i have one more question. How to make the two parallel loops in effect parallel when you use notifiers to send the "end loop" value between loops? If I remove notifier queue and just use "local variable" to send "end loop" value to both loops, I find that both loops update main vi based on the time delays in each subvi. But, if I have the notifier queue, I see that they are not in effect parallel and sometimes , only one subvi updates the main vi. Is this correct? I really like the use of notifiers between parallel loops but if that sacrifices the concept of parallel running of loops, then is there another option?


You should probably start a new thread with this since it's a totally different question. That said, show us some code so we can see what you're doing. I don't understand why you have time delays in the subVIs to control loops in the main VI. That makes absolutely no sense to me. 

0 Kudos
Message 35 of 42
(925 Views)

Vee Jay:  The only way that the loops would not be in parallel is to have an output from one loop being an input to the other loop.  With Notifiers, this should not be the case.  In fact Notifiers are used so that you don't have to put wires from one loop to the next.  Look at the following example on Notifiers.  The two loops are in parallel because there isn't any wire going FROM one loop INTO the other.  There is a wire feeding both loops (Notifier reference) but they are INPUTS to both loops.

 

Notifiers_BD.png

 

- tbob

Inventor of the WORM Global
Message 36 of 42
(916 Views)

tbob wrote:

Vee Jay:  The only way that the loops would not be in parallel is to have an output from one loop being an input to the other loop.  With Notifiers, this should not be the case.  In fact Notifiers are used so that you don't have to put wires from one loop to the next.  Look at the following example on Notifiers. 


Not to mention the examples that ship with LabVIEW... Smiley Wink

0 Kudos
Message 37 of 42
(908 Views)

@smercurio_fc.. I have referenced 🙂 the question based of of the previous vi's I have attached. Nonetheless, I am attaching two sets (main, subvi1 and subvi2) with my question.

 

@tbob, You had given me this example (reg. notifiers and that I understood really well :))  before and that is what I have used. But, I still see what I had described before. Even if loops in both subvi have same wait time, the values are not updated in main vi as I see in the first set (i.e without notifiers)

 

(In the notifier example set, if we run loop1 and then loop 2, you will see what I am saying)

 

V

 

 

I may not be perfect, but I'm all I got!
Download All
0 Kudos
Message 38 of 42
(900 Views)
next 3 attachments. 🙂
I may not be perfect, but I'm all I got!
Download All
0 Kudos
Message 39 of 42
(899 Views)

Your use of notifiers is incompatible with you having loops inside the subVIs. In the notifier-based implementation when subVI 1 starts it blocks the upper loop. The second loop waits forever at the notifier because the upper loop is never sending the notification - it's waiting for the subVI to complete.

 

Frankly, I think your architecture makes no sense to me.

 

Also, it's pointless to wire an output from the subVIs. You're already updating the indicators through the property nodes. The reading of the subVI output and writing to the front panel indicator at the main VI level will not happen until the subVI finishes, and you've already written the value to the indicator via property nodes, so this is an operation that does something you've already done - i.e., a waste of time. 

0 Kudos
Message 40 of 42
(884 Views)