01-13-2008 08:10 PM
During the run of my
01-13-2008 09:35 PM - edited 01-13-2008 09:38 PM
Here is something I wrote and use in a particular application. I wrote it as a basic action engine. I drop this subVI down at the beginning of the Main VI and execute the initialize case and send it the desired error log filepath. That way I don't have to worry about creating the path in multiple parts of the program.
In each part of the program of interest I drop this in at the end of the error string and let it run the default case of Log Error. Each instance I use it, I create a string constant that has a short description to indicate the source of the error. I might say "DAQ Loop" or "Main State Machine" or "Data logging loop". Something so that when I see the log file, I'll know by my description which part of my code had the error. It puts out all of the error cluster information as well as a time stamp.
In the event something might happen that would cause repetitive errors that would fill up a log file quickly, I had put in a piece of code to prevent the log file from growing too large. But I never fully debugged that to my satisfaction, so I just disabled it. Fortunately, my programs haven't had so many errors generated to cause a large log file.
Edit: This is saved in LV 8.2.1