LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

error out

I have a super quick question:
 
In a lot of sample Labview programs, I notice that the sub VI's are connected by the error out icons. For example, a simulate signal express error out is connected the graph that displays this signal by error in (with a pink wire). My program has no error out or error in connections wired yet my program runs fine. Does wiring these error out/in terminals create data dependecy? And is it a problem if my program doesn't have this data dependecy because it should?
 
Thanks
 
Cam
0 Kudos
Message 1 of 4
(2,841 Views)
By  wiring the error in and out clusters you create a dependency and you can determine the order of operation. And yes your VI should have a way of dealing with errors and the error cluster is one of the better ways. It is just all around good programing. Read the labview style guide and you will see.



Joe.
"NOTHING IS EVER EASY"
0 Kudos
Message 2 of 4
(2,834 Views)
Wiring the error in/error out connections does enforce data dependency as well as passing error conditions from one function to another. Even if you have the automatic error handling turned on and you have dependency by passing a value from one function to another, it's a good idea to wire the error in/error out connections. For example, if you have subVI a that generates an error, passes data to subVI b, and the error out is wired to subVI b, subVI b should be written so that action is performed when an error is passed. You can do that by enclosing the functions in subVI b with a case statement and wiring the error in control to the case selector. This is the way that the native LabVIEW functions are written. If you don't want data dependency and really want functions to execute in parallel, then obviously, you wouldn't wire error out to error in. You could however, do a merge errors function on the outputs. It is also considered (by me at least) better style to use the error in and error out connections instead of a sequence structure.
Message 3 of 4
(2,833 Views)
Even if you don't use them, include Error In and Error Out in all of your vi's to make wiring and data dependency easier.  You can avoid using sequence structures by wiring Error In and Error Out in the order of execution desired.  See top half of picture on how to pass the error straight through.
 
Also, you might not want to execute some code if there is an error.  An example is readign from a file.  If the file does not exist, how can you read from it?  When opening the file, an error will occur since it doesn't exist (unless you specify create).  In the read function, the error in determines whether to attempt a read or not.  That way you are not creating a multitude of errors from one major error.  See bottom half of picture.
 

Message Edited by tbob on 08-01-2006 12:43 PM

- tbob

Inventor of the WORM Global
0 Kudos
Message 4 of 4
(2,825 Views)