LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

one or more data sinks out of sub vi

Solved!
Go to solution

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.




metzler CLAD
Download All
0 Kudos
Message 1 of 7
(4,093 Views)
Solution
Accepted by topic author metzler

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 

Message 2 of 7
(4,081 Views)

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?




metzler CLAD
0 Kudos
Message 3 of 7
(4,073 Views)
Your understanding of how to pass data from and to a subVI seems to be backwards. If you want to pass data to the subVI, you would wire up the controls to the connector pane and convention says to place those on the left side of the connector pane. If you want to get data from a subVI into the main, you would wire the indicators to the connector pane and convention says to use the right side of the conecotr pane. None of your indicators are wired so you have no way to get data back. Start fresh and remove all existing connections. It doesn't sound like you need any of the subVIs controls on the connector pane.
Message 4 of 7
(4,065 Views)

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

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 5 of 7
(4,057 Views)

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. 




metzler CLAD
0 Kudos
Message 6 of 7
(4,029 Views)

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.

0 Kudos
Message 7 of 7
(4,026 Views)