LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

indicator out of the loop?

Regarding mz previous question, i have localiyed the problem. I ca not read the data out from sub vi that includes a loop.
I need to the the values as while loop running to be used input of another sub vi. But when drag the indicator out of the while loop, it doesnt read data?
then what should i do?
0 Kudos
Message 1 of 13
(3,738 Views)
Hi looser,

you should think about dataflow - the indicator gets its data when the loop finishes. When you stop the loop the data flows out of the loop to the terminal!

Put the indicator inside the loop to have the current values displayed. Use globals (there are other methods as well) if you need the data in other loops as well.
How do you stop the loop? Do you want to control the loop from a main vi?

P.S.: Please don't forget to note the labview version you are using...

Message Edited by GerdW on 03-21-2007 02:19 PM

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 13
(3,730 Views)
I read some comments which are not reccomending use of variables!(although i dunno why) I wanna control that loop by and, i m using LV7.0..
I just read the enqueue option, but i think it passas datas when while stopped as piles of zhem. What i need is to have have pass the data out of the sub vi for each iteration..
anz suggestion?
0 Kudos
Message 3 of 13
(3,718 Views)
sorry for inconvience: answer to ur question: I want to control sub vi by main vi...
0 Kudos
Message 4 of 13
(3,718 Views)

Hey looser,

In order to control subvi by mainvi you have to go to the front panel of your subvi and right click on the icon in the top right corner.  Select Show Connectors and then wire the indicators/controls you want to whichever positions.  Save the vi then go to your mainvi and select the subvi and wire in the values that will control the selected indicators/controls.

Hope this helps,

0 Kudos
Message 5 of 13
(3,714 Views)
You should not be making this into a subVI if I understand what you've posted before. If you want to use the results in the main, that's where it should be left.
0 Kudos
Message 6 of 13
(3,712 Views)
I didnt get what u mean Knight Dennis:)
that s the answer of how pass data out of loop that is in the sub vi?
0 Kudos
Message 7 of 13
(3,703 Views)
Hi looser,

what Dennis meant: it's much easier to control this very small structure when it is embedded in the main vi instead of turning this into a subvi! You can control the stop buton from the front panel without using globals/queues/whatever and you easily can use the value generated in each iteration...
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 8 of 13
(3,690 Views)

No. It's not the answer to get the value of the loop. It's the answer to how you should be programming.

You want to ramp the power supply, correct? The power supply subVI is in the main, correct? The main has a while loop, correct? The decision to ramp up and down and the values calculated should in the main. You would have to make some serious changes in the ramping subVI to be even close to getting it to pass values back to the main. You would have to eliminate the while loop altogether. With your while lool in the subVI, you have not way to stop it and return to the main. You would have add shift registers to the main and pass these to the subVI. There's not much code there and can be easily placed in the Main. If you really want to try using a subVI, it should look something like the code below.

Message Edited by Dennis Knutson on 03-21-2007 08:46 AM

Message 9 of 13
(3,690 Views)
I think one of his questions was how to pass data on the fly from the sub-vi to the main without waiting for the sub-vi to finish.  This example shows how to use references to obtain data in real time from a subvi and display it in main, and also shows how a main control can be sent to the subvi in real time.
 
 

Message Edited by tbob on 03-21-2007 10:59 AM

- tbob

Inventor of the WORM Global
Download All
Message 10 of 13
(3,664 Views)