08-20-2009 03:05 PM
I have a sub vi that opens when the main vi starts. The user enters some data regarding the serial number of the product, the model of the product, ect., then presses okay.
The sub vi closes and disappears. This works well, the thing that doesn't work is the outputs. These are connected to the select inputs for some case structures, and I get an error, 'This wire connects one or more data sinks but has no source'.
I don't think this makes sense since the indicators of the sub vi are actually the souce for the case structures.
I'm probably missing something easy.
Solved! Go to Solution.
08-20-2009 03:35 PM
Each subVI uses itself as the directional reference for its connector pane terminals. So the Serial Number control is a sink (data goes into the subVI) and Serial Number 2 is a source (data leaves the subVI).
Your subVI has only inputs = sinks (even though some of them are on the right side) and no outputs = sources. Look at the image in the context help: It shows all the connections going to the left.
Also your loop should have a small wait to avoid consuming all available CPU resources while it runs. An Event structure would be better.
Lynn
08-20-2009 03:50 PM
Thanks johnsold for the quick response.
I can add a wait statement, but the main vi is not running during this. I guess a wait statement would help free up other resources - good idea.
The image in context help is a good indication what is going on. It shows all the terminal labels on the left, including Serial Number 2.
I am not that familiar with LV, so what can I do to make these sources so they will run the case structures?
08-20-2009 04:01 PM
08-20-2009 04:12 PM
The sub-VI should have some a button like "OK" that you press to continue. Add a while loop, and place an event structure and a wait statement inside. Add an event case to handle the pressing of the button. In the event case, you should, at a minimum, change the value of the while loop conditional terminal to "true" to exit the while loop (and therefore finish the sub-VI and return you to the main one). If you wanted to get fancy, you could have the OK button disabled until both the S/N and Operator controls have data in them. The help included for each structure is superb and you probably will be able to use them after reading it. If not, let us know!
Good luck!
Bill
08-20-2009 10:40 PM
This is what I ended up with - looking at the connector pane with the context help was the biggest help.
I was confused about how the source and indicators work. Thanks for all your help.
You have to press continue to get to the block diagram. This is the first thing the user sees when he starts the main vi, so it is outside of the event structure and while loops.
08-20-2009 10:46 PM
Why do you have the two indicators inside the While Loop?
They don't do anything. They are hidden indicators and aren't connected to the connector pane at all.