LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Creating error log file question

Hi,
 
I'm still kinda new to LabVIEW. I am creating an error log for internal errors, mostly things like failure to create folder, fail to send email etc...
When error occurrs, I write error messages to global variable in each subVIs and read the string and write to text file. I have couple of problems doing this right now...
When error occurrs, the dialog pops up and stops the program so I can't write the log file (the log file vi is placed in main vi).
Another problem is same global variable is used in the several subVIs. So, the second error message overwrites the first error message. when I write the error log to the text file, it only reads the last error message from the global variable. Is there a way to append the write to global variable?
I feel lost. Can someone give me an idea?
I really appreciate the help.
 
Thanks,
 
0 Kudos
Message 1 of 3
(5,928 Views)

Hi tgif,

      If the error is wired, I don't think you should be seeing any automatic dialog, is there an error-handler VI on the diagram?

Anyway, the answer to "second error message overwrites the first" is to use a queue for the errors.  Have your main VI check a queue instead of a global variable.  Errors could be written to a queue from many different places at the same time, these errors will simply be stored in the queue and your error-logger can handle them sequentially! Smiley Happy

Cheers.

"Inside every large program is a small program struggling to get out." (attributed to Tony Hoare)
Message 2 of 3
(5,897 Views)

Hi tgif

In this link http://forums.ni.com/ni/board/message?board.id=170&message.id=199742&query.id=103650#M199742 you can find a library (Log4L.llb), which I developed and which does exactly what you want.

Just have a look at it..

Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
Message 3 of 3
(5,893 Views)