06-02-2010 01:51 PM
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! 😉
06-02-2010 02:00 PM
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.
06-02-2010 02:21 PM - edited 06-02-2010 02:22 PM
06-03-2010 10:34 AM - edited 06-03-2010 10:35 AM
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
06-03-2010 11:37 AM
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.
06-03-2010 12:05 PM
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.
06-03-2010 12:12 PM
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...
06-03-2010 12:36 PM
@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
06-03-2010 12:36 PM
06-03-2010 01:31 PM
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.