12-13-2016 08:40 PM
Hi,
I would like to bring a few value from the main VI to another VI under the same project file but I am not sure what is the best method of doing it. Is it by using global variable or by subvi?
Thanks
Solved! Go to Solution.
12-13-2016 09:01 PM
There are many ways to pass data around. Which method to use is based on what you are trying to pass around, to who (most as in how many processes), who can update the data, etc, etc. In general, I find Queues and User Events best for passing data around. Again, it would help if you gave a lot more information about exactly what you are trying to do.
12-13-2016 09:06 PM
Hi,
The value passed can only be changed at the main VI. I am just passing a few dbl values that's all. It will be best if i can use the values passed in some arthemical function
12-13-2016 09:36 PM
I would say that most of the variables I pass between sub-VIs are passed by wires going into 2-3 Connectors (I'm not counting the Error Wire, which is almost always coming in on the lower left) and out through 2-3 Indicators (again, not counting the Error Wire). Very quick, very simple, very "DataFlow".
Bob Schor
12-13-2016 09:39 PM
Sorry but it is possible to have an example of passing of variable using subvi ?
12-13-2016 09:41 PM
@Bob_Schor wrote:
I would say that most of the variables I pass between sub-VIs are passed by wires going into 2-3 Connectors (I'm not counting the Error Wire, which is almost always coming in on the lower left) and out through 2-3 Indicators (again, not counting the Error Wire). Very quick, very simple, very "DataFlow".
Bob brings up another good point. Are you trying to pass data to a process that needs to run in parallel with the producer? If not, then just call the VI directly and use the connector pane.
If you are running in parallel, then my next questions are:
How often are the values updated?
Do you need to process every value or just the latest value?
12-13-2016 09:42 PM
Yes, it will have to be run in parallel. The value updates every 1 mins
12-13-2016 11:26 PM
Sorry, I would like to edit the question.
Is it possible to pass values back and forth between 2 VI?
Both VIs will be running concurrently.
Thanks
12-14-2016 01:47 AM
Hi Neo,
yes, that's possible!
When you keep asking such basic questions you should take the free online resources offered to help you learn LabVIEW and DATAFLOW!