Quit all loops when an error happens in one loop

When I tried to do parallel tasks (e.g. multiple producer/consumer loops) in LabVIEW, it was always painful to quit all loops “elegantly”. What I wanted was a notifier to tell all loops when an error occours in any loop. I know there are a few error manager VIs in the internet already but I just reinvented the wheel anyway.

In this error manager.vi there are 3 states: reset (clear errors in the shift registor), read (monitor if there is an error) and hold (stop reading when error).

sub3 sub1 sub2

So I sort of created a functional global variable here using the single loop to store the error. You can use this VI in every loop and it will quit all loops if an error happens. Here is an example:

topNote that we need to initialize the error manger before using it. When an error button is pressed in a loop, all loop will quit.

Hope this is useful to you:)

Tags : ,

One thought on “Quit all loops when an error happens in one loop”

  1. Hi!

    This is a pretty cool thing to have, I usually use something like this in all my multi-loop projects because it saves me the headache of sending error messages to every single loop. You can also incorporate a standard stop function here. My flavor usually uses the Error (and stop information) stored to set output state, so there is no need for a separate “Hold” state.



Leave a Reply

Your email address will not be published. Required fields are marked *