01-29-2013 01:36 PM
While using the Format Into File function to create a text log file of some test results I noticed that if there is an error present on the error stream that the VI seems to run properly but the Format to File function doesn't actually write data to the file. I have never noticed this behavior in Labview on any other function whereas if there is an error present a function doesn't run. Typically, if I don't want to run a section of code when there is an error I have to surround it with a case statement and run the error stream into the case selector to skip it.
I noticed this in a test application where I generate defined errors when certain failures happen during my test but I would still like the application to write my log file no matter if there is an error of not. In this case if one of my defined errors happen it doesn't write a log file. I purposefully have to clear all errors prior to calling my logging VI which I don't really want to do.
So my question is why does this behaviour occur in the Format into File function? If it is expected behavior are there other functions that this happens with that I am unaware about?
I have attached a VI that shows this behavior.
Solved! Go to Solution.
01-29-2013 01:39 PM
The vast majority of functions with an error in do not execute if an error is present. Typically, if a function executes with a error (i.e. VISA Close), it is noted in the help that it runs even with an error.
01-29-2013 01:51 PM
ok thanks!....I see that now in the help for the Close File function. I'll just have to pass the error stream through this logging subVI without routing through the Open File or Format to File functions. Can't believe this is the first I have noticed it!!