06-24-2010 08:17 AM
I know there is a plethora of threads on this issue, but I have a fairly specific question. Basically, I have one "wait on notifier" vi that throws an error when I stop the loops, because the notifier gets destroyed by one of the other loops before the loop in question stops.
The vi is attached, and the notifier in question is named DAQ. This notifier lets the rest of the program know when to collect data. The top right loop only uses the notifier to know when data is being collected. The reason for this is that I need to write one value to a modbus coil on a button click. I did not want to include this in the modbus state machine, because it only happens occaisionally. The top right loop needs to know whether there is an existing VISA port open. Thus the notifier.
I am just not sure how to correctly stop the loops and eliminate the error. I know that I can use the error to stop the loops, but I was trying to avoid that.
06-24-2010 09:28 AM
You haven't attached the VI.
Why are you trying to avoid using the error to stop the loops? Any reason for that?
06-24-2010 09:35 AM
Well first, here is the vi.
I guess I don't have a good reason to avoid that method of stopping. I like the idea of a discrete stop command, rather than deliberately generating errors. I also have the vi nearly complete, and didn't really want to go re-program all of my stops either.
06-24-2010 09:46 AM
Well, you will need to use a Timeout in all your Waits otherwise what you have implemented is not going to work. You should just stick with using errors to stop the receiver/slave loops. What is the difference between the Sample and DAQ queues?
06-24-2010 09:52 AM - edited 06-24-2010 09:56 AM
What is the purpose of the time out? I have used this program already, and other than the error I am trying to deal with, it works fine...
The Sample notifier communicates the number of samples I want in several running averages. The DAQ notifier communicates when to acquire.
06-24-2010 10:09 AM
Well, rewrote for error based stops, and everything works now. I still feel like there must be a better way, as there could be a case where an error is generated, yet I need the loop to continue. Can't think of one right now, haha, but I'm sure there could be a case.
Either way, it works, although I'd still like some clarification on the timeouts. I added them and see no difference in functionality, running speed, anything.
06-24-2010 10:55 AM
Well, I take that back. Turns out now that I am using errors to stop, the program hangs up on the stop.
06-24-2010 11:55 AM
You need to parse out an example of what you are having problems with. The VI you attached is missing dozens of VI's.
It sounds like one of two things - another loop is looping and keeping the program from stopping, and/or a Notifier is waiting. To troubleshoot, change all your Wait on Notifiers to Notifier Status. These won't wait. Then try to stop the program. Also put an indicator on all the iteration terminals of your loops so you can see which one is stopping first/ still looping.