LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Non running SubVi ?

Hello every one,

I'm trying to call subVi from a main labview VI.
The way I do it, is to choose from the function pallete "Select a VI", so when I press a certain button on my main Vi, the subVI just pop up.

But my problem is that when it pops up , it is already running , and that s not what I want . I looked around and I didn't find the way to do it so it doesn t already run when it pops up .

I any one, it will be very welcome.

thanks

klaks
0 Kudos
Message 1 of 8
(3,254 Views)
To get a VI not to run, you will need to get its reference (use Open VI reference), and wire it into a property node and change the property "FP.Open" to T. However, why don't you want the VI to run? I can't think of any real good reason for this. Usually, the user should not think of this as "a VI" but as "a screen". They should not even see the run button. If you want the VI to have an additional delay before it starts running you can add a small piece of code at the beginning of the VI (like a while loop or an event structure) which will delay the VI until the user allows it to start.

___________________
Try to take over the world!
0 Kudos
Message 2 of 8
(3,245 Views)
A non-running subVI has no purpose except for development. You could design it so it runs, but waits for input.

You probably could open the front panel of a non-running subVI by using a VI reference and then invoke "open FP", but I don't se the purpose. Could you explain what you are trying to achieve with this?
0 Kudos
Message 3 of 8
(3,239 Views)
tst, you're obviously a bit too fast for me. We seem to have the same schedule. 😉
0 Kudos
Message 4 of 8
(3,236 Views)
hello again, thanks for your help.
In fact I'm doing this for someone, and that's simply what I was asked to do, even though it might not be the best solution.
The solution, where we make it wait is better.
In one of the VI I call, some inputs have to be made before we run it, otherwise we get an error.
So that s why I wanted to make it pop up and not be running.

thanks again.

klaks
0 Kudos
Message 5 of 8
(3,226 Views)
thanks a lot tst,
I do not think I really understand the way you suggested( sorry, I'm a beginer).Would it mean, we would have to write the path of the subVI somewhere ...
Or should it just be wired to the subVI ????
Ad you can see in my attachement, I m just calling SubVIs.
In Fact I was asked to do it this way, since I'm doing this for someone.

thanks again.

klaks
0 Kudos
Message 6 of 8
(3,223 Views)
This is how you make a subVI that waits for user input. As others have mentioned, there is another way to do it but this is the cleanest and best for end users.
0 Kudos
Message 7 of 8
(3,217 Views)

There are 2 ways you could do this:
1. Add a wait. For example, you could add a button which should be pressed once all the data has been input and have an event structure waiting for a value change of that button outside the while loop. Then, wire something from within the structure and connect it to the while loop. The while loop won't start until the event structure is finished.
2. When the front panel is open, right click on the vi icon and select "show connector". You can use this to pass data to the subVI.

In both cases, you should watch out for what you read from the file. I'm not sure what it does, but if you need it first you will have to change the VI. Also, do you really need to read the file in every iteration of the loop?

One last thing, the panel of that VI is very big and hard to follow. You should use a tab control to keep the size down and to have it more organized and convenient.

To learn more, I suggest you read the LabVIEW user manual. Also, try searching this site and google for LabVIEW tutorials. Here is one you can start with. You can also contact your local NI office and join one of their courses.
In addition, I suggest you read the LabVIEW style guide.


___________________
Try to take over the world!
0 Kudos
Message 8 of 8
(3,215 Views)