LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

QMH won't stop all loops

Solved!
Go to solution

I am having a rather peculier problem that I can't track down what is going on.

 

I have a QMH structure with several queues to control several loops. I have the exit button tied to Exit cases on all my loops, yet when I hit the exit button, LabVIEw doesn't stop. I have figured out that two of the loops don't ever send a true signal to the stop node, but the loops themselves don't keep updating. If I run the program with Highlight execution on, the program stops like it should, but run without highlight execution it hangs up. The probe window stops showing execution times for the loops, so it seems like the loops have stopped, but LabVIEW keeps running. I've tried everything I can think of to no avail.

 

 

Any ideas what is going on?

0 Kudos
Message 1 of 6
(3,700 Views)

You are missing lots of subVIs, and type defs.

 

"Include all subVIs, typedefs, global variables, project files, and any other files you made to run the VI."

 

When Posting Code

0 Kudos
Message 2 of 6
(3,678 Views)

I can't say why the program is not stopping, because you did not include all of the VI's. However, I can offer some pointers.  First, It looks like you are not stopping the DAQ task or closing any references when the Exit button is pressed.  I suggest creating a new event that fires when the Exit button is pressed and call it something like "Send stop".  Then have your message handler send your other loops messages to clean up references and you can stop these loops after cleaning up. Also, you can fire your exit event in this state, so the message handler is stopped. 

Message 3 of 6
(3,665 Views)

I wasn't sure how to upload all my code...looks like I guessed wrong. The attachment should have allt he VI's now as I attacehd parent folder to the project. I'm not sure how to attach a VI with all sub Vi's and librariesany other way.

 

 

In the meantime I have been adding code in other case structures and now everything works fine. I didn't touch any of the exit cases, or any of the message queues which had me baffled. I added the max/min for an array code and an indicator.

 

I don't know what I changed that made it work.

0 Kudos
Message 4 of 6
(3,651 Views)
Solution
Accepted by topic author adekruif

I'm not seeing anything about your shutdown, but here are a couple of comments:

1. You do not need the Wait 0 in all of your loops.  The dequeue process and the waits inside of your self enqueueing cases will take care of not letting the loop be greedy.

2. In the Display Loop, you do not need to enqueue the "Update Display" state since that is being done by the DAQ Loop.  You are likely getting into a weird state with that where you have extra elements in the message queue, but you are waiting on the data queue.

 

#2 might actually be your problem.  If the DAQ Loop was stopped, but there are still more UpdateDisplay in the message queue for the display loop, but the data queue is empty, therefore you will be waiting forever for data to come in.  I would actually get rid of that data queue and just use the command queue (put the 2D Array in the variant data of the message).  Do the same for the Logging Loop.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 5 of 6
(3,533 Views)

Sorry for the late response. Have been busy with other projects at work.

 

I did get it to work and I believe what was happening is what crossrulz mentioned above. I modified the program and now the "Update Display" case only gets called from one place, so now I an't get into a state of having several cases. 

 


Thanks again guys!

 

 

0 Kudos
Message 6 of 6
(3,406 Views)