01-20-2014 11:14 AM
Hello,
I'm having a problem calling a subvi from the main front panel, where that subvi calls other two subvi's. My two last subvi's in the hierarchy have references in order to see the outputs on the front panel of the subvi. While from the subvi references work and I can see the output, when I try to reference the references from the subvi I can't see the output on the main front panel.
I know how to reference objects but do I miss something? Thanks
Solved! Go to Solution.
01-20-2014 11:41 AM
Could you post the code? I suspect you are not passing a reference somewhere along the line.
01-20-2014 12:06 PM
I'll post it in a few minutes. I'm trying to reproduce my solution in a smaller scale as the program I'm currently working on is very big
01-20-2014 12:12 PM
Here's some general advice for passing data from the SubVI to the Main VI.
1. Utilize LabVIEW's natural parallelism, use a design pattern with multiple loops (Queued Message Handler in LabVIEW 2013 is my favorite)
2. Use queues or notifiers to send data, it is much cleaner and easier in the long run (Notifier contains latest data only whereas the queue maintains the entire data history)
3. User event (while not generally recommended) can also be used to transfer data
Once we see your code we can make more specific recommendations for you.
01-20-2014 12:14 PM
Here is what I did in a smaller scale but it is exactly the same problem I have.
01-20-2014 12:19 PM
I also have another problem. The for loop outside the flat sequence of the main SUBvi I put it there in order to go through the flat sequence twice, but only the second subvi is executed twice. It was a logic thing to do but it seems it is wrong..
01-20-2014 12:44 PM
I believe you have a race condition with the Local Variable and the actual control in the SubVI. Delete the local variables and wire the control refnum directly to the property nodes.
01-20-2014 04:20 PM
I did it, so now I have two controls in my SUBvi, but nothing happened. I don't know what the solution is to either to my two questions..
01-20-2014 05:02 PM
Ok, I've looked at your code in more detail and the version that you posted works exactly as I would expect it to. Here's what is happening:
Instead of using AutoReset which I don't currently have time to understand how to make work, use the iteration terminal in the while loop in Sub1 and Sub2 and place the "Equal to Zero" function next to it, wire the output of that function to the "Reset" terminal on your elapsed time and I believe you'll see the response you are after.
01-20-2014 05:08 PM - edited 01-20-2014 05:08 PM
@Charles_CLA wrote:
Here's some general advice for passing data from the SubVI to the Main VI.
3. User event (while not generally recommended) can also be used to transfer data
Once we see your code we can make more specific recommendations for you.
I'm curious, why do you say that. User events can be used to great affect and can be the right method for passing data under certain circumstances.