11-07-2005 11:52 AM
Hi,
I have created a subvi which I now use in my main VI, however, I now want to use the values from the subvi WITHOUT having to have a control in my main VI. I can't seem to find a tool to convert a reference to a type.
Anyhelp would be much appreciated.
Thanks,
Paul.
11-07-2005 12:01 PM
Hi Paul,
can you not take a constant? You have to wire the SubVI to start it. If you like to transfer values to a started SubVI, you can take local or global variables for example.
Regards ThomasD
11-07-2005 12:32 PM
Hi,
Thanks for your prompt reply.
When I try and connect my subvi to a variable I receive the following error
"A wire must be connected to one and only one data source, such as a control's terminal or a function output. This wire is connected to two data sinks but zero sources. You must add a source, perhaps by changing an indicator to a control."
I need to convert the reference type outputted by my subvi to a type (i.e. string, integer, etc) than I can use it without the need for a reference from a control or indicator.
Thanks again,
Paul.
11-07-2005 01:00 PM
11-07-2005 02:18 PM - edited 11-07-2005 02:18 PM
Hi, thanks for your reply.
When I connect the indicator or control in the subvi to the connector plane, the value from the mainvi does not get passed down in run time, hence why I used references. Is it possible to dereference (as such) the reference?
for example
SUBVI ->passes value to main -> change reference to a type (boolean, integer) -> to a case statement in main vi WITHOUT a control or indicator
Thanks again,
Paul.
Message Edited by bigdave on 11-07-2005 02:21 PM
11-07-2005 02:24 PM
11-07-2005 03:02 PM - edited 11-07-2005 03:02 PM
Hi Dennis, thanks again for your reply,
This is exactly what I have done, use references. In the main vi to access this reference you must then create a control or indicator, then right click and create a reference, then link this reference to the subvi.
I don’t want to have to create an indicator or a control… I just want to use the value outputted by the subvi.
Thanks,
Paul.
Message Edited by bigdave on 11-07-2005 03:03 PM
11-08-2005 09:34 AM
Hi again,
Just to let you all know, I found the "hide" function on the indicators and controls, so I create my controls, then a reference so that I can get the values in/out of my subvi, then hide the controls and connect up the references. Very poor way of doing what I want, but it works.
11-08-2005 09:43 AM
Hi Bigdave,
It sounds you are approaching this in a manner that is not consistant with how LV is intended to operate.
Please post a zip of your top level and sub-VI's so we can look and advise.
We are very good if we have pictures to work with!
Trying to get you started out on the right foot,
Ben
11-08-2005 12:13 PM - edited 11-08-2005 12:13 PM
Hi Ben,
I have included a simple VI of what I would like to achieve. Any questions just ask.
Please keep in mind that this is a simple model of what I would like to do.
Thanks again,
Paul.
Message Edited by bigdave on 11-08-2005 12:13 PM