cancel
Showing results for 
Search instead for 
Did you mean: 

SubVI Waiting to Run

Stu Dapples
Member

SubVI Waiting to Run

I have written a data acquisition program with LV 6. I have written it so that one part of the program gets data from our NI PCI-MIO-16 type card, and outputs the data to a global array at a frequency of 100 Hz. Other parts of the program then read the data from the global array, apply scale factors, graph, output to disk, etc, as required. All of this seems to work perfectly.

My problem arises as I try to stop my program. I go into either my continuous logging or manual logging sub VI parts of the program, and when I try to come out again the sub VI appears to stop, but it won't go away. The stop button is greyed out. The run arrow is white with a small black arrow inside. When I move the cursor over it the pop up message "SubVI Waiting to Run" a
ppears. The only way to stop the Sub VI is to close the window. I have followed the VI's through using highlighting, and I can't see any problems, any sub VIs still running. If I run the VI independently without coming into it from the calling VI, but still having the other data acquisition VI going as well, it works perfectly and exits fine.

What is the obvious problem that I am overlooking???? Is it a global VI problem? I am only using one Global VI, and it is also passing data between other VIs. Could this be the problem? Should I have a global VI which is the only link between the two VIs, and other globals for links between other VIs?

Please help if you can as I will not have much hair left soon!

Thanks in anticipation

Stu
3 REPLIES 3
Mache
Member

Re: SubVI Waiting to Run

Message contains an attachment
Hi Stu,

If I Understand Correctly is that you have a Few Vi's Running and when you try to Stop the Program, you want to be able to come out of the Sub Vi Panel. Also you have Described a Complex Situation very briefly so some details are unclear. However, Check these things.

You Wrote "The stop button is greyed out. The run arrow is white with a small black arrow inside. When I move the cursor over it the pop up message "SubVI Waiting to Run" appears."

The Run Button when White With a Black arrow indicates your SubVi is in "Running" State. This means that there is a top Level VI Which is running and has Some Code which will Call this Sub Vi. As soon as a top level Vi is Run, all subvi's called by the top Level Vi go into Running State. You are right, th
e Vi Can Be closed By Close Button. But If you were to Open this VI again You will see the same White and Black Arrow.

What You can do is Use Vi Server Property "Execution State" in A New Vi and run this VI supplying the Path Name of the Problem Vi while you are Having this Problem. I have attached a small Vi Where you can enter the Path Name of Vi you want to Check and run it. It will Give you the state of the VI, Running, Bad, Idle or Top Level. Mind you if your Vi is Not even Open it may give you "Bad"

Now if you get status as running it means it is currently reserved by a top Level Vi for Running.

So to Stop your Program and close the Window you may want to use Vi Server Property nodes to End Execution and Close Fornt Panel.

One Another thing to do to identify the problem is go to "Browse" Button and Look at Vi Hierarchy. Also there is a button "This Vi's Callers". If the Caller Vi Is Open It will show up here. Most Probably Because of Global Variable VI Which is at th
e Top you have a problem.

I Hope this Helps. If you can Post More Details - I am Sure you will get Contextual Help to sort your Problem.

Good Luck!! Baldness can be good Sometimes!!
Good Luck!

Mache
Mache
Member

Re: SubVI Waiting to Run

Message contains an attachment
Hi Stu,

I tried to Understand your Problem and realised that you may be calling a Vi from another Vi. In this case Based on your Sub Vi Node Setup You may be Wanting to Show the Front Panel of the Sub VI. Now when this Sub Vi Is Showing and If you close it, It will Pop Open Again When the Caller Vi runs on the next iteration.

So You have Hard time Closing the Panel. Attached is A Vi Library with three example Vi's. One Vi is Global Variable Data. Write Data.vi Writes Data to this Global. Read Data.vi reads Data from this Global.

Also Write Data can Call Read Data based on user Choice. Please Check the functionality of these three Vi's and Equate it to the Problem you are Having. Mostly this Should Give you an Idea to Sort out the issue you are having.


Good Luck!!


Mache
Good Luck!

Mache
Stu Dapples
Member

Re: SubVI Waiting to Run

Thanks Mache,

Your first answer actually pointed me in the right direction. You're not going to believe how dumb I am. I thought that I had set everything up correctly but I hadn't checked the close window if originally closed chack box in the Window Appearance part of the VI properties. How dumb is that!! As Homer would say, Doh!

I knew that it had to be something stupid and simple. The program now works perfectly.

Thank you for your time and assistance.

Stuart