03-22-2011 06:48 PM
Hi to all good fellowz!!!! 🙂
I have a question about SubVi. I have some SubVi that something changes inside it. When I try to do some program with that subVi I want to see also that changes happen but it doesnt show these changes. First of all the program runs subVi and after that gives me a final answer from subVi but I want to see the changes in SubVi when I run the program.
Thank you.
03-22-2011 07:20 PM
Do a google search on LabVIEW control references. For a main vi with one subvi, that's what I would use. Something more complicated, queues. Look at the consumer producer examples for a start on queues. You can also share queues between vi's.
03-23-2011 02:31 AM
Cant you just set the property "open front panel when called" to TRUE in the VI properties of the SubVI?
YOu will have two front panels open in that case, but I guess you only want tot do this for testing?
If you're not doing this for testing, then indeed I would suggest producer-consumer architecture, where one loop has your user-interface (showing values), and your other loop executes this subVI. Data between two loops can be transferred in different ways :
- local variables (bad solution)
- functional global (VI that stores information in one state and that can be read some place else)
- queue's
Where 1) is really easy, 2) is still easy but a bit more work, 3) is a bit harder, but I'm sure that you can do it
I would go for the FG in this case, and have the consumer-producer design pattern
03-23-2011 04:34 AM
Thank you,but I prefer if you do my example. I'm pretty new in LabView and I dont really understand how to do this with producer/consumer case.
Thanks again.
03-23-2011 04:39 AM
how do you want it? the subVI that pops-up so you can see the values? or you don't want to see the subVI and just the values.
Producer consumer is really easy, of coarse you will have to know the terms :
- state machine
- queue
Have you googles these terms before, and do you know what they are and do?
03-23-2011 04:44 AM - edited 03-23-2011 04:46 AM
Oh man.... such a quick response.. thank you 🙂
for you maybe it's easy but for me not so.. actually I took only 5 lessons and we got pretty complicated exercise after so much easy.. so.. 🙂
I just want to see the values changes in my main program includes subVi.. but another solution is interesting too for me as educational purposes 🙂
do you have a gmail by any case?. we can chat there if I will not understand something.
P.S. actually I know what that queque and what that state machine.. I did something like semaphore in VHDL a 100 years ago 🙂
03-23-2011 04:48 AM
let's just stick to this forum, so other people can join in if they want to as well.
I'll prepare something in a few hours
03-23-2011 04:50 AM
thank you man 🙂
I'll have a many questions further... so we'll keep in touch 🙂
03-24-2011 04:30 AM
Hi Dimani,
As promissed an example. If there is something you don't understand, please let me know.
The Main VI is Producer_Consumer.vi
03-24-2011 04:42 AM
REMARK
There is one thing you need to do for yourself. You should destroy the Queue in the stop case of the top loop.
It works perfectly this way, but it's not really good programming 😉
Gives you a little bit of work to do yourself 😉