07-08-2013 01:15 PM
Hi
I'm new to LabView. I want to create a SubVi that is basically running a while loop and a value is changing during the loop execution. I need to be able to take the change value out of the loop during execution and make it one of the connections in my SubVi.
1. Is this a good approach to have a SubVi that has an output of a changing value?
2. If yes, I read in some forums about global variables as a solution but when I tried it I saw that the global variable is working fine, but the indicator I placed on my VI didn't. Is this the only option to get the value?
Thanks
07-08-2013 01:30 PM
A subVI will not output anything until it is done running. So if it is continuously running a while loop, it will never exit and therefore nothing will come out of your subVI. Consequently, anything wired to the output of the subVI will not be able to run either.
Can you give some more details about what you are trying to do? There are many solutions, but which one would be better would depend on your application.
07-08-2013 01:55 PM
I was trying to create a blinking LED (I know I can use the property to do blinking) as a concept for testing the ability to take a value out of a while loop.
You can see in the attachment what I did. Two of the three LEDs are blinking (one which is a local LED, the second is a global variable which is in write mode within the loop, and the last one is in read mode outside of the loop).
07-08-2013 02:07 PM - edited 07-08-2013 02:08 PM
In your code 'Blinker - global out of while loop' will execute just once. You can put this code in another loop.
And then you will its also blinking..!!
07-08-2013 04:13 PM
I am fairly new to LABView. With my vi I want to be able to change the frequency while the vi is running ,but how do I do that without stopping it and running it again? I would also like to add an LED that corresponds to the frequency. How would I do this. It seemed easy enough but I couldn;t get it to work.
Thank You
07-08-2013 04:18 PM
@Jerome1288 wrote:
I am fairly new to LABView. With my vi I want to be able to change the frequency while the vi is running ,but how do I do that without stopping it and running it again? I would also like to add an LED that corresponds to the frequency. How would I do this. It seemed easy enough but I couldn;t get it to work.
Thank You
This is totally unrelated to this thread. You should start a new thread.