LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

functions don't run when error in

I've encountered several problems where functions or express VIs don't run when there is an error in.  Basically, if the error line has an error, the VI or function is bypassed without doing anything.  When writing to a TDM file, an error was generated and then the close storage didn't execute and thus any other open of that same file doesn't work.  I also put a user defined error on the line when a measurement was out of tolerance.  This caused all subsequent functions or VIs to not execute even though I wanted them to.  The best way to ensure proper order of execution is the error signal, but with this little feature, I have to put in a lot of cumbersome sequences and not pass the error to each VI or function. 
 
What's the deal with functions not executing and is there a way I can make them without clearing the error?
0 Kudos
Message 1 of 8
(2,636 Views)
Skipping execution when there's an error in is pretty much a standard way of programming in LabVIEW. This should be discussed in tutorials and whatnot. The "Close" functions should execute even if there's an error in as this is the "safe" thing to do, so I'm not sure why the TDM Close doesn't.

It sounds to me like you need to make a distinction between an "operational" error, like not finding a file, or a DAQ device configuration not working, etc, and a "measurement" error like something out of tolerance. The latter you may not want to treat as a "hard" error, which is what would cause a VI to bypass execution.
0 Kudos
Message 2 of 8
(2,619 Views)
Is there a way to pass a "soft" error on the error line?
 
The error in my TDM write VI occurs because I stop gathering data if I have an error or out of tolerance.  So TDM tries to write data that isn't there producing an error.  But this error will cause the storage close not to work.  That's easy enough to work around.  But if there's a way to pass an error through the error line without causing hard errors, that'd be spectacular.
0 Kudos
Message 3 of 8
(2,613 Views)
The status in the error cluster is a Boolean. It's either on or off. There is no in between. Modifying your program to not write data when no data exists is not a work around. It's just correct programming, imho.
0 Kudos
Message 4 of 8
(2,601 Views)
SirMutt said

Is there a way to pass a "soft" error on the error line?
I think you took my statement about "hard" error a little too literally. What I meant is that under certain conditions you don't set the boolean of the error cluster to be on. You could, for example, use NI's convention of setting the boolean to false, and the error code to non-zero. This convention says that this is a warning. Note that this is just a convention, and so is not universally accepted or practiced.

Since you seem to have your own TDM write (your initial post did not explicitly say this), I agree with Dennis in that you should modify your code so that it simply doesn't write if there's no data, thereby not generating an error. This is how I would do it.

Message Edited by smercurio_fc on 08-10-2007 02:04 PM

0 Kudos
Message 5 of 8
(2,595 Views)

I did understand "hard" and used "soft" in that same vein.  I appreciate the suggestion for the warning convention. 

note, the TDM issue was just an example.  My issue is much more global than this one subVI.  I'll see if I can implement more of a warning structure rather than set a error.  I'm not sure what "imho" means but I'm pretty sure it's not what it sounds like 😉

Thanks.

0 Kudos
Message 6 of 8
(2,587 Views)

I did understand "hard" and used "soft" in that same vein.  I appreciate the suggestion for the warning convention. 

note, the TDM issue was just an example.  My issue is much more global than this one subVI.  I'll see if I can implement more of a warning structure rather than set a error.  I'm not sure what "imho" means but I'm pretty sure it's not what it sounds like 😉

Thanks.

0 Kudos
Message 7 of 8
(2,588 Views)
in my humble opinion
0 Kudos
Message 8 of 8
(2,583 Views)