05-10-2012 04:53 AM
Hi,
I want to make an error logfile in the below format:-
Date Time Error Number Error
1/1 1:00 3243543 error description
- - - -
- - - -
The error logfile has to be automatically created after the running of a particular program.(only date and time when no error occurs).
Can anyone can give me the samplecodes for doing that?
Solved! Go to Solution.
05-10-2012 04:55 AM
You have to do it by your own. Suggestion: Convert everything into string and make it in an order and use the write to text file function. Try this as a simple challenge.
05-10-2012 05:08 AM
Can we do it in the same VI?
05-10-2012 05:13 AM
Yes but it is always preferred to be used as a sub vi.
1. Create a sub vi which takes the values from the error cluster and convert intop string
2. Format the string with date and time
3. Have error in and error out in that module and inside use a case structure and pass the error wire to the case selector and in the error case write all the error cluster
4. In the error less case (Green) just write the date and time and some info if required
5. Plug this vi into any vi you want.
Clear?
05-10-2012 05:15 AM
Use a FGV to initialize, log, then close your log file. As stated before you should you a simple text file
05-10-2012 11:34 PM
Hi Anand,
Tried,as per the instructions you have given
"Have error in and error out in that module and inside use a case structure and pass the error wire to the case selector and in the error case write all the error cluster."
please specify how the above can be done?Where should we write the error comments.Is the error code will appears automatically.What all will be the connectors in this subVI??
05-11-2012 04:05 AM
Hello,
Is it the output of errorhandler.vi in the main VI is given as the input to the sub VI??Please help
05-11-2012 04:51 AM
please reply about the faults with the above attached VI.
05-11-2012 05:07 AM
I have attached a quick example. Take the File String and write it to a text file.
05-11-2012 05:52 AM - edited 05-11-2012 05:53 AM
In this particular example how can we know,where the details get saved?