From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

stop notifier

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.

0 Kudos
Message 1 of 8
(3,132 Views)

You haven't attached the VI.

 

Why are you trying to avoid using the error to stop the loops? Any reason for that?

Adnan Zafar
Certified LabVIEW Architect
Coleman Technologies
0 Kudos
Message 2 of 8
(3,116 Views)

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.

0 Kudos
Message 3 of 8
(3,114 Views)

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?

Adnan Zafar
Certified LabVIEW Architect
Coleman Technologies
0 Kudos
Message 4 of 8
(3,108 Views)

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.

0 Kudos
Message 5 of 8
(3,103 Views)

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.

0 Kudos
Message 6 of 8
(3,097 Views)

Well, I take that back.  Turns out now that I am using errors to stop, the program hangs up on the stop.

0 Kudos
Message 7 of 8
(3,083 Views)

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.

Richard






0 Kudos
Message 8 of 8
(3,070 Views)