LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to create an error logfile

Solved!
Go to solution

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?

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Thanks as kudos only:)
0 Kudos
Message 1 of 25
(8,409 Views)

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.

-----

The best solution is the one you find it by yourself
0 Kudos
Message 2 of 25
(8,407 Views)

Can we do it in the same VI?

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Thanks as kudos only:)
0 Kudos
Message 3 of 25
(8,403 Views)

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?

-----

The best solution is the one you find it by yourself
0 Kudos
Message 4 of 25
(8,397 Views)

Use a FGV to initialize, log, then close your log file. As stated before you should you a simple text file

Rodéric L
Certified LabVIEW Architect
0 Kudos
Message 5 of 25
(8,394 Views)

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??

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Thanks as kudos only:)
0 Kudos
Message 6 of 25
(8,373 Views)

Hello,

          Is it the output of errorhandler.vi in the main VI is given as the input to the sub VI??Please help

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Thanks as kudos only:)
0 Kudos
Message 7 of 25
(8,348 Views)

please reply about the faults with the above attached VI.

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Thanks as kudos only:)
0 Kudos
Message 8 of 25
(8,343 Views)

I have attached a quick example. Take the File String and write it to a text file.

 

 

-----

The best solution is the one you find it by yourself
Download All
0 Kudos
Message 9 of 25
(8,340 Views)

In this particular example how can we know,where the details get saved?

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Thanks as kudos only:)
0 Kudos
Message 10 of 25
(8,336 Views)