LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to handle errors in two parallel loops?

Solved!
Go to solution

Hello,

i have a loop that contains an event structure and a second parallel loop that reads digital-inputs.

 

My question is:

a) How can i handle the errors from the different events? So if in event1 is an error that event2 gets this as input and can react on it. Currently all events begin with "No error".

b) What can i do with the second loop? This is also always startin with "No error" and does not know anything if there is an error in loop1.

Can this be only done with a global variable?

 

Thx for help

0 Kudos
Message 1 of 2
(2,346 Views)
Solution
Accepted by OnlyOne

Create a user-defined event that gets fired whenever an error occurs. The input data to the event should be an error cluster inside another cluster -- you'll see why when you go to use it.

 

Now create a subVI that when it is called with its input error cluster showing an error, it fires the event that you created above, otherwise it does nothing. Install that subVI in both loops after everything else.

 

Register the user event on your event structure and put in its event handler whatever you want to happen when an error occurs. It should probibly give you the option of quiting. If an error occurs in either loop the same evnt will be fired and you will get the chance to shutdown.

 

Mike...

 


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
Message 2 of 2
(2,340 Views)