LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Question about SubVi

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.

Download All
0 Kudos
Message 1 of 12
(3,069 Views)

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.

Message 2 of 12
(3,064 Views)

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

Kind regards,

- Bjorn -

Have fun using LabVIEW... and if you like my answer, please pay me back in Kudo's 😉
LabVIEW 5.1 - LabVIEW 2012
Message 3 of 12
(3,048 Views)

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.

0 Kudos
Message 4 of 12
(3,039 Views)

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?

Kind regards,

- Bjorn -

Have fun using LabVIEW... and if you like my answer, please pay me back in Kudo's 😉
LabVIEW 5.1 - LabVIEW 2012
Message 5 of 12
(3,036 Views)

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 🙂

0 Kudos
Message 6 of 12
(3,033 Views)

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

Kind regards,

- Bjorn -

Have fun using LabVIEW... and if you like my answer, please pay me back in Kudo's 😉
LabVIEW 5.1 - LabVIEW 2012
Message 7 of 12
(3,029 Views)

thank you man 🙂

 

I'll have a many questions further... so we'll keep in touch 🙂

0 Kudos
Message 8 of 12
(3,026 Views)

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

Kind regards,

- Bjorn -

Have fun using LabVIEW... and if you like my answer, please pay me back in Kudo's 😉
LabVIEW 5.1 - LabVIEW 2012
Message 9 of 12
(2,987 Views)

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 😉

Kind regards,

- Bjorn -

Have fun using LabVIEW... and if you like my answer, please pay me back in Kudo's 😉
LabVIEW 5.1 - LabVIEW 2012
Message 10 of 12
(2,985 Views)