packstove Posted September 20, 2006 Report Posted September 20, 2006 Download File:post-5627-1158786719.viI am currently working on a project that will continuously log data at set times through the day for a process consisting of two (actually three events. One event triggers at both on and off modes). Depending on the event, data is logged a different rates. One log rate occurs for Event 2 for 30 min unless interrrupted by Event 1 for which there is a differernt log rate that takes over. If Event 2 is not interrupted then a 3rd log rate takes over until interrrupted by Event 1 or 2. I am in NO WAY asking anyone to do my homework for me . The VI operates wonderfully (granted with a heck of alot of polling going on; I have yet to get a handle on event triggered programing with event cases), and it saves files when prompted to. The Problem is I CAN'T GET THE VI TO STOP!! When I try to stop the VI with a Button Controller on the front panel, all loops seem to stop fine but the VI tries to save a final file twice. I only wanted once and the VI will not exit. I can't seem to figure out why. I'm monitoring all loops from the front panel and they all seem to stop. If someone could take a look at it and tell me why it will not stop, it would be greatly appreciated. That's all I'm asking, just help me stop it. Of course any other suggestions are more than welcome . I have attached the VI for your perusal Quote
Richard_Jennings Posted September 21, 2006 Report Posted September 21, 2006 Lot of parallel loops there :-) Remember a while loop always executes at least once. I believe your loops are executing twice because you are reading the "stop generation" local in the outer loop without any data dependency on the inner loop. Solution - pass the value from the stop generation local in the inner loop out to the outer loop and use it to stop the outer loop. In your example the outer loop reads the value of the local (F = keep going) and starts the inner loop (based on your case selector). When the inner loop terminates on stop generation, the outer loop executes one more time. As for why your application won't stop - chances are the queue is waiting for data that will never come. Kill the queue using one of the data writer loops instead. I hope this is understandable. Richard Quote
packstove Posted September 21, 2006 Author Report Posted September 21, 2006 As for why your application won't stop - chances are the queue is waiting for data that will never come. Kill the queue using one of the data writer loops instead. That makes sense. I'll give it a try. Thanks Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.